diff --git a/src/automation/HISTORY.rst b/src/automation/HISTORY.rst new file mode 100644 index 00000000000..27f152061e8 --- /dev/null +++ b/src/automation/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/automation/README.md b/src/automation/README.md new file mode 100644 index 00000000000..a524facbfde --- /dev/null +++ b/src/automation/README.md @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'automation' Extension +========================================== + +This package is for the 'automation' extension. +i.e. 'az automation' diff --git a/src/automation/azext_automation/__init__.py b/src/automation/azext_automation/__init__.py new file mode 100644 index 00000000000..e5e0f112b58 --- /dev/null +++ b/src/automation/azext_automation/__init__.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------- +# 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 azure.cli.core import AzCommandsLoader +from azext_automation.generated._help import helps # pylint: disable=unused-import + + +class AutomationClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_automation.generated._client_factory import cf_automation + automation_custom = CliCommandType( + operations_tmpl='azext_automation.custom#{}', + client_factory=cf_automation) + super(AutomationClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=automation_custom) + + def load_command_table(self, args): + from azext_automation.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_automation.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_automation.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_automation.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = AutomationClientCommandsLoader diff --git a/src/automation/azext_automation/action.py b/src/automation/azext_automation/action.py new file mode 100644 index 00000000000..a846b2766c4 --- /dev/null +++ b/src/automation/azext_automation/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/automation/azext_automation/azext_metadata.json b/src/automation/azext_automation/azext_metadata.json new file mode 100644 index 00000000000..7b56fb1e11a --- /dev/null +++ b/src/automation/azext_automation/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} \ No newline at end of file diff --git a/src/automation/azext_automation/custom.py b/src/automation/azext_automation/custom.py new file mode 100644 index 00000000000..7f31674ce96 --- /dev/null +++ b/src/automation/azext_automation/custom.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/automation/azext_automation/generated/__init__.py b/src/automation/azext_automation/generated/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/automation/azext_automation/generated/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/automation/azext_automation/generated/_client_factory.py b/src/automation/azext_automation/generated/_client_factory.py new file mode 100644 index 00000000000..928cba94bbd --- /dev/null +++ b/src/automation/azext_automation/generated/_client_factory.py @@ -0,0 +1,175 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + + +def cf_automation(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.automation import AutomationClient + return get_mgmt_service_client(cli_ctx, AutomationClient) + + +def cf_automation_account(cli_ctx, *_): + return cf_automation(cli_ctx).automation_account + + +def cf_statistics(cli_ctx, *_): + return cf_automation(cli_ctx).statistics + + +def cf_usage(cli_ctx, *_): + return cf_automation(cli_ctx).usage + + +def cf_key(cli_ctx, *_): + return cf_automation(cli_ctx).key + + +def cf_certificate(cli_ctx, *_): + return cf_automation(cli_ctx).certificate + + +def cf_connection(cli_ctx, *_): + return cf_automation(cli_ctx).connection + + +def cf_connection_type(cli_ctx, *_): + return cf_automation(cli_ctx).connection_type + + +def cf_credential(cli_ctx, *_): + return cf_automation(cli_ctx).credential + + +def cf_dsc_configuration(cli_ctx, *_): + return cf_automation(cli_ctx).dsc_configuration + + +def cf_hybrid_runbook_worker_group(cli_ctx, *_): + return cf_automation(cli_ctx).hybrid_runbook_worker_group + + +def cf_job_schedule(cli_ctx, *_): + return cf_automation(cli_ctx).job_schedule + + +def cf_linked_workspace(cli_ctx, *_): + return cf_automation(cli_ctx).linked_workspace + + +def cf_activity(cli_ctx, *_): + return cf_automation(cli_ctx).activity + + +def cf_module(cli_ctx, *_): + return cf_automation(cli_ctx).module + + +def cf_object_data_type(cli_ctx, *_): + return cf_automation(cli_ctx).object_data_type + + +def cf_field(cli_ctx, *_): + return cf_automation(cli_ctx).field + + +def cf_schedule(cli_ctx, *_): + return cf_automation(cli_ctx).schedule + + +def cf_variable(cli_ctx, *_): + return cf_automation(cli_ctx).variable + + +def cf_webhook(cli_ctx, *_): + return cf_automation(cli_ctx).webhook + + +def cf_watcher(cli_ctx, *_): + return cf_automation(cli_ctx).watcher + + +def cf_software_update_configuration(cli_ctx, *_): + return cf_automation(cli_ctx).software_update_configuration + + +def cf_software_update_configuration_run(cli_ctx, *_): + return cf_automation(cli_ctx).software_update_configuration_run + + +def cf_software_update_configuration_machine_run(cli_ctx, *_): + return cf_automation(cli_ctx).software_update_configuration_machine_run + + +def cf_source_control(cli_ctx, *_): + return cf_automation(cli_ctx).source_control + + +def cf_source_control_sync_job(cli_ctx, *_): + return cf_automation(cli_ctx).source_control_sync_job + + +def cf_source_control_sync_job_stream(cli_ctx, *_): + return cf_automation(cli_ctx).source_control_sync_job_stream + + +def cf_job(cli_ctx, *_): + return cf_automation(cli_ctx).job + + +def cf_job_stream(cli_ctx, *_): + return cf_automation(cli_ctx).job_stream + + +def cf_agent_registration_information(cli_ctx, *_): + return cf_automation(cli_ctx).agent_registration_information + + +def cf_dsc_node(cli_ctx, *_): + return cf_automation(cli_ctx).dsc_node + + +def cf_node_report(cli_ctx, *_): + return cf_automation(cli_ctx).node_report + + +def cf_dsc_compilation_job(cli_ctx, *_): + return cf_automation(cli_ctx).dsc_compilation_job + + +def cf_dsc_compilation_job_stream(cli_ctx, *_): + return cf_automation(cli_ctx).dsc_compilation_job_stream + + +def cf_dsc_node_configuration(cli_ctx, *_): + return cf_automation(cli_ctx).dsc_node_configuration + + +def cf_node_count_information(cli_ctx, *_): + return cf_automation(cli_ctx).node_count_information + + +def cf_runbook_draft(cli_ctx, *_): + return cf_automation(cli_ctx).runbook_draft + + +def cf_runbook(cli_ctx, *_): + return cf_automation(cli_ctx).runbook + + +def cf_test_job_stream(cli_ctx, *_): + return cf_automation(cli_ctx).test_job_stream + + +def cf_test_job(cli_ctx, *_): + return cf_automation(cli_ctx).test_job + + +def cf_python2package(cli_ctx, *_): + return cf_automation(cli_ctx).python2_package diff --git a/src/automation/azext_automation/generated/_help.py b/src/automation/azext_automation/generated/_help.py new file mode 100644 index 00000000000..0cbc9fe1ebb --- /dev/null +++ b/src/automation/azext_automation/generated/_help.py @@ -0,0 +1,1777 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['automation automation-account'] = """ + type: group + short-summary: automation automation-account +""" + +helps['automation automation-account list'] = """ + type: command + short-summary: Retrieve a list of accounts within a given subscription. + examples: + - name: List automation accounts by resource group + text: |- + az automation automation-account list --resource-group "rg" +""" + +helps['automation automation-account show'] = """ + type: command + short-summary: Get information about an Automation Account. + examples: + - name: Get automation account + text: |- + az automation automation-account show --automation-account-name "myAutomationAccount9" --resource-group \ +"rg" +""" + +helps['automation automation-account create'] = """ + type: command + short-summary: Create or update automation account. + examples: + - name: Create or update automation account + text: |- + az automation automation-account create --automation-account-name "myAutomationAccount9" --name "myAutom\ +ationAccount9" --location "East US 2" --sku name="Free" --resource-group "rg" +""" + +helps['automation automation-account update'] = """ + type: command + short-summary: Update an automation account. + examples: + - name: Update an automation account + text: |- + az automation automation-account update --automation-account-name "myAutomationAccount9" --name "myAutom\ +ationAccount9" --location "East US 2" --sku name="Free" --resource-group "rg" +""" + +helps['automation automation-account delete'] = """ + type: command + short-summary: Delete an automation account. + examples: + - name: Delete automation account + text: |- + az automation automation-account delete --automation-account-name "myAutomationAccount9" --resource-grou\ +p "rg" +""" + +helps['automation statistics'] = """ + type: group + short-summary: automation statistics +""" + +helps['automation statistics list'] = """ + type: command + short-summary: Retrieve the statistics for the account. + examples: + - name: Get statistics of an automation account + text: |- + az automation statistics list --automation-account-name "myAutomationAccount11" --resource-group "rg" +""" + +helps['automation usage'] = """ + type: group + short-summary: automation usage +""" + +helps['automation usage list'] = """ + type: command + short-summary: Retrieve the usage for the account id. + examples: + - name: Get usages of an automation account + text: |- + az automation usage list --automation-account-name "myAutomationAccount11" --resource-group "rg" +""" + +helps['automation key'] = """ + type: group + short-summary: automation key +""" + +helps['automation key list-by-automation-account'] = """ + type: command + short-summary: Retrieve the automation keys for an account. + examples: + - name: Get lists of an automation account + text: |- + az automation key list-by-automation-account --automation-account-name "MyAutomationAccount" --resource-\ +group "rg" +""" + +helps['automation certificate'] = """ + type: group + short-summary: automation certificate +""" + +helps['automation certificate list'] = """ + type: command + short-summary: Retrieve a list of certificates. + examples: + - name: List certificates + text: |- + az automation certificate list --automation-account-name "myAutomationAccount33" --resource-group "rg" +""" + +helps['automation certificate show'] = """ + type: command + short-summary: Retrieve the certificate identified by certificate name. + examples: + - name: Get a certificate + text: |- + az automation certificate show --automation-account-name "myAutomationAccount33" --certificate-name "tes\ +tCert" --resource-group "rg" +""" + +helps['automation certificate create'] = """ + type: command + short-summary: Create a certificate. + examples: + - name: Create or update a certificate + text: |- + az automation certificate create --automation-account-name "myAutomationAccount18" --certificate-name "t\ +estCert" --name "testCert" --description "Sample Cert" --base64value "base 64 value of cert" --is-exportable false --th\ +umbprint "thumbprint of cert" --resource-group "rg" +""" + +helps['automation certificate update'] = """ + type: command + short-summary: Update a certificate. + examples: + - name: Update a certificate + text: |- + az automation certificate update --automation-account-name "myAutomationAccount33" --certificate-name "t\ +estCert" --name "testCert" --description "sample certificate. Description updated" --resource-group "rg" +""" + +helps['automation certificate delete'] = """ + type: command + short-summary: Delete the certificate. + examples: + - name: Delete a certificate + text: |- + az automation certificate delete --automation-account-name "myAutomationAccount33" --certificate-name "t\ +estCert" --resource-group "rg" +""" + +helps['automation connection'] = """ + type: group + short-summary: automation connection +""" + +helps['automation connection list'] = """ + type: command + short-summary: Retrieve a list of connections. + examples: + - name: List connections by automation account, first 100 + text: |- + az automation connection list --automation-account-name "myAutomationAccount28" --resource-group "rg" + - name: List connections by automation account, next 100 + text: |- + az automation connection list --automation-account-name "myAutomationAccount28" --resource-group "rg" +""" + +helps['automation connection show'] = """ + type: command + short-summary: Retrieve the connection identified by connection name. + examples: + - name: Get a connection + text: |- + az automation connection show --automation-account-name "myAutomationAccount28" --connection-name "myCon\ +nection" --resource-group "rg" +""" + +helps['automation connection create'] = """ + type: command + short-summary: Create or update a connection. + examples: + - name: Create or update connection + text: |- + az automation connection create --automation-account-name "myAutomationAccount28" --connection-name "mys\ +Connection" --name "mysConnection" --description "my description goes here" --connection-type name="Azure" --field-defi\ +nition-values AutomationCertificateName="mysCertificateName" SubscriptionID="subid" --resource-group "rg" +""" + +helps['automation connection update'] = """ + type: command + short-summary: Update a connection. + examples: + - name: Update a connection + text: |- + az automation connection update --automation-account-name "myAutomationAccount28" --connection-name "myC\ +onnection" --name "myConnection" --description "my description goes here" --field-definition-values AutomationCertifica\ +teName="myCertificateName" SubscriptionID="b5e4748c-f69a-467c-8749-e2f9c8cd3009" --resource-group "rg" +""" + +helps['automation connection delete'] = """ + type: command + short-summary: Delete the connection. + examples: + - name: Delete an existing connection + text: |- + az automation connection delete --automation-account-name "myAutomationAccount28" --connection-name "myC\ +onnection" --resource-group "rg" +""" + +helps['automation connection-type'] = """ + type: group + short-summary: automation connection-type +""" + +helps['automation connection-type list'] = """ + type: command + short-summary: Retrieve a list of connection types. + examples: + - name: Get connection types, first 100 + text: |- + az automation connection-type list --automation-account-name "myAutomationAccount25" --resource-group "r\ +g" + - name: Get connection types, next 100 + text: |- + az automation connection-type list --automation-account-name "myAutomationAccount25" --resource-group "r\ +g" +""" + +helps['automation connection-type show'] = """ + type: command + short-summary: Retrieve the connection type identified by connection type name. + examples: + - name: Get connection type + text: |- + az automation connection-type show --automation-account-name "myAutomationAccount22" --connection-type-n\ +ame "myCT" --resource-group "rg" +""" + +helps['automation connection-type create'] = """ + type: command + short-summary: Create a connection type. + examples: + - name: Create or update connection type + text: |- + az automation connection-type create --automation-account-name "myAutomationAccount22" --connection-type\ +-name "myCT" --name "myCT" --field-definitions "{\\"myBoolField\\":{\\"type\\":\\"bool\\",\\"isEncrypted\\":false,\\"is\ +Optional\\":false},\\"myStringField\\":{\\"type\\":\\"string\\",\\"isEncrypted\\":false,\\"isOptional\\":false},\\"mySt\ +ringFieldEncrypted\\":{\\"type\\":\\"string\\",\\"isEncrypted\\":true,\\"isOptional\\":false}}" --is-global false --res\ +ource-group "rg" +""" + +helps['automation connection-type update'] = """ + type: command + short-summary: Create a connection type. + examples: + - name: Create or update connection type + text: |- + az automation connection-type update --automation-account-name "myAutomationAccount22" --connection-type\ +-name "myCT" --name "myCT" --field-definitions "{\\"myBoolField\\":{\\"type\\":\\"bool\\",\\"isEncrypted\\":false,\\"is\ +Optional\\":false},\\"myStringField\\":{\\"type\\":\\"string\\",\\"isEncrypted\\":false,\\"isOptional\\":false},\\"mySt\ +ringFieldEncrypted\\":{\\"type\\":\\"string\\",\\"isEncrypted\\":true,\\"isOptional\\":false}}" --is-global false --res\ +ource-group "rg" +""" + +helps['automation connection-type delete'] = """ + type: command + short-summary: Delete the connection type. + examples: + - name: Delete an existing connection type + text: |- + az automation connection-type delete --automation-account-name "myAutomationAccount22" --connection-type\ +-name "myCT" --resource-group "rg" +""" + +helps['automation credential'] = """ + type: group + short-summary: automation credential +""" + +helps['automation credential list'] = """ + type: command + short-summary: Retrieve a list of credentials. + examples: + - name: List credentials by automation account, first 100 + text: |- + az automation credential list --automation-account-name "myAutomationAccount20" --resource-group "rg" + - name: List credentials by automation account, next 100 + text: |- + az automation credential list --automation-account-name "myAutomationAccount20" --resource-group "rg" +""" + +helps['automation credential show'] = """ + type: command + short-summary: Retrieve the credential identified by credential name. + examples: + - name: Get a credential + text: |- + az automation credential show --automation-account-name "myAutomationAccount18" --credential-name "myCre\ +dential" --resource-group "rg" +""" + +helps['automation credential create'] = """ + type: command + short-summary: Create a credential. + examples: + - name: Create a credential + text: |- + az automation credential create --automation-account-name "myAutomationAccount18" --credential-name "myC\ +redential" --name "myCredential" --description "my description goes here" --password "myPassw0rd" --user-name "mylingai\ +ah" --resource-group "rg" +""" + +helps['automation credential update'] = """ + type: command + short-summary: Update a credential. + examples: + - name: Update a credential + text: |- + az automation credential update --automation-account-name "myAutomationAccount18" --credential-name "myC\ +redential" --name "myCredential" --description "my description goes here" --password "myPassw0rd3" --user-name "mylinga\ +iah" --resource-group "rg" +""" + +helps['automation credential delete'] = """ + type: command + short-summary: Delete the credential. + examples: + - name: Delete a credential + text: |- + az automation credential delete --automation-account-name "myAutomationAccount20" --credential-name "myC\ +redential" --resource-group "rg" +""" + +helps['automation dsc-configuration'] = """ + type: group + short-summary: automation dsc-configuration +""" + +helps['automation dsc-configuration list'] = """ + type: command + short-summary: Retrieve a list of configurations. + examples: + - name: Get DSC Configuration + text: |- + az automation dsc-configuration list --automation-account-name "myAutomationAccount33" --resource-group \ +"rg" + - name: List Paged DSC Configurations with name filter + text: |- + az automation dsc-configuration list --filter "contains(name,\'server\')" --inlinecount "allpages" --ski\ +p 0 --top 2 --automation-account-name "myAutomationAccount33" --resource-group "rg" + - name: List Paged DSC Configurations with no filter + text: |- + az automation dsc-configuration list --inlinecount "allpages" --skip 0 --top 3 --automation-account-name\ + "myAutomationAccount33" --resource-group "rg" +""" + +helps['automation dsc-configuration show'] = """ + type: command + short-summary: Retrieve the configuration script identified by configuration name. + examples: + - name: Get a DSC Configuration + text: |- + az automation dsc-configuration show --automation-account-name "myAutomationAccount33" --configuration-n\ +ame "TemplateBasic" --resource-group "rg" +""" + +helps['automation dsc-configuration create'] = """ + type: command + short-summary: Create the configuration identified by configuration name. + examples: + - name: Create or Update Configuration + text: |- + az automation dsc-configuration create --automation-account-name "myAutomationAccount18" --configuration\ +-name "SetupServer" --parameters "{\\"name\\":\\"SetupServer\\",\\"location\\":\\"East US 2\\",\\"properties\\":{\\"des\ +cription\\":\\"sample configuration\\",\\"source\\":{\\"type\\":\\"embeddedContent\\",\\"hash\\":{\\"algorithm\\":\\"sh\ +a256\\",\\"value\\":\\"A9E5DB56BA21513F61E0B3868816FDC6D4DF5131F5617D7FF0D769674BD5072F\\"},\\"value\\":\\"Configuratio\ +n SetupServer {\\\\r\\\\n Node localhost {\\\\r\\\\n WindowsFeature IIS {\\\\r\\\\n \ + Name = \\\\\\"Web-Server\\\\\\";\\\\r\\\\n Ensure = \\\\\\"Present\\\\\\"\\\\r\\\ +\\n }\\\\r\\\\n }\\\\r\\\\n}\\"}}}" --resource-group "rg" +""" + +helps['automation dsc-configuration update'] = """ + type: command + short-summary: Create the configuration identified by configuration name. + examples: + - name: Create or Update Configuration + text: |- + az automation dsc-configuration update --automation-account-name "myAutomationAccount18" --configuration\ +-name "SetupServer" --parameters "{\\"name\\":\\"SetupServer\\",\\"tags\\":{\\"Hello\\":\\"World\\"}}" --resource-group\ + "rg" +""" + +helps['automation dsc-configuration delete'] = """ + type: command + short-summary: Delete the dsc configuration identified by configuration name. + examples: + - name: Delete DSC Configuration + text: |- + az automation dsc-configuration delete --automation-account-name "myAutomationAccount33" --configuration\ +-name "TemplateBasic" --resource-group "rg" +""" + +helps['automation hybrid-runbook-worker-group'] = """ + type: group + short-summary: automation hybrid-runbook-worker-group +""" + +helps['automation hybrid-runbook-worker-group list'] = """ + type: command + short-summary: Retrieve a list of hybrid runbook worker groups. + examples: + - name: List hybrid worker groups by Automation Account + text: |- + az automation hybrid-runbook-worker-group list --automation-account-name "testaccount" --resource-group \ +"udtest" +""" + +helps['automation hybrid-runbook-worker-group show'] = """ + type: command + short-summary: Retrieve a hybrid runbook worker group. + examples: + - name: Get a hybrid worker group + text: |- + az automation hybrid-runbook-worker-group show --automation-account-name "testaccount" --hybrid-runbook-\ +worker-group-name "TestHybridGroup" --resource-group "rg" +""" + +helps['automation hybrid-runbook-worker-group update'] = """ + type: command + short-summary: Update a hybrid runbook worker group. + examples: + - name: Update hybrid worker group + text: |- + az automation hybrid-runbook-worker-group update --automation-account-name "testaccount" --hybrid-runboo\ +k-worker-group-name "TestHybridGroup" --credential name="myRunAsCredentialName" --resource-group "rg" +""" + +helps['automation hybrid-runbook-worker-group delete'] = """ + type: command + short-summary: Delete a hybrid runbook worker group. + examples: + - name: Delete a hybrid worker group + text: |- + az automation hybrid-runbook-worker-group delete --automation-account-name "myAutomationAccount20" --hyb\ +rid-runbook-worker-group-name "myGroup" --resource-group "rg" +""" + +helps['automation job-schedule'] = """ + type: group + short-summary: automation job-schedule +""" + +helps['automation job-schedule list'] = """ + type: command + short-summary: Retrieve a list of job schedules. + examples: + - name: List all job schedules by automation account + text: |- + az automation job-schedule list --automation-account-name "ContoseAutomationAccount" --resource-group "r\ +g" +""" + +helps['automation job-schedule show'] = """ + type: command + short-summary: Retrieve the job schedule identified by job schedule name. + examples: + - name: Get a job schedule + text: |- + az automation job-schedule show --automation-account-name "ContoseAutomationAccount" --job-schedule-id "\ +0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc" --resource-group "rg" +""" + +helps['automation job-schedule create'] = """ + type: command + short-summary: Create a job schedule. + examples: + - name: Create a job schedule + text: |- + az automation job-schedule create --automation-account-name "ContoseAutomationAccount" --job-schedule-id\ + "0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc" --parameters properties={"parameters":{"jobscheduletag01":"jobschedulevalue01",\ +"jobscheduletag02":"jobschedulevalue02"},"runbook":{"name":"TestRunbook"},"schedule":{"name":"ScheduleNameGoesHere33220\ +4b5-debe-4348-a5c7-6357457189f2"}} --resource-group "rg" +""" + +helps['automation job-schedule delete'] = """ + type: command + short-summary: Delete the job schedule identified by job schedule name. + examples: + - name: Delete a job schedule + text: |- + az automation job-schedule delete --automation-account-name "ContoseAutomationAccount" --job-schedule-id\ + "0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc" --resource-group "rg" +""" + +helps['automation linked-workspace'] = """ + type: group + short-summary: automation linked-workspace +""" + +helps['automation linked-workspace show'] = """ + type: command + short-summary: Retrieve the linked workspace for the account id. + examples: + - name: Get the linked workspace of an automation account + text: |- + az automation linked-workspace show --automation-account-name "ContosoAutomationAccount" --resource-grou\ +p "rg" +""" + +helps['automation activity'] = """ + type: group + short-summary: automation activity +""" + +helps['automation activity list'] = """ + type: command + short-summary: Retrieve a list of activities in the module identified by module name. + examples: + - name: List activities by a module + text: |- + az automation activity list --automation-account-name "myAutomationAccount33" --module-name "OmsComposit\ +eResources" --resource-group "rg" +""" + +helps['automation activity show'] = """ + type: command + short-summary: Retrieve the activity in the module identified by module name and activity name. + examples: + - name: Get Activity in a module + text: |- + az automation activity show --activity-name "Add-AzureRmAccount" --automation-account-name "myAutomation\ +Account33" --module-name "OmsCompositeResources" --resource-group "rg" +""" + +helps['automation module'] = """ + type: group + short-summary: automation module +""" + +helps['automation module list'] = """ + type: command + short-summary: Retrieve a list of modules. + examples: + - name: List modules by automation account + text: |- + az automation module list --automation-account-name "myAutomationAccount33" --resource-group "rg" +""" + +helps['automation module show'] = """ + type: command + short-summary: Retrieve the module identified by module name. + examples: + - name: Get a module + text: |- + az automation module show --automation-account-name "myAutomationAccount33" --module-name "OmsCompositeR\ +esources" --resource-group "rg" +""" + +helps['automation module create'] = """ + type: command + short-summary: Create or Update the module identified by module name. + examples: + - name: Create or update a module + text: |- + az automation module create --automation-account-name "myAutomationAccount33" --module-name "OmsComposit\ +eResources" --content-link "{\\"contentHash\\":{\\"algorithm\\":\\"sha265\\",\\"value\\":\\"07E108A962B81DD9C9BAA89BB47\ +C0F6EE52B29E83758B07795E408D258B2B87A\\"},\\"uri\\":\\"https://teststorage.blob.core.windows.net/dsccomposite/OmsCompos\ +iteResources.zip\\",\\"version\\":\\"1.0.0.0\\"}" --resource-group "rg" +""" + +helps['automation module update'] = """ + type: command + short-summary: Update the module identified by module name. + examples: + - name: Update a module + text: |- + az automation module update --automation-account-name "MyAutomationAccount" --module-name "MyModule" --c\ +ontent-link "{\\"contentHash\\":{\\"algorithm\\":\\"sha265\\",\\"value\\":\\"07E108A962B81DD9C9BAA89BB47C0F6EE52B29E837\ +58B07795E408D258B2B87A\\"},\\"uri\\":\\"https://teststorage.blob.core.windows.net/mycontainer/MyModule.zip\\",\\"versio\ +n\\":\\"1.0.0.0\\"}" --resource-group "rg" +""" + +helps['automation module delete'] = """ + type: command + short-summary: Delete the module by name. + examples: + - name: Delete a module + text: |- + az automation module delete --automation-account-name "myAutomationAccount33" --module-name "OmsComposit\ +eResources" --resource-group "rg" +""" + +helps['automation object-data-type'] = """ + type: group + short-summary: automation object-data-type +""" + +helps['automation object-data-type list-field'] = """ + type: command + short-summary: Retrieve a list of fields of a given type across all accessible modules. + examples: + - name: Get a list of fields of a given type + text: |- + az automation object-data-type list-field --automation-account-name "MyAutomationAccount" --module-name \ +"MyModule" --resource-group "rg" --type-name "MyCustomType" +""" + +helps['automation field'] = """ + type: group + short-summary: automation field +""" + +helps['automation field list'] = """ + type: command + short-summary: Retrieve a list of fields of a given type identified by module name. + examples: + - name: Get a list of fields of a given type + text: |- + az automation field list --automation-account-name "MyAutomationAccount" --module-name "MyModule" --reso\ +urce-group "rg" --type-name "MyCustomType" +""" + +helps['automation schedule'] = """ + type: group + short-summary: automation schedule +""" + +helps['automation schedule list'] = """ + type: command + short-summary: Retrieve a list of schedules. + examples: + - name: List schedules by automation account, first 100 + text: |- + az automation schedule list --automation-account-name "myAutomationAccount33" --resource-group "rg" + - name: List schedules by automation account, next 100 + text: |- + az automation schedule list --automation-account-name "myAutomationAccount33" --resource-group "rg" +""" + +helps['automation schedule show'] = """ + type: command + short-summary: Retrieve the schedule identified by schedule name. + examples: + - name: Get a schedule + text: |- + az automation schedule show --automation-account-name "myAutomationAccount33" --resource-group "rg" --sc\ +hedule-name "mySchedule" +""" + +helps['automation schedule create'] = """ + type: command + short-summary: Create a schedule. + examples: + - name: Create or update a schedule + text: |- + az automation schedule create --automation-account-name "myAutomationAccount33" --name "mySchedule" --de\ +scription "my description of schedule goes here" --expiry-time "2017-04-01T17:28:57.2494819Z" --frequency "Hour" --inte\ +rval "1" --start-time "2017-03-27T17:28:57.2494819Z" --resource-group "rg" --schedule-name "mySchedule" +""" + +helps['automation schedule update'] = """ + type: command + short-summary: Update the schedule identified by schedule name. + examples: + - name: Update a schedule + text: |- + az automation schedule update --automation-account-name "myAutomationAccount33" --name "mySchedule" --de\ +scription "my updated description of schedule goes here" --is-enabled false --resource-group "rg" --schedule-name "mySc\ +hedule" +""" + +helps['automation schedule delete'] = """ + type: command + short-summary: Delete the schedule identified by schedule name. + examples: + - name: Delete schedule + text: |- + az automation schedule delete --automation-account-name "myAutomationAccount33" --resource-group "rg" --\ +schedule-name "mySchedule" +""" + +helps['automation variable'] = """ + type: group + short-summary: automation variable +""" + +helps['automation variable list'] = """ + type: command + short-summary: Retrieve a list of variables. + examples: + - name: List variables, First 100 + text: |- + az automation variable list --automation-account-name "sampleAccount9" --resource-group "rg" + - name: List variables, Next 100 + text: |- + az automation variable list --automation-account-name "sampleAccount9" --resource-group "rg" +""" + +helps['automation variable show'] = """ + type: command + short-summary: Retrieve the variable identified by variable name. + examples: + - name: Get a variable + text: |- + az automation variable show --automation-account-name "sampleAccount9" --resource-group "rg" --variable-\ +name "sampleVariable" +""" + +helps['automation variable create'] = """ + type: command + short-summary: Create a variable. + examples: + - name: Create or update a variable + text: |- + az automation variable create --automation-account-name "sampleAccount9" --name "sampleVariable" --descr\ +iption "my description" --is-encrypted false --value "\\"ComputerName.domain.com\\"" --resource-group "rg" --variable-n\ +ame "sampleVariable" +""" + +helps['automation variable update'] = """ + type: command + short-summary: Update a variable. + examples: + - name: Update a variable + text: |- + az automation variable update --automation-account-name "sampleAccount9" --name "sampleVariable" --value\ + "\\"ComputerName3.domain.com\\"" --resource-group "rg" --variable-name "sampleVariable" +""" + +helps['automation variable delete'] = """ + type: command + short-summary: Delete the variable. + examples: + - name: Delete a variable + text: |- + az automation variable delete --automation-account-name "sampleAccount9" --resource-group "rg" --variabl\ +e-name "sampleVariable" +""" + +helps['automation webhook'] = """ + type: group + short-summary: automation webhook +""" + +helps['automation webhook list'] = """ + type: command + short-summary: Retrieve a list of webhooks. + examples: + - name: List webhooks by Automation Account + text: |- + az automation webhook list --automation-account-name "myAutomationAccount33" --resource-group "rg" +""" + +helps['automation webhook show'] = """ + type: command + short-summary: Retrieve the webhook identified by webhook name. + examples: + - name: Get webhook + text: |- + az automation webhook show --automation-account-name "myAutomationAccount33" --resource-group "rg" --web\ +hook-name "TestWebhook" +""" + +helps['automation webhook create'] = """ + type: command + short-summary: Create the webhook identified by webhook name. + examples: + - name: Create or update webhook + text: |- + az automation webhook create --automation-account-name "myAutomationAccount33" --parameters name="TestWe\ +bhook" properties={"expiryTime":"2018-03-29T22:18:13.7002872Z","isEnabled":true,"runbook":{"name":"TestRunbook"},"uri":\ +"https://s1events.azure-automation.net/webhooks?token=7u3KfQvM1vUPWaDMFRv2%2fAA4Jqx8QwS8aBuyO6Xsdcw%3d"} --resource-gro\ +up "rg" --webhook-name "TestWebhook" +""" + +helps['automation webhook update'] = """ + type: command + short-summary: Update the webhook identified by webhook name. + examples: + - name: Update webhook + text: |- + az automation webhook update --automation-account-name "myAutomationAccount33" --parameters name="TestWe\ +bhook" properties={"description":"updated webhook","isEnabled":false} --resource-group "rg" --webhook-name "TestWebhook\ +" +""" + +helps['automation webhook delete'] = """ + type: command + short-summary: Delete the webhook by name. + examples: + - name: Delete webhook + text: |- + az automation webhook delete --automation-account-name "myAutomationAccount33" --resource-group "rg" --w\ +ebhook-name "TestWebhook" +""" + +helps['automation webhook generate-uri'] = """ + type: command + short-summary: Generates a Uri for use in creating a webhook. + examples: + - name: Generate webhook uri + text: |- + az automation webhook generate-uri --automation-account-name "myAutomationAccount33" --resource-group "r\ +g" +""" + +helps['automation watcher'] = """ + type: group + short-summary: automation watcher +""" + +helps['automation watcher list'] = """ + type: command + short-summary: Retrieve a list of watchers. + examples: + - name: List watchers by Automation Account + text: |- + az automation watcher list --automation-account-name "MyTestAutomationAccount" --resource-group "rg" +""" + +helps['automation watcher show'] = """ + type: command + short-summary: Retrieve the watcher identified by watcher name. + examples: + - name: Get watcher + text: |- + az automation watcher show --automation-account-name "MyTestAutomationAccount" --resource-group "rg" --w\ +atcher-name "MyTestWatcher" +""" + +helps['automation watcher create'] = """ + type: command + short-summary: Create the watcher identified by watcher name. + examples: + - name: Create or update watcher + text: |- + az automation watcher create --automation-account-name "MyTestAutomationAccount" --description "This is \ +a test watcher." --execution-frequency-in-seconds 60 --script-name "MyTestWatcherRunbook" --script-run-on "MyTestHybrid\ +WorkerGroup" --resource-group "rg" --watcher-name "MyTestWatcher" +""" + +helps['automation watcher update'] = """ + type: command + short-summary: Update the watcher identified by watcher name. + examples: + - name: Update watcher + text: |- + az automation watcher update --automation-account-name "MyTestAutomationAccount" --name "MyTestWatcher" \ +--execution-frequency-in-seconds 600 --resource-group "rg" --watcher-name "MyTestWatcher" +""" + +helps['automation watcher delete'] = """ + type: command + short-summary: Delete the watcher by name. + examples: + - name: Delete watcher + text: |- + az automation watcher delete --automation-account-name "MyTestAutomationAccount" --resource-group "rg" -\ +-watcher-name "MyTestWatcher" +""" + +helps['automation watcher start'] = """ + type: command + short-summary: Resume the watcher identified by watcher name. + examples: + - name: Start Watcher + text: |- + az automation watcher start --automation-account-name "MyTestAutomationAccount" --resource-group "rg" --\ +watcher-name "MyTestWatcher" +""" + +helps['automation watcher stop'] = """ + type: command + short-summary: Resume the watcher identified by watcher name. + examples: + - name: Start Watcher + text: |- + az automation watcher stop --automation-account-name "MyTestAutomationAccount" --resource-group "rg" --w\ +atcher-name "MyTestWatcher" +""" + +helps['automation software-update-configuration'] = """ + type: group + short-summary: automation software-update-configuration +""" + +helps['automation software-update-configuration list'] = """ + type: command + short-summary: Get all software update configurations for the account. + examples: + - name: List software update configurations + text: |- + az automation software-update-configuration list --automation-account-name "myaccount" --resource-group \ +"mygroup" + - name: List software update configurations Targeting a specific azure virtual machine + text: |- + az automation software-update-configuration list --filter "properties/updateConfiguration/azureVirtualMa\ +chines/any(m: m eq \'/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft\ +.Compute/virtualMachines/vm-01\')" --automation-account-name "myaccount" --resource-group "mygroup" +""" + +helps['automation software-update-configuration show'] = """ + type: command + short-summary: Get a single software update configuration by name. + examples: + - name: Get software update configuration by name + text: |- + az automation software-update-configuration show --automation-account-name "myaccount" --resource-group \ +"mygroup" --software-update-configuration-name "mypatch" +""" + +helps['automation software-update-configuration create'] = """ + type: command + short-summary: Create a new software update configuration with the name given in the URI. + examples: + - name: Create software update configuration + text: |- + az automation software-update-configuration create --automation-account-name "myaccount" --tasks-pre-tas\ +k-parameters properties={"scheduleInfo":{"advancedSchedule":{"weekDays":["Monday","Thursday"]},"expiryTime":"2018-11-09\ +T11:22:57+00:00","frequency":"Hour","interval":1,"startTime":"2017-10-19T12:22:57+00:00","timeZone":"America/Los_Angele\ +s"},"tasks":{"postTask":{"parameters":null,"source":"GetCache"},"preTask":{"parameters":{"COMPUTERNAME":"Computer1"},"s\ +ource":"HelloWorld"}},"updateConfiguration":{"azureVirtualMachines":["/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e00\ +67/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01","/subscriptions/5ae68d89-69a4-454f-b5c\ +e-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02","/subscriptions/5ae68d89-6\ +9a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-03"],"duration":"P\ +T2H0M","nonAzureComputerNames":["box1.contoso.com","box2.contoso.com"],"operatingSystem":"Windows","targets":{"azureQue\ +ries":[{"locations":["Japan East","UK South"],"scope":["/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGro\ +ups/myresources","/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067"],"tagSettings":{"filterOperator":"All","tags":[{\ +"tag1":["tag1Value1","tag1Value2","tag1Value3"]},{"tag2":["tag2Value1","tag2Value2","tag2Value3"]}]}}],"nonAzureQueries\ +":[{"functionAlias":"SavedSearch1","workspaceId":"WorkspaceId1"},{"functionAlias":"SavedSearch2","workspaceId":"Workspa\ +ceId2"}]},"windows":{"excludedKbNumbers":["168934","168973"],"includedUpdateClassifications":"Critical","rebootSetting"\ +:"IfRequired"}}} --resource-group "mygroup" --software-update-configuration-name "testpatch" +""" + +helps['automation software-update-configuration delete'] = """ + type: command + short-summary: delete a specific software update configuration. + examples: + - name: Delete software update configuration + text: |- + az automation software-update-configuration delete --automation-account-name "myaccount" --resource-grou\ +p "mygroup" --software-update-configuration-name "mypatch" +""" + +helps['automation software-update-configuration-run'] = """ + type: group + short-summary: automation software-update-configuration-run +""" + +helps['automation software-update-configuration-run list'] = """ + type: command + short-summary: Return list of software update configuration runs + examples: + - name: List software update configuration machine run with status equal to 'Failed' + text: |- + az automation software-update-configuration-run list --filter "properties/status%20eq%20\'Failed\'" --au\ +tomation-account-name "myaccount" --resource-group "mygroup" + - name: List software update configuration machine runs + text: |- + az automation software-update-configuration-run list --automation-account-name "myaccount" --resource-gr\ +oup "mygroup" +""" + +helps['automation software-update-configuration-run show'] = """ + type: command + short-summary: Get a single software update configuration Run by Id. + examples: + - name: Get software update configuration runs by Id + text: |- + az automation software-update-configuration-run show --automation-account-name "myaccount" --resource-gr\ +oup "mygroup" --software-update-configuration-run-id "2bd77cfa-2e9c-41b4-a45b-684a77cfeca9" +""" + +helps['automation software-update-configuration-machine-run'] = """ + type: group + short-summary: automation software-update-configuration-machine-run +""" + +helps['automation software-update-configuration-machine-run list'] = """ + type: command + short-summary: Return list of software update configuration machine runs + examples: + - name: List software update configuration machine runs + text: |- + az automation software-update-configuration-machine-run list --automation-account-name "myaccount" --res\ +ource-group "mygroup" + - name: List software update configuration machine runs for a specific software update configuration run + text: |- + az automation software-update-configuration-machine-run list --filter "$filter=properties/correlationId%\ +20eq%200b943e57-44d3-4f05-898c-6e92aa617e59" --automation-account-name "myaccount" --resource-group "mygroup" +""" + +helps['automation software-update-configuration-machine-run show'] = """ + type: command + short-summary: Get a single software update configuration machine run by Id. + examples: + - name: Get software update configuration machine run + text: |- + az automation software-update-configuration-machine-run show --automation-account-name "myaccount" --res\ +ource-group "mygroup" --software-update-configuration-machine-run-id "ca440719-34a4-4234-a1a9-3f84faf7788f" +""" + +helps['automation source-control'] = """ + type: group + short-summary: automation source-control +""" + +helps['automation source-control list'] = """ + type: command + short-summary: Retrieve a list of source controls. + examples: + - name: List sourceControls + text: |- + az automation source-control list --automation-account-name "sampleAccount9" --resource-group "rg" +""" + +helps['automation source-control show'] = """ + type: command + short-summary: Retrieve the source control identified by source control name. + examples: + - name: Get a source control + text: |- + az automation source-control show --automation-account-name "sampleAccount9" --resource-group "rg" --sou\ +rce-control-name "sampleSourceControl" +""" + +helps['automation source-control create'] = """ + type: command + short-summary: Create a source control. + examples: + - name: Create or update a source control + text: |- + az automation source-control create --automation-account-name "sampleAccount9" --description "my descrip\ +tion" --auto-sync true --branch "master" --folder-path "/folderOne/folderTwo" --publish-runbook true --repo-url "https:\ +//sampleUser.visualstudio.com/myProject/_git/myRepository" --security-token access-token="3a326f7a0dcd343ea58fee21f2fd5\ +fb4c1234567" token-type="PersonalAccessToken" --source-type "VsoGit" --resource-group "rg" --source-control-name "sampl\ +eSourceControl" +""" + +helps['automation source-control update'] = """ + type: command + short-summary: Update a source control. + examples: + - name: Update a source control + text: |- + az automation source-control update --automation-account-name "sampleAccount9" --description "my descrip\ +tion" --auto-sync true --branch "master" --folder-path "/folderOne/folderTwo" --publish-runbook true --security-token a\ +ccess-token="3a326f7a0dcd343ea58fee21f2fd5fb4c1234567" token-type="PersonalAccessToken" --resource-group "rg" --source-\ +control-name "sampleSourceControl" +""" + +helps['automation source-control delete'] = """ + type: command + short-summary: Delete the source control. + examples: + - name: Delete a source control + text: |- + az automation source-control delete --automation-account-name "sampleAccount9" --resource-group "rg" --s\ +ource-control-name "sampleSourceControl" +""" + +helps['automation source-control-sync-job'] = """ + type: group + short-summary: automation source-control-sync-job +""" + +helps['automation source-control-sync-job list'] = """ + type: command + short-summary: Retrieve a list of source control sync jobs. + examples: + - name: Get a list of source control sync jobs + text: |- + az automation source-control-sync-job list --automation-account-name "myAutomationAccount33" --resource-\ +group "rg" --source-control-name "MySourceControl" +""" + +helps['automation source-control-sync-job show'] = """ + type: command + short-summary: Retrieve the source control sync job identified by job id. + examples: + - name: Get a source control sync job by job id + text: |- + az automation source-control-sync-job show --automation-account-name "myAutomationAccount33" --resource-\ +group "rg" --source-control-name "MySourceControl" --source-control-sync-job-id "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a" +""" + +helps['automation source-control-sync-job create'] = """ + type: command + short-summary: Creates the sync job for a source control. + examples: + - name: Create or update a source control sync job + text: |- + az automation source-control-sync-job create --automation-account-name "myAutomationAccount33" --commit-\ +id "9de0980bfb45026a3d97a1b0522d98a9f604226e" --resource-group "rg" --source-control-name "MySourceControl" --source-co\ +ntrol-sync-job-id "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a" +""" + +helps['automation source-control-sync-job-stream'] = """ + type: group + short-summary: automation source-control-sync-job-stream +""" + +helps['automation source-control-sync-job-stream list'] = """ + type: command + short-summary: Retrieve a list of sync job streams identified by sync job id. + examples: + - name: Get a list of sync job streams identified by sync job id + text: |- + az automation source-control-sync-job-stream list --automation-account-name "myAutomationAccount33" --re\ +source-group "rg" --source-control-name "MySourceControl" --source-control-sync-job-id "ce6fe3e3-9db3-4096-a6b4-82bfb4c\ +10a2b" +""" + +helps['automation source-control-sync-job-stream show'] = """ + type: command + short-summary: Retrieve a sync job stream identified by stream id. + examples: + - name: Get a sync job stream identified by sync job stream id. + text: |- + az automation source-control-sync-job-stream show --automation-account-name "myAutomationAccount33" --re\ +source-group "rg" --source-control-name "MySourceControl" --source-control-sync-job-id "ce6fe3e3-9db3-4096-a6b4-82bfb4c\ +10a2b" --stream-id "b86c5c31-e9fd-4734-8764-ddd6c101e706_00636596855139029522_00000000000000000007" +""" + +helps['automation job'] = """ + type: group + short-summary: automation job +""" + +helps['automation job list'] = """ + type: command + short-summary: Retrieve a list of jobs. + examples: + - name: List jobs by automation account + text: |- + az automation job list --automation-account-name "ContoseAutomationAccount" --resource-group "mygroup" +""" + +helps['automation job show'] = """ + type: command + short-summary: Retrieve the job identified by job name. + examples: + - name: Get Job Output + text: |- + az automation job show --automation-account-name "ContoseAutomationAccount" --job-name "foo" --resource-\ +group "mygroup" +""" + +helps['automation job create'] = """ + type: command + short-summary: Create a job of the runbook. + examples: + - name: Create job + text: |- + az automation job create --automation-account-name "ContoseAutomationAccount" --job-name "foo" --paramet\ +ers properties={"parameters":{"key01":"value01","key02":"value02"},"runOn":"","runbook":{"name":"TestRunbook"}} --resou\ +rce-group "mygroup" +""" + +helps['automation job resume'] = """ + type: command + short-summary: Resume the job identified by jobName. + examples: + - name: Resume job + text: |- + az automation job resume --automation-account-name "ContoseAutomationAccount" --job-name "foo" --resourc\ +e-group "mygroup" +""" + +helps['automation job stop'] = """ + type: command + short-summary: Stop the job identified by jobName. + examples: + - name: Stop job + text: |- + az automation job stop --automation-account-name "ContoseAutomationAccount" --job-name "foo" --resource-\ +group "mygroup" +""" + +helps['automation job suspend'] = """ + type: command + short-summary: Suspend the job identified by job name. + examples: + - name: Suspend job + text: |- + az automation job suspend --automation-account-name "ContoseAutomationAccount" --job-name "foo" --resour\ +ce-group "mygroup" +""" + +helps['automation job-stream'] = """ + type: group + short-summary: automation job-stream +""" + +helps['automation job-stream list'] = """ + type: command + short-summary: Retrieve a list of jobs streams identified by job name. + examples: + - name: List job streams by job name + text: |- + az automation job-stream list --automation-account-name "ContoseAutomationAccount" --job-name "foo" --re\ +source-group "mygroup" +""" + +helps['automation job-stream show'] = """ + type: command + short-summary: Retrieve the job stream identified by job stream id. + examples: + - name: Get job stream + text: |- + az automation job-stream show --automation-account-name "ContoseAutomationAccount" --job-name "foo" --jo\ +b-stream-id "851b2101-686f-40e2-8a4b-5b8df08afbd1_00636535684910693884_00000000000000000001" --resource-group "mygroup" +""" + +helps['automation agent-registration-information'] = """ + type: group + short-summary: automation agent-registration-information +""" + +helps['automation agent-registration-information show'] = """ + type: command + short-summary: Retrieve the automation agent registration information. + examples: + - name: Get the agent registration information + text: |- + az automation agent-registration-information show --automation-account-name "myAutomationAccount18" --re\ +source-group "rg" +""" + +helps['automation agent-registration-information regenerate-key'] = """ + type: command + short-summary: Regenerate a primary or secondary agent registration key + examples: + - name: Regenerate registration key + text: |- + az automation agent-registration-information regenerate-key --automation-account-name "myAutomationAccou\ +nt18" --key-name "primary" --resource-group "rg" +""" + +helps['automation dsc-node'] = """ + type: group + short-summary: automation dsc-node +""" + +helps['automation dsc-node list'] = """ + type: command + short-summary: Retrieve a list of dsc nodes. + examples: + - name: List DSC nodes by Automation Account + text: |- + az automation dsc-node list --automation-account-name "myAutomationAccount33" --resource-group "rg" + - name: List Paged DSC nodes by Automation Account where Node Configurations are not assigned filter + text: |- + az automation dsc-node list --filter "properties/nodeConfiguration/name eq \'\'" --inlinecount "allpages\ +" --skip 0 --top 20 --automation-account-name "myAutomationAccount33" --resource-group "rg" + - name: List Paged DSC nodes by Automation Account with Node Configuration Custom filter + text: |- + az automation dsc-node list --filter "contains(properties/nodeConfiguration/name,\'SetupServer.localhost\ +,SetupClient.localhost,$$Not$$Configured$$\')" --inlinecount "allpages" --skip 0 --top 4 --automation-account-name "myA\ +utomationAccount33" --resource-group "rg" + - name: List Paged DSC nodes by Automation Account with name filter + text: |- + az automation dsc-node list --filter "contains(\'DSCCOMP\',name)" --inlinecount "allpages" --skip 0 --to\ +p 6 --automation-account-name "myAutomationAccount33" --resource-group "rg" + - name: List Paged DSC nodes by Automation Account with no filters + text: |- + az automation dsc-node list --inlinecount "allpages" --skip 0 --top 2 --automation-account-name "myAutom\ +ationAccount33" --resource-group "rg" + - name: List Paged DSC nodes by Automation Account with node status filter + text: |- + az automation dsc-node list --filter "contains(properties/status,\'Compliant,NotCompliant\')" --inlineco\ +unt "allpages" --skip 0 --top 4 --automation-account-name "myAutomationAccount33" --resource-group "rg" + - name: List Paged DSC nodes by Automation Account with version filter + text: |- + az automation dsc-node list --filter "properties/extensionHandler/any(eh: eh/version le \'2.70\')" --inl\ +inecount "allpages" --skip 0 --top 4 --automation-account-name "myAutomationAccount33" --resource-group "rg" + - name: List Paged DSC nodes with filters separated by 'and' + text: |- + az automation dsc-node list --filter "properties/extensionHandler/any(eh: eh/version gt \'2.70\') and co\ +ntains(name,\'sql\') and contains(properties/nodeConfiguration/name,\'$$Not$$Configured$$\')" --inlinecount "allpages" \ +--skip 0 --top 10 --automation-account-name "myAutomationAccount33" --resource-group "rg" +""" + +helps['automation dsc-node show'] = """ + type: command + short-summary: Retrieve the dsc node identified by node id. + examples: + - name: Get a node + text: |- + az automation dsc-node show --automation-account-name "myAutomationAccount33" --node-id "nodeId" --resou\ +rce-group "rg" +""" + +helps['automation dsc-node update'] = """ + type: command + short-summary: Update the dsc node. + examples: + - name: Update a node + text: |- + az automation dsc-node update --automation-account-name "myAutomationAccount33" --node-id "nodeId" --nod\ +e-configuration-name "SetupServer.localhost" --node-id "nodeId" --resource-group "rg" +""" + +helps['automation dsc-node delete'] = """ + type: command + short-summary: Delete the dsc node identified by node id. + examples: + - name: Delete a DSC Node + text: |- + az automation dsc-node delete --automation-account-name "myAutomationAccount9" --node-id "e1243a76-a9bd-\ +432f-bde3-ad8f317ee786" --resource-group "rg" +""" + +helps['automation node-report'] = """ + type: group + short-summary: automation node-report +""" + +helps['automation node-report list'] = """ + type: command + short-summary: Retrieve the Dsc node report list by node id. + examples: + - name: List DSC reports by node id. + text: |- + az automation node-report list --automation-account-name "myAutomationAccount33" --node-id "nodeId" --re\ +source-group "rg" +""" + +helps['automation node-report show'] = """ + type: command + short-summary: Retrieve the Dsc node reports by node id and report id. + examples: + - name: Get Dsc node report data by node id and report id. + text: |- + az automation node-report show --automation-account-name "myAutomationAccount33" --node-id "nodeId" --re\ +port-id "903a5ead-140c-11e7-a943-000d3a6140c9" --resource-group "rg" +""" + +helps['automation dsc-compilation-job'] = """ + type: group + short-summary: automation dsc-compilation-job +""" + +helps['automation dsc-compilation-job list'] = """ + type: command + short-summary: Retrieve a list of dsc compilation jobs. + examples: + - name: List DSC Compilation job in Automation Account + text: |- + az automation dsc-compilation-job list --automation-account-name "myAutomationAccount33" --resource-grou\ +p "rg" +""" + +helps['automation dsc-compilation-job show'] = """ + type: command + short-summary: Retrieve the Dsc configuration compilation job identified by job id. + examples: + - name: Get a DSC Compilation job stream by job stream id + text: |- + az automation dsc-compilation-job show --automation-account-name "myAutomationAccount33" --job-id "836d4\ +e06-2d88-46b4-8500-7febd4906838" --job-stream-id "836d4e06-2d88-46b4-8500-7febd4906838_00636481062421684835_00000000000\ +000000008" --resource-group "rg" +""" + +helps['automation dsc-compilation-job create'] = """ + type: command + short-summary: Creates the Dsc compilation job of the configuration. + examples: + - name: Create or update a DSC Compilation job + text: |- + az automation dsc-compilation-job create --automation-account-name "myAutomationAccount33" --compilation\ +-job-name "TestCompilationJob" --parameters properties={"configuration":{"name":"SetupServer"}} --resource-group "rg" +""" + +helps['automation dsc-compilation-job-stream'] = """ + type: group + short-summary: automation dsc-compilation-job-stream +""" + +helps['automation dsc-compilation-job-stream list'] = """ + type: command + short-summary: Retrieve all the job streams for the compilation Job. + examples: + - name: List DSC Compilation job streams + text: |- + az automation dsc-compilation-job-stream list --automation-account-name "myAutomationAccount33" --job-id\ + "836d4e06-2d88-46b4-8500-7febd4906838" --resource-group "rg" +""" + +helps['automation dsc-node-configuration'] = """ + type: group + short-summary: automation dsc-node-configuration +""" + +helps['automation dsc-node-configuration list'] = """ + type: command + short-summary: Retrieve a list of dsc node configurations. + examples: + - name: List DSC node configurations by Automation Account + text: |- + az automation dsc-node-configuration list --automation-account-name "myAutomationAccount33" --resource-g\ +roup "rg" + - name: List Paged DSC node configurations by Automation Account with name filter + text: |- + az automation dsc-node-configuration list --filter "contains(\'.localhost\',name)" --inlinecount "allpag\ +es" --skip 0 --top 2 --automation-account-name "myAutomationAccount33" --resource-group "rg" + - name: List Paged DSC node configurations by Automation Account with no filter + text: |- + az automation dsc-node-configuration list --inlinecount "allpages" --skip 0 --top 4 --automation-account\ +-name "myAutomationAccount33" --resource-group "rg" +""" + +helps['automation dsc-node-configuration show'] = """ + type: command + short-summary: Retrieve the Dsc node configurations by node configuration. + examples: + - name: Get a DSC node configuration + text: |- + az automation dsc-node-configuration show --automation-account-name "myAutomationAccount33" --node-confi\ +guration-name "SetupServer.localhost" --resource-group "rg" +""" + +helps['automation dsc-node-configuration create'] = """ + type: command + short-summary: Create the node configuration identified by node configuration name. + examples: + - name: Create node configuration + text: |- + az automation dsc-node-configuration create --automation-account-name "myAutomationAccount20" --node-con\ +figuration-name "configName.nodeConfigName" --name "configName.nodeConfigName" --configuration name="configName" --incr\ +ement-node-configuration-build true --source "{\\"type\\":\\"embeddedContent\\",\\"hash\\":{\\"algorithm\\":\\"sha256\\\ +",\\"value\\":\\"6DE256A57F01BFA29B88696D5E77A383D6E61484C7686E8DB955FA10ACE9FFE5\\"},\\"value\\":\\"\\\\r\\\\ninstance\ + of MSFT_RoleResource as $MSFT_RoleResource1ref\\\\r\\\\n{\\\\r\\\\nResourceID = \\\\\\"[WindowsFeature]IIS\\\\\\";\\\\\ +r\\\\n Ensure = \\\\\\"Present\\\\\\";\\\\r\\\\n SourceInfo = \\\\\\"::3::32::WindowsFeature\\\\\\";\\\\r\\\\n Name = \ +\\\\\\"Web-Server\\\\\\";\\\\r\\\\n ModuleName = \\\\\\"PsDesiredStateConfiguration\\\\\\";\\\\r\\\\n\\\\r\\\\nModuleVe\ +rsion = \\\\\\"1.0\\\\\\";\\\\r\\\\r\\\\n ConfigurationName = \\\\\\"configName\\\\\\";\\\\r\\\\r\\\\n};\\\\r\\\\ninsta\ +nce of OMI_ConfigurationDocument\\\\r\\\\n\\\\r\\\\r\\\\n {\\\\r\\\\n Version=\\\\\\"2.0.0\\\\\\";\\\ +\\r\\\\n \\\\r\\\\r\\\\n MinimumCompatibleVersion = \\\\\\"1.0.0\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\ +\\n CompatibleVersionAdditionalProperties= {\\\\\\"Omi_BaseResource:ConfigurationName\\\\\\"};\\\ +\\r\\\\n \\\\r\\\\r\\\\n Author=\\\\\\"weijiel\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n \ + GenerationDate=\\\\\\"03/30/2017 13:40:25\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n GenerationHo\ +st=\\\\\\"TEST-BACKEND\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n Name=\\\\\\"configName\\\\\\";\\\\r\\\\\ +n\\\\r\\\\r\\\\n };\\\\r\\\\n\\",\\"version\\":\\"1.0\\"}" --resource-group "rg" +""" + +helps['automation dsc-node-configuration update'] = """ + type: command + short-summary: Create the node configuration identified by node configuration name. + examples: + - name: Create node configuration + text: |- + az automation dsc-node-configuration update --automation-account-name "myAutomationAccount20" --node-con\ +figuration-name "configName.nodeConfigName" --name "configName.nodeConfigName" --configuration name="configName" --incr\ +ement-node-configuration-build true --source "{\\"type\\":\\"embeddedContent\\",\\"hash\\":{\\"algorithm\\":\\"sha256\\\ +",\\"value\\":\\"6DE256A57F01BFA29B88696D5E77A383D6E61484C7686E8DB955FA10ACE9FFE5\\"},\\"value\\":\\"\\\\r\\\\ninstance\ + of MSFT_RoleResource as $MSFT_RoleResource1ref\\\\r\\\\n{\\\\r\\\\nResourceID = \\\\\\"[WindowsFeature]IIS\\\\\\";\\\\\ +r\\\\n Ensure = \\\\\\"Present\\\\\\";\\\\r\\\\n SourceInfo = \\\\\\"::3::32::WindowsFeature\\\\\\";\\\\r\\\\n Name = \ +\\\\\\"Web-Server\\\\\\";\\\\r\\\\n ModuleName = \\\\\\"PsDesiredStateConfiguration\\\\\\";\\\\r\\\\n\\\\r\\\\nModuleVe\ +rsion = \\\\\\"1.0\\\\\\";\\\\r\\\\r\\\\n ConfigurationName = \\\\\\"configName\\\\\\";\\\\r\\\\r\\\\n};\\\\r\\\\ninsta\ +nce of OMI_ConfigurationDocument\\\\r\\\\n\\\\r\\\\r\\\\n {\\\\r\\\\n Version=\\\\\\"2.0.0\\\\\\";\\\ +\\r\\\\n \\\\r\\\\r\\\\n MinimumCompatibleVersion = \\\\\\"1.0.0\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\ +\\n CompatibleVersionAdditionalProperties= {\\\\\\"Omi_BaseResource:ConfigurationName\\\\\\"};\\\ +\\r\\\\n \\\\r\\\\r\\\\n Author=\\\\\\"weijiel\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n \ + GenerationDate=\\\\\\"03/30/2017 13:40:25\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n GenerationHo\ +st=\\\\\\"TEST-BACKEND\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n Name=\\\\\\"configName\\\\\\";\\\\r\\\\\ +n\\\\r\\\\r\\\\n };\\\\r\\\\n\\",\\"version\\":\\"1.0\\"}" --resource-group "rg" +""" + +helps['automation dsc-node-configuration delete'] = """ + type: command + short-summary: Delete the Dsc node configurations by node configuration. + examples: + - name: Delete a DSC node configuration + text: |- + az automation dsc-node-configuration delete --automation-account-name "myAutomationAccount20" --node-con\ +figuration-name "configName.nodeConfigName" --resource-group "rg" +""" + +helps['automation node-count-information'] = """ + type: group + short-summary: automation node-count-information +""" + +helps['automation node-count-information show'] = """ + type: command + short-summary: Retrieve counts for Dsc Nodes. + examples: + - name: Get node's node configuration counts + text: |- + az automation node-count-information show --automation-account-name "myAutomationAccount33" --count-type\ + "nodeconfiguration" --resource-group "rg" + - name: Get node's status counts + text: |- + az automation node-count-information show --automation-account-name "myAutomationAccount33" --count-type\ + "status" --resource-group "rg" +""" + +helps['automation runbook-draft'] = """ + type: group + short-summary: automation runbook-draft +""" + +helps['automation runbook-draft show'] = """ + type: command + short-summary: Retrieve the runbook draft identified by runbook name. + examples: + - name: Get runbook draft content + text: |- + az automation runbook-draft show --automation-account-name "ContoseAutomationAccount" --resource-group "\ +rg" --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation runbook-draft replace-content'] = """ + type: command + short-summary: Replaces the runbook draft content. + examples: + - name: Create or update runbook draft + text: |- + az automation runbook-draft replace-content --automation-account-name "ContoseAutomationAccount" --resou\ +rce-group "rg" --runbook-content "<#\\r\\n .DESCRIPTION\\r\\n An example runbook which prints out the\ + first10 Azure VMs in your subscription (ordered alphabetically).\\r\\n For more information about how this \ +runbook authenticates to your Azure subscription, see our documentation here: http: //aka.ms/fxu3mn\\r\\n\\r\\n \ +.NOTES\\r\\n AUTHOR: Azure Automation Team\\r\\n LASTEDIT: Mar27,\\r\\n 2015\\r\\n \ +#>\\r\\n workflow Get-AzureVMTutorial{\\r\\n #The name of the Automation Credential Asset this runbook will u\ +se to authenticate to Azure.\\r\\n $CredentialAssetName = \'DefaultAzureCredential\'\\r\\n\\r\\n #Get the\ + credential with the above name from the Automation Asset store\\r\\n $Cred = Get-AutomationPSCredential -Name $\ +CredentialAssetName\\r\\n if(!$Cred){\\r\\n Throw\\"Could not find an Automation Credential Asset nam\ +ed \'${CredentialAssetName}\'. Make sure you have created one in this Automation Account.\\"\\r\\n }\\r\ +\\n\\r\\n #Connect to your Azure Account\\r\\n $Account = Add-AzureAccount -Credential $Cred\\r\\n \ + if(!$Account){\\r\\n Throw\\"Could not authenticate to Azure using the credential asset \'${CredentialAsset\ +Name}\'. Make sure the user name and password are correct.\\"\\r\\n }\\r\\n\\r\\n #TODO (optional\ +): pick the right subscription to use. Without this line, the default subscription for your Azure Account will be used.\ +\\r\\n #Select-AzureSubscription -SubscriptionName\\"TODO: your Azure subscription name here\\"\\r\\n \\r\ +\\n #Get all the VMs you have in your Azure subscription\\r\\n $VMs = Get-AzureVM\\r\\n\\r\\n #Pri\ +nt out up to10 of those VMs\\r\\n if(!$VMs){\\r\\n Write-Output\\"No VMs were found in your subscript\ +ion.\\"\\r\\n } else{\\r\\n Write-Output $VMs[0..9\\r\\n ]\\r\\n \ + }\\r\\n }" --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation runbook-draft undo-edit'] = """ + type: command + short-summary: Undo draft edit to last known published state identified by runbook name. + examples: + - name: Undo draft edit to last known published state + text: |- + az automation runbook-draft undo-edit --automation-account-name "ContoseAutomationAccount" --resource-gr\ +oup "rg" --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation runbook'] = """ + type: group + short-summary: automation runbook +""" + +helps['automation runbook list'] = """ + type: command + short-summary: Retrieve a list of runbooks. + examples: + - name: List runbooks by automation account + text: |- + az automation runbook list --automation-account-name "ContoseAutomationAccount" --resource-group "rg" +""" + +helps['automation runbook show'] = """ + type: command + short-summary: Retrieve the runbook identified by runbook name. + examples: + - name: Get runbook content + text: |- + az automation runbook show --automation-account-name "ContoseAutomationAccount" --resource-group "rg" --\ +runbook-name "Get-AzureVMTutorial" +""" + +helps['automation runbook create'] = """ + type: command + short-summary: Create the runbook identified by runbook name. + examples: + - name: Create or update runbook and publish it + text: |- + az automation runbook create --automation-account-name "ContoseAutomationAccount" --name "Get-AzureVMTut\ +orial" --location "East US 2" --description "Description of the Runbook" --log-activity-trace 1 --log-progress true --l\ +og-verbose false --publish-content-link "{\\"contentHash\\":{\\"algorithm\\":\\"SHA256\\",\\"value\\":\\"115775B8FF2BE6\ +72D8A946BD0B489918C724DDE15A440373CA54461D53010A80\\"},\\"uri\\":\\"https://raw.githubusercontent.com/Azure/azure-quick\ +start-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1\\"}" --runbook-type "PowerShellWo\ +rkflow" --tags tag01="value01" tag02="value02" --resource-group "rg" --runbook-name "Get-AzureVMTutorial" + - name: Create runbook as draft + text: |- + az automation runbook create --automation-account-name "ContoseAutomationAccount" --name "Get-AzureVMTut\ +orial" --location "East US 2" --description "Description of the Runbook" --draft "{}" --log-progress false --log-verbos\ +e false --runbook-type "PowerShellWorkflow" --tags tag01="value01" tag02="value02" --resource-group "rg" --runbook-name\ + "Get-AzureVMTutorial" +""" + +helps['automation runbook update'] = """ + type: command + short-summary: Update the runbook identified by runbook name. + examples: + - name: Update runbook + text: |- + az automation runbook update --automation-account-name "ContoseAutomationAccount" --description "Updated\ + Description of the Runbook" --log-activity-trace 1 --log-progress true --log-verbose false --resource-group "rg" --run\ +book-name "Get-AzureVMTutorial" +""" + +helps['automation runbook delete'] = """ + type: command + short-summary: Delete the runbook by name. + examples: + - name: Delete a runbook + text: |- + az automation runbook delete --automation-account-name "ContoseAutomationAccount" --resource-group "rg" \ +--runbook-name "Get-AzureVMTutorial" +""" + +helps['automation runbook publish'] = """ + type: command + short-summary: Publish runbook draft. + examples: + - name: Publish runbook draft + text: |- + az automation runbook publish --automation-account-name "ContoseAutomationAccount" --resource-group "rg"\ + --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation test-job-stream'] = """ + type: group + short-summary: automation test-job-stream +""" + +helps['automation test-job-stream list'] = """ + type: command + short-summary: Retrieve a list of test job streams identified by runbook name. + examples: + - name: List job streams by job name + text: |- + az automation test-job-stream list --automation-account-name "ContoseAutomationAccount" --resource-group\ + "mygroup" --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation test-job-stream show'] = """ + type: command + short-summary: Retrieve a test job stream of the test job identified by runbook name and stream id. + examples: + - name: Get test job stream + text: |- + az automation test-job-stream show --automation-account-name "ContoseAutomationAccount" --job-stream-id \ +"851b2101-686f-40e2-8a4b-5b8df08afbd1_00636535684910693884_00000000000000000001" --resource-group "mygroup" --runbook-n\ +ame "Get-AzureVMTutorial" +""" + +helps['automation test-job'] = """ + type: group + short-summary: automation test-job +""" + +helps['automation test-job show'] = """ + type: command + short-summary: Retrieve the test job for the specified runbook. + examples: + - name: Get test job + text: |- + az automation test-job show --automation-account-name "ContoseAutomationAccount" --resource-group "mygro\ +up" --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation test-job create'] = """ + type: command + short-summary: Create a test job of the runbook. + examples: + - name: Create test job + text: |- + az automation test-job create --automation-account-name "ContoseAutomationAccount" --parameters paramete\ +rs={"key01":"value01","key02":"value02"} runOn="" --resource-group "mygroup" --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation test-job resume'] = """ + type: command + short-summary: Resume the test job. + examples: + - name: Resume test job + text: |- + az automation test-job resume --automation-account-name "ContoseAutomationAccount" --resource-group "myg\ +roup" --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation test-job stop'] = """ + type: command + short-summary: Stop the test job. + examples: + - name: Stop test job + text: |- + az automation test-job stop --automation-account-name "ContoseAutomationAccount" --resource-group "mygro\ +up" --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation test-job suspend'] = """ + type: command + short-summary: Suspend the test job. + examples: + - name: Suspend test job + text: |- + az automation test-job suspend --automation-account-name "ContoseAutomationAccount" --resource-group "my\ +group" --runbook-name "Get-AzureVMTutorial" +""" + +helps['automation python2-package'] = """ + type: group + short-summary: automation python2-package +""" + +helps['automation python2-package list'] = """ + type: command + short-summary: Retrieve a list of python 2 packages. + examples: + - name: List python 2 packages by automation account + text: |- + az automation python2-package list --automation-account-name "myAutomationAccount33" --resource-group "r\ +g" +""" + +helps['automation python2-package show'] = """ + type: command + short-summary: Retrieve the python 2 package identified by package name. + examples: + - name: Get a python 2 package + text: |- + az automation python2-package show --automation-account-name "myAutomationAccount33" --package-name "Oms\ +CompositeResources" --resource-group "rg" +""" + +helps['automation python2-package create'] = """ + type: command + short-summary: Create or Update the python 2 package identified by package name. + examples: + - name: Create or update a python 2 package + text: |- + az automation python2-package create --automation-account-name "myAutomationAccount33" --package-name "O\ +msCompositeResources" --content-link "{\\"contentHash\\":{\\"algorithm\\":\\"sha265\\",\\"value\\":\\"07E108A962B81DD9C\ +9BAA89BB47C0F6EE52B29E83758B07795E408D258B2B87A\\"},\\"uri\\":\\"https://teststorage.blob.core.windows.net/dsccomposite\ +/OmsCompositeResources.zip\\",\\"version\\":\\"1.0.0.0\\"}" --resource-group "rg" +""" + +helps['automation python2-package update'] = """ + type: command + short-summary: Update the python 2 package identified by package name. + examples: + - name: Update a module + text: |- + az automation python2-package update --automation-account-name "MyAutomationAccount" --package-name "MyP\ +ython2Package" --resource-group "rg" +""" + +helps['automation python2-package delete'] = """ + type: command + short-summary: Delete the python 2 package by name. + examples: + - name: Delete a python 2 package + text: |- + az automation python2-package delete --automation-account-name "myAutomationAccount33" --package-name "O\ +msCompositeResources" --resource-group "rg" +""" diff --git a/src/automation/azext_automation/generated/_params.py b/src/automation/azext_automation/generated/_params.py new file mode 100644 index 00000000000..f068a3e841b --- /dev/null +++ b/src/automation/azext_automation/generated/_params.py @@ -0,0 +1,1072 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.arguments import CLIArgumentType +from azure.cli.core.commands.parameters import ( + tags_type, + get_three_state_flag, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from azext_automation.action import ( + AddSku, + AddConnectionType, + AddAutomationConnectionCreateFieldDefinitionValues, + AddAutomationConnectionUpdateFieldDefinitionValues, + AddCredential, + AddSchedule, + AddRunbook, + AddJobscheduleParameters, + AddAdvancedScheduleMonthlyOccurrences, + AddWebhookParameters, + AddScriptParameters, + AddError, + AddTasksPostTaskParameters, + AddUpdateConfigurationWindows, + AddUpdateConfigurationLinux, + AddUpdateConfigurationTargetsNonAzureQueries, + AddSecurityToken, + AddJobParameters, + AddConfiguration, + AddDsccompilationjobParameters, + AddTestjobParameters +) + + +def load_arguments(self, _): + + with self.argument_context('automation automation-account list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('automation automation-account show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation automation-account create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('name', help='Gets or sets name of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='Gets or sets account SKU. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, family, capacity.') + + with self.argument_context('automation automation-account update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('name', help='Gets or sets the name of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='Gets or sets account SKU. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, family, capacity.') + + with self.argument_context('automation automation-account delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation statistics list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation usage list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation key list-by-automation-account') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation certificate list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation certificate show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('certificate_name', help='The name of certificate.') + + with self.argument_context('automation certificate create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('certificate_name', help='The parameters supplied to the create or update certificate operation.') + c.argument('name', help='Gets or sets the name of the certificate.') + c.argument('base64value', help='Gets or sets the base64 encoded value of the certificate.') + c.argument('description', help='Gets or sets the description of the certificate.') + c.argument('thumbprint', help='Gets or sets the thumbprint of the certificate.') + c.argument('is_exportable', arg_type=get_three_state_flag(), help='Gets or sets the is exportable flag of the c' + 'ertificate.') + + with self.argument_context('automation certificate update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('certificate_name', help='The parameters supplied to the update certificate operation.') + c.argument('name', help='Gets or sets the name of the certificate.') + c.argument('description', help='Gets or sets the description of the certificate.') + + with self.argument_context('automation certificate delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('certificate_name', help='The name of certificate.') + + with self.argument_context('automation connection list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation connection show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('connection_name', help='The name of connection.') + + with self.argument_context('automation connection create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('connection_name', help='The parameters supplied to the create or update connection operation.') + c.argument('name', help='Gets or sets the name of the connection.') + c.argument('description', help='Gets or sets the description of the connection.') + c.argument('connection_type', action=AddConnectionType, nargs='+', help='Gets or sets the connectionType of the' + ' connection. Expect value: name=xx.') + c.argument('field_definition_values', action=AddAutomationConnectionCreateFieldDefinitionValues, nargs='+', + help='Gets or sets the field definition properties of the connection. Expect value: KEY1=VALUE1 KEY2' + '=VALUE2 ...') + + with self.argument_context('automation connection update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('connection_name', help='The parameters supplied to the update a connection operation.') + c.argument('name', help='Gets or sets the name of the connection.') + c.argument('description', help='Gets or sets the description of the connection.') + c.argument('field_definition_values', action=AddAutomationConnectionUpdateFieldDefinitionValues, nargs='+', + help='Gets or sets the field definition values of the connection. Expect value: KEY1=VALUE1 KEY2=VAL' + 'UE2 ...') + + with self.argument_context('automation connection delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('connection_name', help='The name of connection.') + + with self.argument_context('automation connection-type list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation connection-type show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('connection_type_name', help='The name of connection type.') + + with self.argument_context('automation connection-type create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('connection_type_name', help='The parameters supplied to the create or update connection type operat' + 'ion.') + c.argument('name', help='Gets or sets the name of the connection type.') + c.argument('is_global', arg_type=get_three_state_flag(), help='Gets or sets a Boolean value to indicate if the ' + 'connection type is global.') + c.argument('field_definitions', arg_type=CLIArgumentType(options_list=['--field-definitions'], help='Gets or se' + 'ts the field definitions of the connection type. Expected value: json-string/@json-file.')) + + with self.argument_context('automation connection-type update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('connection_type_name', help='The parameters supplied to the create or update connection type operat' + 'ion.') + c.argument('name', help='Gets or sets the name of the connection type.') + c.argument('is_global', arg_type=get_three_state_flag(), help='Gets or sets a Boolean value to indicate if the ' + 'connection type is global.') + c.argument('field_definitions', arg_type=CLIArgumentType(options_list=['--field-definitions'], help='Gets or se' + 'ts the field definitions of the connection type. Expected value: json-string/@json-file.')) + + with self.argument_context('automation connection-type delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('connection_type_name', help='The name of connection type.') + + with self.argument_context('automation credential list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation credential show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('credential_name', help='The name of credential.') + + with self.argument_context('automation credential create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('credential_name', help='The parameters supplied to the create or update credential operation.') + c.argument('name', help='Gets or sets the name of the credential.') + c.argument('user_name', help='Gets or sets the user name of the credential.') + c.argument('password', help='Gets or sets the password of the credential.') + c.argument('description', help='Gets or sets the description of the credential.') + + with self.argument_context('automation credential update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('credential_name', help='The parameters supplied to the Update credential operation.') + c.argument('name', help='Gets or sets the name of the credential.') + c.argument('user_name', help='Gets or sets the user name of the credential.') + c.argument('password', help='Gets or sets the password of the credential.') + c.argument('description', help='Gets or sets the description of the credential.') + + with self.argument_context('automation credential delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('credential_name', help='The name of credential.') + + with self.argument_context('automation dsc-configuration list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + c.argument('skip', help='The number of rows to skip.') + c.argument('top', help='The number of rows to take.') + c.argument('inlinecount', help='Return total rows.') + + with self.argument_context('automation dsc-configuration show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('configuration_name', help='The configuration name.') + + with self.argument_context('automation dsc-configuration create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('configuration_name', help='The create or update parameters for configuration.') + c.argument('name', help='Gets or sets name of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('log_verbose', arg_type=get_three_state_flag(), help='Gets or sets verbose log option.') + c.argument('log_progress', arg_type=get_three_state_flag(), help='Gets or sets progress log option.') + c.argument('source', arg_type=CLIArgumentType(options_list=['--source'], help='Gets or sets the source. Expecte' + 'd value: json-string/@json-file.')) + c.argument('parameters', arg_type=CLIArgumentType(options_list=['--parameters'], help='Gets or sets the configu' + 'ration parameters. Expected value: json-string/@json-file.')) + c.argument('description', help='Gets or sets the description of the configuration.') + + with self.argument_context('automation dsc-configuration update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('configuration_name', help='The create or update parameters for configuration.') + c.argument('name', help='Gets or sets name of the resource.') + c.argument('tags', tags_type) + c.argument('log_verbose', arg_type=get_three_state_flag(), help='Gets or sets verbose log option.') + c.argument('log_progress', arg_type=get_three_state_flag(), help='Gets or sets progress log option.') + c.argument('source', arg_type=CLIArgumentType(options_list=['--source'], help='Gets or sets the source. Expecte' + 'd value: json-string/@json-file.')) + c.argument('parameters', arg_type=CLIArgumentType(options_list=['--parameters'], help='Gets or sets the configu' + 'ration parameters. Expected value: json-string/@json-file.')) + c.argument('description', help='Gets or sets the description of the configuration.') + + with self.argument_context('automation dsc-configuration delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('configuration_name', help='The configuration name.') + + with self.argument_context('automation hybrid-runbook-worker-group list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation hybrid-runbook-worker-group show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('hybrid_runbook_worker_group_name', help='The hybrid runbook worker group name') + + with self.argument_context('automation hybrid-runbook-worker-group update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('hybrid_runbook_worker_group_name', help='The hybrid runbook worker group name') + c.argument('credential', action=AddCredential, nargs='+', help='Sets the credential of a worker group. Expect v' + 'alue: name=xx.') + + with self.argument_context('automation hybrid-runbook-worker-group delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('hybrid_runbook_worker_group_name', help='The hybrid runbook worker group name') + + with self.argument_context('automation job-schedule list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation job-schedule show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_schedule_id', help='The job schedule name.') + + with self.argument_context('automation job-schedule create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_schedule_id', help='The job schedule name.') + c.argument('schedule', action=AddSchedule, nargs='+', + help='Gets or sets the schedule. Expect value: name=xx.') + c.argument('runbook', action=AddRunbook, nargs='+', help='Gets or sets the runbook. Expect value: name=xx.') + c.argument('run_on', help='Gets or sets the hybrid worker group that the scheduled job should run on.') + c.argument('parameters', action=AddJobscheduleParameters, nargs='+', help='Gets or sets a list of job propertie' + 's. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + + with self.argument_context('automation job-schedule delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_schedule_id', help='The job schedule name.') + + with self.argument_context('automation linked-workspace show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation activity list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('module_name', help='The name of module.') + + with self.argument_context('automation activity show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('module_name', help='The name of module.') + c.argument('activity_name', help='The name of activity.') + + with self.argument_context('automation module list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation module show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('module_name', help='The module name.') + + with self.argument_context('automation module create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('module_name', help='The name of module.') + c.argument('name', help='Gets or sets name of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('content_link', arg_type=CLIArgumentType(options_list=['--content-link'], help='Gets or sets the mod' + 'ule content link. Expected value: json-string/@json-file.')) + + with self.argument_context('automation module update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('module_name', help='The name of module.') + c.argument('name', help='Gets or sets name of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('content_link', arg_type=CLIArgumentType(options_list=['--content-link'], help='Gets or sets the mod' + 'ule content link. Expected value: json-string/@json-file.')) + + with self.argument_context('automation module delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('module_name', help='The module name.') + + with self.argument_context('automation object-data-type list-field') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('module_name', help='The name of module.') + c.argument('type_name', help='The name of type.') + + with self.argument_context('automation field list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('module_name', help='The name of module.') + c.argument('type_name', help='The name of type.') + + with self.argument_context('automation schedule list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation schedule show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('schedule_name', help='The schedule name.') + + with self.argument_context('automation schedule create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('schedule_name', help='The schedule name.') + c.argument('name', help='Gets or sets the name of the Schedule.') + c.argument('description', help='Gets or sets the description of the schedule.') + c.argument('start_time', help='Gets or sets the start time of the schedule.') + c.argument('expiry_time', help='Gets or sets the end time of the schedule.') + c.argument('interval', arg_type=CLIArgumentType(options_list=['--interval'], help='Gets or sets the interval of' + ' the schedule. Expected value: json-string/@json-file.')) + c.argument('frequency', arg_type=get_enum_type(['OneTime', 'Day', 'Hour', 'Week', 'Month', 'Minute']), help='Ge' + 'ts or sets the frequency of the schedule.') + c.argument('time_zone', help='Gets or sets the time zone of the schedule.') + c.argument('advanced_schedule_week_days', nargs='+', help='Days of the week that the job should execute on. Exp' + 'ected value: json-string/@json-file.') + c.argument('advanced_schedule_month_days', nargs='+', help='Days of the month that the job should execute on. M' + 'ust be between 1 and 31. Expected value: json-string/@json-file.') + c.argument('advanced_schedule_monthly_occurrences', action=AddAdvancedScheduleMonthlyOccurrences, nargs='+', + help='Occurrences of days within a month. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs' + ' are: occurrence, day.') + + with self.argument_context('automation schedule update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('schedule_name', help='The schedule name.') + c.argument('name', help='Gets or sets the name of the Schedule.') + c.argument('description', help='Gets or sets the description of the schedule.') + c.argument('is_enabled', arg_type=get_three_state_flag(), help='Gets or sets a value indicating whether this sc' + 'hedule is enabled.') + + with self.argument_context('automation schedule delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('schedule_name', help='The schedule name.') + + with self.argument_context('automation variable list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation variable show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('variable_name', help='The name of variable.') + + with self.argument_context('automation variable create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('variable_name', help='The variable name.') + c.argument('name', help='Gets or sets the name of the variable.') + c.argument('value', help='Gets or sets the value of the variable.') + c.argument('description', help='Gets or sets the description of the variable.') + c.argument('is_encrypted', arg_type=get_three_state_flag(), help='Gets or sets the encrypted flag of the variab' + 'le.') + + with self.argument_context('automation variable update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('variable_name', help='The variable name.') + c.argument('name', help='Gets or sets the name of the variable.') + c.argument('value', help='Gets or sets the value of the variable.') + c.argument('description', help='Gets or sets the description of the variable.') + + with self.argument_context('automation variable delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('variable_name', help='The name of variable.') + + with self.argument_context('automation webhook list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation webhook show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('webhook_name', help='The webhook name.') + + with self.argument_context('automation webhook create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('webhook_name', help='The webhook name.') + c.argument('name', help='Gets or sets the name of the webhook.') + c.argument('is_enabled', arg_type=get_three_state_flag(), help='Gets or sets the value of the enabled flag of w' + 'ebhook.') + c.argument('uri', help='Gets or sets the uri.') + c.argument('expiry_time', help='Gets or sets the expiry time.') + c.argument('parameters', action=AddWebhookParameters, nargs='+', help='Gets or sets the parameters of the job. ' + 'Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('runbook', action=AddRunbook, nargs='+', help='Gets or sets the runbook. Expect value: name=xx.') + c.argument('run_on', help='Gets or sets the name of the hybrid worker group the webhook job will run on.') + + with self.argument_context('automation webhook update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('webhook_name', help='The webhook name.') + c.argument('name', help='Gets or sets the name of the webhook.') + c.argument('is_enabled', arg_type=get_three_state_flag(), help='Gets or sets the value of the enabled flag of w' + 'ebhook.') + c.argument('run_on', help='Gets or sets the name of the hybrid worker group the webhook job will run on.') + c.argument('parameters', action=AddWebhookParameters, nargs='+', help='Gets or sets the parameters of the job. ' + 'Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('description', help='Gets or sets the description of the webhook.') + + with self.argument_context('automation webhook delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('webhook_name', help='The webhook name.') + + with self.argument_context('automation webhook generate-uri') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation watcher list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation watcher show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('watcher_name', help='The watcher name.') + + with self.argument_context('automation watcher create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('watcher_name', help='The watcher name.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('etag', help='Gets or sets the etag of the resource.') + c.argument('execution_frequency_in_seconds', + help='Gets or sets the frequency at which the watcher is invoked.') + c.argument('script_name', help='Gets or sets the name of the script the watcher is attached to, i.e. the name o' + 'f an existing runbook.') + c.argument('script_parameters', action=AddScriptParameters, nargs='+', help='Gets or sets the parameters of the' + ' script. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('script_run_on', help='Gets or sets the name of the hybrid worker group the watcher will run on.') + c.argument('description', help='Gets or sets the description.') + + with self.argument_context('automation watcher update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('watcher_name', help='The watcher name.') + c.argument('name', help='Gets or sets the name of the resource.') + c.argument('execution_frequency_in_seconds', + help='Gets or sets the frequency at which the watcher is invoked.') + + with self.argument_context('automation watcher delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('watcher_name', help='The watcher name.') + + with self.argument_context('automation watcher start') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('watcher_name', help='The watcher name.') + + with self.argument_context('automation watcher stop') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('watcher_name', help='The watcher name.') + + with self.argument_context('automation software-update-configuration list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('client_request_id', help='Identifies this specific client request.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation software-update-configuration show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('software_update_configuration_name', help='The name of the software update configuration to be crea' + 'ted.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation software-update-configuration create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('software_update_configuration_name', help='The name of the software update configuration to be crea' + 'ted.') + c.argument('client_request_id', help='Identifies this specific client request.') + c.argument('error', action=AddError, nargs='+', help='Details of provisioning error Expect value: KEY1=VALUE1 K' + 'EY2=VALUE2 ... , available KEYs are: code, message.') + c.argument('tasks_post_task_parameters', action=AddTasksPostTaskParameters, nargs='+', help='Gets or sets the p' + 'arameters of the task. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('tasks_post_task_source', help='Gets or sets the name of the runbook.') + c.argument('tasks_pre_task_parameters', action=AddTasksPostTaskParameters, nargs='+', help='Gets or sets the pa' + 'rameters of the task. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('tasks_pre_task_source', help='Gets or sets the name of the runbook.') + c.argument('schedule_info_start_time', help='Gets or sets the start time of the schedule.') + c.argument('schedule_info_expiry_time', help='Gets or sets the end time of the schedule.') + c.argument('schedule_info_expiry_time_offset_minutes', help='Gets or sets the expiry time\'s offset in minutes.' + '') + c.argument('schedule_info_is_enabled', arg_type=get_three_state_flag(), help='Gets or sets a value indicating w' + 'hether this schedule is enabled.') + c.argument('schedule_info_next_run', help='Gets or sets the next run time of the schedule.') + c.argument('schedule_info_next_run_offset_minutes', + help='Gets or sets the next run time\'s offset in minutes.') + c.argument('schedule_info_interval', help='Gets or sets the interval of the schedule.') + c.argument('schedule_info_frequency', arg_type=get_enum_type(['OneTime', 'Day', 'Hour', 'Week', 'Month', 'Minut' + 'e']), help='Gets or sets the frequency of the schedule.') + c.argument('schedule_info_time_zone', help='Gets or sets the time zone of the schedule.') + c.argument('schedule_info_creation_time', help='Gets or sets the creation time.') + c.argument('schedule_info_last_modified_time', help='Gets or sets the last modified time.') + c.argument('schedule_info_description', help='Gets or sets the description.') + c.argument('schedule_info_advanced_schedule_week_days', nargs='+', help='Days of the week that the job should e' + 'xecute on. Expected value: json-string/@json-file.') + c.argument('schedule_info_advanced_schedule_month_days', nargs='+', help='Days of the month that the job should' + ' execute on. Must be between 1 and 31. Expected value: json-string/@json-file.') + c.argument('schedule_info_advanced_schedule_monthly_occurrences', action=AddAdvancedScheduleMonthlyOccurrences, + nargs='+', help='Occurrences of days within a month. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , av' + 'ailable KEYs are: occurrence, day.') + c.argument('update_configuration_operating_system', arg_type=get_enum_type(['Windows', 'Linux']), help='operati' + 'ng system of target machines') + c.argument('update_configuration_windows', action=AddUpdateConfigurationWindows, nargs='+', help='Windows speci' + 'fic update configuration. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: included-' + 'update-classifications, excluded-kb-numbers, included-kb-numbers, reboot-setting.') + c.argument('update_configuration_linux', action=AddUpdateConfigurationLinux, nargs='+', help='Linux specific up' + 'date configuration. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: included-packag' + 'e-classifications, excluded-package-name-masks, included-package-name-masks, reboot-setting.') + c.argument('update_configuration_duration', help='Maximum time allowed for the software update configuration ru' + 'n. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601') + c.argument('update_configuration_azure_virtual_machines', nargs='+', help='List of azure resource Ids for azure' + ' virtual machines targeted by the software update configuration. Expected value: json-string/@json-' + 'file.') + c.argument('update_configuration_non_azure_computer_names', nargs='+', help='List of names of non-azure machine' + 's targeted by the software update configuration. Expected value: json-string/@json-file.') + c.argument('update_configuration_targets_azure_queries', arg_type=CLIArgumentType(options_list=['--update-confi' + 'guration-targets-azure-queries'], help='List of Azure queries in the software update configuration.' + ' Expected value: json-string/@json-file.')) + c.argument('update_configuration_targets_non_azure_queries', + action=AddUpdateConfigurationTargetsNonAzureQueries, nargs='+', help='List of non Azure queries in t' + 'he software update configuration. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: f' + 'unction-alias, workspace-id.') + + with self.argument_context('automation software-update-configuration delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('software_update_configuration_name', help='The name of the software update configuration to be crea' + 'ted.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation software-update-configuration-run list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('client_request_id', help='Identifies this specific client request.') + c.argument('filter', help='The filter to apply on the operation. You can use the following filters: \'propertie' + 's/osType\', \'properties/status\', \'properties/startTime\', and \'properties/softwareUpdateConfigu' + 'ration/name\'') + c.argument('skip', help='Number of entries you skip before returning results') + c.argument('top', help='Maximum number of entries returned in the results collection') + + with self.argument_context('automation software-update-configuration-run show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('software_update_configuration_run_id', help='The Id of the software update configuration run.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation software-update-configuration-machine-run list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('client_request_id', help='Identifies this specific client request.') + c.argument('filter', help='The filter to apply on the operation. You can use the following filters: \'propertie' + 's/osType\', \'properties/status\', \'properties/startTime\', and \'properties/softwareUpdateConfigu' + 'ration/name\'') + c.argument('skip', help='number of entries you skip before returning results') + c.argument('top', help='Maximum number of entries returned in the results collection') + + with self.argument_context('automation software-update-configuration-machine-run show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('software_update_configuration_machine_run_id', help='The Id of the software update configuration ma' + 'chine run.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation source-control list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation source-control show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('source_control_name', help='The name of source control.') + + with self.argument_context('automation source-control create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('source_control_name', help='The source control name.') + c.argument('repo_url', help='The repo url of the source control.') + c.argument('branch', + help='The repo branch of the source control. Include branch as empty string for VsoTfvc.') + c.argument('folder_path', help='The folder path of the source control. Path must be relative.') + c.argument('auto_sync', arg_type=get_three_state_flag(), help='The auto async of the source control. Default is' + ' false.') + c.argument('publish_runbook', arg_type=get_three_state_flag(), help='The auto publish of the source control. De' + 'fault is true.') + c.argument('source_type', arg_type=get_enum_type(['VsoGit', 'VsoTfvc', 'GitHub']), help='The source type. Must ' + 'be one of VsoGit, VsoTfvc, GitHub, case sensitive.') + c.argument('security_token', action=AddSecurityToken, nargs='+', help='The authorization token for the repo of ' + 'the source control. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: access-token, r' + 'efresh-token, token-type.') + c.argument('description', help='The user description of the source control.') + + with self.argument_context('automation source-control update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('source_control_name', help='The source control name.') + c.argument('branch', help='The repo branch of the source control.') + c.argument('folder_path', help='The folder path of the source control. Path must be relative.') + c.argument('auto_sync', arg_type=get_three_state_flag(), help='The auto sync of the source control. Default is ' + 'false.') + c.argument('publish_runbook', arg_type=get_three_state_flag(), help='The auto publish of the source control. De' + 'fault is true.') + c.argument('security_token', action=AddSecurityToken, nargs='+', help='The authorization token for the repo of ' + 'the source control. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: access-token, r' + 'efresh-token, token-type.') + c.argument('description', help='The user description of the source control.') + + with self.argument_context('automation source-control delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('source_control_name', help='The name of source control.') + + with self.argument_context('automation source-control-sync-job list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('source_control_name', help='The source control name.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation source-control-sync-job show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('source_control_name', help='The source control name.') + c.argument('source_control_sync_job_id', help='The source control sync job id.') + + with self.argument_context('automation source-control-sync-job create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('source_control_name', help='The source control name.') + c.argument('source_control_sync_job_id', help='The source control sync job id.') + c.argument('commit_id', help='The commit id of the source control sync job. If not syncing to a commitId, enter' + ' an empty string.') + + with self.argument_context('automation source-control-sync-job-stream list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('source_control_name', help='The source control name.') + c.argument('source_control_sync_job_id', help='The source control sync job id.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation source-control-sync-job-stream show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('source_control_name', help='The source control name.') + c.argument('source_control_sync_job_id', help='The source control sync job id.') + c.argument('stream_id', help='The id of the sync job stream.') + + with self.argument_context('automation job list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation job show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_name', help='The name of the job to be created.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation job create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_name', help='The job name.') + c.argument('client_request_id', help='Identifies this specific client request.') + c.argument('runbook', action=AddRunbook, nargs='+', help='Gets or sets the runbook. Expect value: name=xx.') + c.argument('parameters', action=AddJobParameters, nargs='+', help='Gets or sets the parameters of the job. Expe' + 'ct value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('run_on', help='Gets or sets the runOn which specifies the group name where the job is to be execute' + 'd.') + + with self.argument_context('automation job resume') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_name', help='The job name.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation job stop') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_name', help='The job name.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation job suspend') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_name', help='The job name.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation job-stream list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_name', help='The job name.') + c.argument('filter', help='The filter to apply on the operation.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation job-stream show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_name', help='The job name.') + c.argument('job_stream_id', help='The job stream id.') + c.argument('client_request_id', help='Identifies this specific client request.') + + with self.argument_context('automation agent-registration-information show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation agent-registration-information regenerate-key') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('key_name', arg_type=get_enum_type(['primary', 'secondary']), help='Gets or sets the agent registrat' + 'ion key name - primary or secondary.') + + with self.argument_context('automation dsc-node list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + c.argument('skip', help='The number of rows to skip.') + c.argument('top', help='The number of rows to take.') + c.argument('inlinecount', help='Return total rows.') + + with self.argument_context('automation dsc-node show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('node_id', help='The node id.') + + with self.argument_context('automation dsc-node update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('node_id', help='Parameters supplied to the update dsc node.') + c.argument('node_configuration_name', help='Gets or sets the name of the dsc node configuration.') + + with self.argument_context('automation dsc-node delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('node_id', help='The node id.') + + with self.argument_context('automation node-report list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('node_id', help='The parameters supplied to the list operation.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation node-report show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('node_id', help='The Dsc node id.') + c.argument('report_id', help='The report id.') + + with self.argument_context('automation dsc-compilation-job list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation dsc-compilation-job show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_id', help='The job id.') + c.argument('job_stream_id', help='The job stream id.') + c.argument('compilation_job_name', help='The DSC configuration Id.') + + with self.argument_context('automation dsc-compilation-job create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('compilation_job_name', help='The DSC configuration Id.') + c.argument('name', help='Gets or sets name of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('configuration', action=AddConfiguration, nargs='+', help='Gets or sets the configuration. Expect va' + 'lue: name=xx.') + c.argument('parameters', action=AddDsccompilationjobParameters, nargs='+', help='Gets or sets the parameters of' + ' the job. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('increment_node_configuration_build', arg_type=get_three_state_flag(), help='If a new build version ' + 'of NodeConfiguration is required.') + + with self.argument_context('automation dsc-compilation-job-stream list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('job_id', help='The job id.') + + with self.argument_context('automation dsc-node-configuration list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('filter', help='The filter to apply on the operation.') + c.argument('skip', help='The number of rows to skip.') + c.argument('top', help='The number of rows to take.') + c.argument('inlinecount', help='Return total rows.') + + with self.argument_context('automation dsc-node-configuration show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('node_configuration_name', help='The Dsc node configuration name.') + + with self.argument_context('automation dsc-node-configuration create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('node_configuration_name', help='The Dsc node configuration name.') + c.argument('name', help='Name of the node configuration.') + c.argument('tags', tags_type) + c.argument('source', arg_type=CLIArgumentType(options_list=['--source'], help='Gets or sets the source. Expecte' + 'd value: json-string/@json-file.')) + c.argument('configuration', action=AddConfiguration, nargs='+', help='Gets or sets the configuration of the nod' + 'e. Expect value: name=xx.') + c.argument('increment_node_configuration_build', arg_type=get_three_state_flag(), help='If a new build version ' + 'of NodeConfiguration is required.') + + with self.argument_context('automation dsc-node-configuration update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('node_configuration_name', help='The Dsc node configuration name.') + c.argument('name', help='Name of the node configuration.') + c.argument('tags', tags_type) + c.argument('source', arg_type=CLIArgumentType(options_list=['--source'], help='Gets or sets the source. Expecte' + 'd value: json-string/@json-file.')) + c.argument('configuration', action=AddConfiguration, nargs='+', help='Gets or sets the configuration of the nod' + 'e. Expect value: name=xx.') + c.argument('increment_node_configuration_build', arg_type=get_three_state_flag(), help='If a new build version ' + 'of NodeConfiguration is required.') + + with self.argument_context('automation dsc-node-configuration delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('node_configuration_name', help='The Dsc node configuration name.') + + with self.argument_context('automation node-count-information show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('count_type', arg_type=get_enum_type(['status', 'nodeconfiguration']), help='The type of counts to r' + 'etrieve') + + with self.argument_context('automation runbook-draft show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + + with self.argument_context('automation runbook-draft replace-content') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + c.argument('runbook_content', help='The runbook draft content.') + + with self.argument_context('automation runbook-draft undo-edit') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + + with self.argument_context('automation runbook list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation runbook show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + + with self.argument_context('automation runbook create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + c.argument('name', help='Gets or sets the name of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('log_verbose', arg_type=get_three_state_flag(), help='Gets or sets verbose log option.') + c.argument('log_progress', arg_type=get_three_state_flag(), help='Gets or sets progress log option.') + c.argument('runbook_type', arg_type=get_enum_type(['Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'Grap' + 'hPowerShellWorkflow', 'GraphPowerShell']), help='Gets or sets the type of the runbook.') + c.argument('draft', arg_type=CLIArgumentType(options_list=['--draft'], help='Gets or sets the draft runbook pro' + 'perties. Expected value: json-string/@json-file.')) + c.argument('publish_content_link', arg_type=CLIArgumentType(options_list=['--publish-content-link'], help='Gets' + ' or sets the published runbook content link. Expected value: json-string/@json-file.')) + c.argument('description', help='Gets or sets the description of the runbook.') + c.argument('log_activity_trace', help='Gets or sets the activity-level tracing options of the runbook.') + + with self.argument_context('automation runbook update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + c.argument('name', help='Gets or sets the name of the resource.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('description', help='Gets or sets the description of the runbook.') + c.argument('log_verbose', arg_type=get_three_state_flag(), help='Gets or sets verbose log option.') + c.argument('log_progress', arg_type=get_three_state_flag(), help='Gets or sets progress log option.') + c.argument('log_activity_trace', help='Gets or sets the activity-level tracing options of the runbook.') + + with self.argument_context('automation runbook delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + + with self.argument_context('automation runbook publish') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The parameters supplied to the publish runbook operation.') + + with self.argument_context('automation test-job-stream list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + c.argument('filter', help='The filter to apply on the operation.') + + with self.argument_context('automation test-job-stream show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + c.argument('job_stream_id', help='The job stream id.') + + with self.argument_context('automation test-job show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + + with self.argument_context('automation test-job create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The parameters supplied to the create test job operation.') + c.argument('parameters', action=AddTestjobParameters, nargs='+', help='Gets or sets the parameters of the test ' + 'job. Expect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('run_on', help='Gets or sets the runOn which specifies the group name where the job is to be execute' + 'd.') + + with self.argument_context('automation test-job resume') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + + with self.argument_context('automation test-job stop') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + + with self.argument_context('automation test-job suspend') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('runbook_name', help='The runbook name.') + + with self.argument_context('automation python2-package list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + + with self.argument_context('automation python2-package show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('package_name', help='The python package name.') + + with self.argument_context('automation python2-package create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('package_name', help='The name of python package.') + c.argument('tags', tags_type) + c.argument('content_link', arg_type=CLIArgumentType(options_list=['--content-link'], help='Gets or sets the mod' + 'ule content link. Expected value: json-string/@json-file.')) + + with self.argument_context('automation python2-package update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('package_name', help='The name of python package.') + c.argument('tags', tags_type) + + with self.argument_context('automation python2-package delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('automation_account_name', help='The name of the automation account.') + c.argument('package_name', help='The python package name.') diff --git a/src/automation/azext_automation/generated/_validators.py b/src/automation/azext_automation/generated/_validators.py new file mode 100644 index 00000000000..7536d0531ea --- /dev/null +++ b/src/automation/azext_automation/generated/_validators.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + + +def example_name_or_id_validator(cmd, namespace): + from azure.cli.core.commands.client_factory import get_subscription_id + from msrestazure.tools import is_valid_resource_id, resource_id + if namespace.storage_account: + if not is_valid_resource_id(namespace.RESOURCE): + namespace.storage_account = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Storage', + type='storageAccounts', + name=namespace.storage_account + ) diff --git a/src/automation/azext_automation/generated/action.py b/src/automation/azext_automation/generated/action.py new file mode 100644 index 00000000000..ff5a175ac9d --- /dev/null +++ b/src/automation/azext_automation/generated/action.py @@ -0,0 +1,514 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from knack.util import CLIError +from collections import defaultdict + + +class AddSku(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sku = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + elif kl == 'family': + d['family'] = v[0] + elif kl == 'capacity': + d['capacity'] = v[0] + return d + + +class AddConnectionType(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.connection_type = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + return d + + +class AddAutomationConnectionCreateFieldDefinitionValues(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.field_definition_values = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + d[k] = v + return d + + +class AddAutomationConnectionUpdateFieldDefinitionValues(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.field_definition_values = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + d[k] = v + return d + + +class AddCredential(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.credential = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + return d + + +class AddSchedule(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.schedule = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + return d + + +class AddRunbook(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.runbook = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + return d + + +class AddJobscheduleParameters(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.parameters = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + d[k] = v + return d + + +class AddAdvancedScheduleMonthlyOccurrences(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddAdvancedScheduleMonthlyOccurrences, self).__call__(parser, namespace, action, option_string) + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'occurrence': + d['occurrence'] = v[0] + elif kl == 'day': + d['day'] = v[0] + return d + + +class AddWebhookParameters(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.parameters = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + d[k] = v + return d + + +class AddScriptParameters(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.script_parameters = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + d[k] = v + return d + + +class AddError(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.error = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'code': + d['code'] = v[0] + elif kl == 'message': + d['message'] = v[0] + return d + + +class AddTasksPostTaskParameters(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.tasks_post_task_parameters = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + d[k] = v + return d + + +class AddUpdateConfigurationWindows(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.update_configuration_windows = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'included-update-classifications': + d['included_update_classifications'] = v[0] + elif kl == 'excluded-kb-numbers': + d['excluded_kb_numbers'] = v + elif kl == 'included-kb-numbers': + d['included_kb_numbers'] = v + elif kl == 'reboot-setting': + d['reboot_setting'] = v[0] + return d + + +class AddUpdateConfigurationLinux(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.update_configuration_linux = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'included-package-classifications': + d['included_package_classifications'] = v[0] + elif kl == 'excluded-package-name-masks': + d['excluded_package_name_masks'] = v + elif kl == 'included-package-name-masks': + d['included_package_name_masks'] = v + elif kl == 'reboot-setting': + d['reboot_setting'] = v[0] + return d + + +class AddUpdateConfigurationTargetsNonAzureQueries(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddUpdateConfigurationTargetsNonAzureQueries, self).__call__(parser, namespace, action, option_string) + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'function-alias': + d['function_alias'] = v[0] + elif kl == 'workspace-id': + d['workspace_id'] = v[0] + return d + + +class AddSecurityToken(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.security_token = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'access-token': + d['access_token'] = v[0] + elif kl == 'refresh-token': + d['refresh_token'] = v[0] + elif kl == 'token-type': + d['token_type'] = v[0] + return d + + +class AddJobParameters(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.parameters = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + d[k] = v + return d + + +class AddConfiguration(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.configuration = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + return d + + +class AddDsccompilationjobParameters(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.parameters = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + d[k] = v + return d + + +class AddTestjobParameters(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.parameters = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + d[k] = v + return d diff --git a/src/automation/azext_automation/generated/commands.py b/src/automation/azext_automation/generated/commands.py new file mode 100644 index 00000000000..ec45b14e709 --- /dev/null +++ b/src/automation/azext_automation/generated/commands.py @@ -0,0 +1,468 @@ +# -------------------------------------------------------------------------- +# 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 azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_automation.generated._client_factory import cf_automation_account + automation_automation_account = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._automation_account_operations#Automation' + 'AccountOperations.{}', + client_factory=cf_automation_account) + with self.command_group('automation automation-account', automation_automation_account, + client_factory=cf_automation_account, is_experimental=True) as g: + g.custom_command('list', 'automation_automation_account_list') + g.custom_show_command('show', 'automation_automation_account_show') + g.custom_command('create', 'automation_automation_account_create') + g.custom_command('update', 'automation_automation_account_update') + g.custom_command('delete', 'automation_automation_account_delete') + + from azext_automation.generated._client_factory import cf_statistics + automation_statistics = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._statistics_operations#StatisticsOperatio' + 'ns.{}', + client_factory=cf_statistics) + with self.command_group('automation statistics', automation_statistics, client_factory=cf_statistics, + is_experimental=True) as g: + g.custom_command('list', 'automation_statistics_list') + + from azext_automation.generated._client_factory import cf_usage + automation_usage = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._usage_operations#UsageOperations.{}', + client_factory=cf_usage) + with self.command_group('automation usage', automation_usage, client_factory=cf_usage, is_experimental=True) as g: + g.custom_command('list', 'automation_usage_list') + + from azext_automation.generated._client_factory import cf_key + automation_key = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._key_operations#KeyOperations.{}', + client_factory=cf_key) + with self.command_group('automation key', automation_key, client_factory=cf_key, is_experimental=True) as g: + g.custom_command('list-by-automation-account', 'automation_key_list_by_automation_account') + + from azext_automation.generated._client_factory import cf_certificate + automation_certificate = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._certificate_operations#CertificateOperat' + 'ions.{}', + client_factory=cf_certificate) + with self.command_group('automation certificate', automation_certificate, client_factory=cf_certificate, + is_experimental=True) as g: + g.custom_command('list', 'automation_certificate_list') + g.custom_show_command('show', 'automation_certificate_show') + g.custom_command('create', 'automation_certificate_create') + g.custom_command('update', 'automation_certificate_update') + g.custom_command('delete', 'automation_certificate_delete') + + from azext_automation.generated._client_factory import cf_connection + automation_connection = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._connection_operations#ConnectionOperatio' + 'ns.{}', + client_factory=cf_connection) + with self.command_group('automation connection', automation_connection, client_factory=cf_connection, + is_experimental=True) as g: + g.custom_command('list', 'automation_connection_list') + g.custom_show_command('show', 'automation_connection_show') + g.custom_command('create', 'automation_connection_create') + g.custom_command('update', 'automation_connection_update') + g.custom_command('delete', 'automation_connection_delete') + + from azext_automation.generated._client_factory import cf_connection_type + automation_connection_type = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._connection_type_operations#ConnectionTyp' + 'eOperations.{}', + client_factory=cf_connection_type) + with self.command_group('automation connection-type', automation_connection_type, + client_factory=cf_connection_type, is_experimental=True) as g: + g.custom_command('list', 'automation_connection_type_list') + g.custom_show_command('show', 'automation_connection_type_show') + g.custom_command('create', 'automation_connection_type_create') + g.generic_update_command('update', setter_arg_name = 'field_definitions', custom_func_name = 'automation_connec' + 'tion_type_update') + g.custom_command('delete', 'automation_connection_type_delete') + + from azext_automation.generated._client_factory import cf_credential + automation_credential = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._credential_operations#CredentialOperatio' + 'ns.{}', + client_factory=cf_credential) + with self.command_group('automation credential', automation_credential, client_factory=cf_credential, + is_experimental=True) as g: + g.custom_command('list', 'automation_credential_list') + g.custom_show_command('show', 'automation_credential_show') + g.custom_command('create', 'automation_credential_create') + g.custom_command('update', 'automation_credential_update') + g.custom_command('delete', 'automation_credential_delete') + + from azext_automation.generated._client_factory import cf_dsc_configuration + automation_dsc_configuration = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._dsc_configuration_operations#DscConfigur' + 'ationOperations.{}', + client_factory=cf_dsc_configuration) + with self.command_group('automation dsc-configuration', automation_dsc_configuration, + client_factory=cf_dsc_configuration, is_experimental=True) as g: + g.custom_command('list', 'automation_dsc_configuration_list') + g.custom_show_command('show', 'automation_dsc_configuration_show') + g.custom_command('create', 'automation_dsc_configuration_create') + g.custom_command('update', 'automation_dsc_configuration_update') + g.custom_command('delete', 'automation_dsc_configuration_delete') + + from azext_automation.generated._client_factory import cf_hybrid_runbook_worker_group + automation_hybrid_runbook_worker_group = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._hybrid_runbook_worker_group_operations#H' + 'ybridRunbookWorkerGroupOperations.{}', + client_factory=cf_hybrid_runbook_worker_group) + with self.command_group('automation hybrid-runbook-worker-group', automation_hybrid_runbook_worker_group, + client_factory=cf_hybrid_runbook_worker_group, is_experimental=True) as g: + g.custom_command('list', 'automation_hybrid_runbook_worker_group_list') + g.custom_show_command('show', 'automation_hybrid_runbook_worker_group_show') + g.custom_command('update', 'automation_hybrid_runbook_worker_group_update') + g.custom_command('delete', 'automation_hybrid_runbook_worker_group_delete') + + from azext_automation.generated._client_factory import cf_job_schedule + automation_job_schedule = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._job_schedule_operations#JobScheduleOpera' + 'tions.{}', + client_factory=cf_job_schedule) + with self.command_group('automation job-schedule', automation_job_schedule, client_factory=cf_job_schedule, + is_experimental=True) as g: + g.custom_command('list', 'automation_job_schedule_list') + g.custom_show_command('show', 'automation_job_schedule_show') + g.custom_command('create', 'automation_job_schedule_create') + g.custom_command('delete', 'automation_job_schedule_delete') + + from azext_automation.generated._client_factory import cf_linked_workspace + automation_linked_workspace = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._linked_workspace_operations#LinkedWorksp' + 'aceOperations.{}', + client_factory=cf_linked_workspace) + with self.command_group('automation linked-workspace', automation_linked_workspace, + client_factory=cf_linked_workspace, is_experimental=True) as g: + g.custom_show_command('show', 'automation_linked_workspace_show') + + from azext_automation.generated._client_factory import cf_activity + automation_activity = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._activity_operations#ActivityOperations.{' + '}', + client_factory=cf_activity) + with self.command_group('automation activity', automation_activity, client_factory=cf_activity, + is_experimental=True) as g: + g.custom_command('list', 'automation_activity_list') + g.custom_show_command('show', 'automation_activity_show') + + from azext_automation.generated._client_factory import cf_module + automation_module = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._module_operations#ModuleOperations.{}', + client_factory=cf_module) + with self.command_group('automation module', automation_module, client_factory=cf_module, + is_experimental=True) as g: + g.custom_command('list', 'automation_module_list') + g.custom_show_command('show', 'automation_module_show') + g.custom_command('create', 'automation_module_create') + g.custom_command('update', 'automation_module_update') + g.custom_command('delete', 'automation_module_delete') + + from azext_automation.generated._client_factory import cf_object_data_type + automation_object_data_type = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._object_data_type_operations#ObjectDataTy' + 'peOperations.{}', + client_factory=cf_object_data_type) + with self.command_group('automation object-data-type', automation_object_data_type, + client_factory=cf_object_data_type, is_experimental=True) as g: + g.custom_command('list-field', 'automation_object_data_type_list_field') + + from azext_automation.generated._client_factory import cf_field + automation_field = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._field_operations#FieldOperations.{}', + client_factory=cf_field) + with self.command_group('automation field', automation_field, client_factory=cf_field, is_experimental=True) as g: + g.custom_command('list', 'automation_field_list') + + from azext_automation.generated._client_factory import cf_schedule + automation_schedule = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._schedule_operations#ScheduleOperations.{' + '}', + client_factory=cf_schedule) + with self.command_group('automation schedule', automation_schedule, client_factory=cf_schedule, + is_experimental=True) as g: + g.custom_command('list', 'automation_schedule_list') + g.custom_show_command('show', 'automation_schedule_show') + g.custom_command('create', 'automation_schedule_create') + g.custom_command('update', 'automation_schedule_update') + g.custom_command('delete', 'automation_schedule_delete') + + from azext_automation.generated._client_factory import cf_variable + automation_variable = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._variable_operations#VariableOperations.{' + '}', + client_factory=cf_variable) + with self.command_group('automation variable', automation_variable, client_factory=cf_variable, + is_experimental=True) as g: + g.custom_command('list', 'automation_variable_list') + g.custom_show_command('show', 'automation_variable_show') + g.custom_command('create', 'automation_variable_create') + g.custom_command('update', 'automation_variable_update') + g.custom_command('delete', 'automation_variable_delete') + + from azext_automation.generated._client_factory import cf_webhook + automation_webhook = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._webhook_operations#WebhookOperations.{}', + client_factory=cf_webhook) + with self.command_group('automation webhook', automation_webhook, client_factory=cf_webhook, + is_experimental=True) as g: + g.custom_command('list', 'automation_webhook_list') + g.custom_show_command('show', 'automation_webhook_show') + g.custom_command('create', 'automation_webhook_create') + g.custom_command('update', 'automation_webhook_update') + g.custom_command('delete', 'automation_webhook_delete') + g.custom_command('generate-uri', 'automation_webhook_generate_uri') + + from azext_automation.generated._client_factory import cf_watcher + automation_watcher = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._watcher_operations#WatcherOperations.{}', + client_factory=cf_watcher) + with self.command_group('automation watcher', automation_watcher, client_factory=cf_watcher, + is_experimental=True) as g: + g.custom_command('list', 'automation_watcher_list') + g.custom_show_command('show', 'automation_watcher_show') + g.custom_command('create', 'automation_watcher_create') + g.custom_command('update', 'automation_watcher_update') + g.custom_command('delete', 'automation_watcher_delete') + g.custom_command('start', 'automation_watcher_start') + g.custom_command('stop', 'automation_watcher_stop') + + from azext_automation.generated._client_factory import cf_software_update_configuration + automation_software_update_configuration = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._software_update_configuration_operations' + '#SoftwareUpdateConfigurationOperations.{}', + client_factory=cf_software_update_configuration) + with self.command_group('automation software-update-configuration', automation_software_update_configuration, + client_factory=cf_software_update_configuration, is_experimental=True) as g: + g.custom_command('list', 'automation_software_update_configuration_list') + g.custom_show_command('show', 'automation_software_update_configuration_show') + g.custom_command('create', 'automation_software_update_configuration_create') + g.custom_command('delete', 'automation_software_update_configuration_delete') + + from azext_automation.generated._client_factory import cf_software_update_configuration_run + automation_software_update_configuration_run = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._software_update_configuration_run_operat' + 'ions#SoftwareUpdateConfigurationRunOperations.{}', + client_factory=cf_software_update_configuration_run) + with self.command_group('automation software-update-configuration-run', + automation_software_update_configuration_run, + client_factory=cf_software_update_configuration_run, is_experimental=True) as g: + g.custom_command('list', 'automation_software_update_configuration_run_list') + g.custom_show_command('show', 'automation_software_update_configuration_run_show') + + from azext_automation.generated._client_factory import cf_software_update_configuration_machine_run + automation_software_update_configuration_machine_run = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._software_update_configuration_machine_ru' + 'n_operations#SoftwareUpdateConfigurationMachineRunOperations.{}', + client_factory=cf_software_update_configuration_machine_run) + with self.command_group('automation software-update-configuration-machine-run', + automation_software_update_configuration_machine_run, + client_factory=cf_software_update_configuration_machine_run, is_experimental=True) as g: + g.custom_command('list', 'automation_software_update_configuration_machine_run_list') + g.custom_show_command('show', 'automation_software_update_configuration_machine_run_show') + + from azext_automation.generated._client_factory import cf_source_control + automation_source_control = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._source_control_operations#SourceControlO' + 'perations.{}', + client_factory=cf_source_control) + with self.command_group('automation source-control', automation_source_control, client_factory=cf_source_control, + is_experimental=True) as g: + g.custom_command('list', 'automation_source_control_list') + g.custom_show_command('show', 'automation_source_control_show') + g.custom_command('create', 'automation_source_control_create') + g.custom_command('update', 'automation_source_control_update') + g.custom_command('delete', 'automation_source_control_delete') + + from azext_automation.generated._client_factory import cf_source_control_sync_job + automation_source_control_sync_job = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._source_control_sync_job_operations#Sourc' + 'eControlSyncJobOperations.{}', + client_factory=cf_source_control_sync_job) + with self.command_group('automation source-control-sync-job', automation_source_control_sync_job, + client_factory=cf_source_control_sync_job, is_experimental=True) as g: + g.custom_command('list', 'automation_source_control_sync_job_list') + g.custom_show_command('show', 'automation_source_control_sync_job_show') + g.custom_command('create', 'automation_source_control_sync_job_create') + + from azext_automation.generated._client_factory import cf_source_control_sync_job_stream + automation_source_control_sync_job_stream = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._source_control_sync_job_stream_operation' + 's#SourceControlSyncJobStreamOperations.{}', + client_factory=cf_source_control_sync_job_stream) + with self.command_group('automation source-control-sync-job-stream', automation_source_control_sync_job_stream, + client_factory=cf_source_control_sync_job_stream, is_experimental=True) as g: + g.custom_command('list', 'automation_source_control_sync_job_stream_list') + g.custom_show_command('show', 'automation_source_control_sync_job_stream_show') + + from azext_automation.generated._client_factory import cf_job + automation_job = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._job_operations#JobOperations.{}', + client_factory=cf_job) + with self.command_group('automation job', automation_job, client_factory=cf_job, is_experimental=True) as g: + g.custom_command('list', 'automation_job_list') + g.custom_show_command('show', 'automation_job_show') + g.custom_command('create', 'automation_job_create') + g.custom_command('resume', 'automation_job_resume') + g.custom_command('stop', 'automation_job_stop') + g.custom_command('suspend', 'automation_job_suspend') + + from azext_automation.generated._client_factory import cf_job_stream + automation_job_stream = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._job_stream_operations#JobStreamOperation' + 's.{}', + client_factory=cf_job_stream) + with self.command_group('automation job-stream', automation_job_stream, client_factory=cf_job_stream, + is_experimental=True) as g: + g.custom_command('list', 'automation_job_stream_list') + g.custom_show_command('show', 'automation_job_stream_show') + + from azext_automation.generated._client_factory import cf_agent_registration_information + automation_agent_registration_information = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._agent_registration_information_operation' + 's#AgentRegistrationInformationOperations.{}', + client_factory=cf_agent_registration_information) + with self.command_group('automation agent-registration-information', automation_agent_registration_information, + client_factory=cf_agent_registration_information, is_experimental=True) as g: + g.custom_show_command('show', 'automation_agent_registration_information_show') + g.custom_command('regenerate-key', 'automation_agent_registration_information_regenerate_key') + + from azext_automation.generated._client_factory import cf_dsc_node + automation_dsc_node = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._dsc_node_operations#DscNodeOperations.{}' + '', + client_factory=cf_dsc_node) + with self.command_group('automation dsc-node', automation_dsc_node, client_factory=cf_dsc_node, + is_experimental=True) as g: + g.custom_command('list', 'automation_dsc_node_list') + g.custom_show_command('show', 'automation_dsc_node_show') + g.custom_command('update', 'automation_dsc_node_update') + g.custom_command('delete', 'automation_dsc_node_delete') + + from azext_automation.generated._client_factory import cf_node_report + automation_node_report = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._node_report_operations#NodeReportOperati' + 'ons.{}', + client_factory=cf_node_report) + with self.command_group('automation node-report', automation_node_report, client_factory=cf_node_report, + is_experimental=True) as g: + g.custom_command('list', 'automation_node_report_list') + g.custom_show_command('show', 'automation_node_report_show') + + from azext_automation.generated._client_factory import cf_dsc_compilation_job + automation_dsc_compilation_job = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._dsc_compilation_job_operations#DscCompil' + 'ationJobOperations.{}', + client_factory=cf_dsc_compilation_job) + with self.command_group('automation dsc-compilation-job', automation_dsc_compilation_job, + client_factory=cf_dsc_compilation_job, is_experimental=True) as g: + g.custom_command('list', 'automation_dsc_compilation_job_list') + g.custom_show_command('show', 'automation_dsc_compilation_job_show') + g.custom_command('create', 'automation_dsc_compilation_job_create', supports_no_wait=True) + g.wait_command('wait') + + from azext_automation.generated._client_factory import cf_dsc_compilation_job_stream + automation_dsc_compilation_job_stream = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._dsc_compilation_job_stream_operations#Ds' + 'cCompilationJobStreamOperations.{}', + client_factory=cf_dsc_compilation_job_stream) + with self.command_group('automation dsc-compilation-job-stream', automation_dsc_compilation_job_stream, + client_factory=cf_dsc_compilation_job_stream, is_experimental=True) as g: + g.custom_command('list', 'automation_dsc_compilation_job_stream_list') + + from azext_automation.generated._client_factory import cf_dsc_node_configuration + automation_dsc_node_configuration = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._dsc_node_configuration_operations#DscNod' + 'eConfigurationOperations.{}', + client_factory=cf_dsc_node_configuration) + with self.command_group('automation dsc-node-configuration', automation_dsc_node_configuration, + client_factory=cf_dsc_node_configuration, is_experimental=True) as g: + g.custom_command('list', 'automation_dsc_node_configuration_list') + g.custom_show_command('show', 'automation_dsc_node_configuration_show') + g.custom_command('create', 'automation_dsc_node_configuration_create', supports_no_wait=True) + g.custom_command('update', 'automation_dsc_node_configuration_update', supports_no_wait=True) + g.custom_command('delete', 'automation_dsc_node_configuration_delete') + g.wait_command('wait') + + from azext_automation.generated._client_factory import cf_node_count_information + automation_node_count_information = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._node_count_information_operations#NodeCo' + 'untInformationOperations.{}', + client_factory=cf_node_count_information) + with self.command_group('automation node-count-information', automation_node_count_information, + client_factory=cf_node_count_information, is_experimental=True) as g: + g.custom_show_command('show', 'automation_node_count_information_show') + + from azext_automation.generated._client_factory import cf_runbook_draft + automation_runbook_draft = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._runbook_draft_operations#RunbookDraftOpe' + 'rations.{}', + client_factory=cf_runbook_draft) + with self.command_group('automation runbook-draft', automation_runbook_draft, client_factory=cf_runbook_draft, + is_experimental=True) as g: + g.custom_show_command('show', 'automation_runbook_draft_show') + g.custom_command('replace-content', 'automation_runbook_draft_replace_content', supports_no_wait=True) + g.custom_command('undo-edit', 'automation_runbook_draft_undo_edit') + g.wait_command('wait') + + from azext_automation.generated._client_factory import cf_runbook + automation_runbook = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._runbook_operations#RunbookOperations.{}', + client_factory=cf_runbook) + with self.command_group('automation runbook', automation_runbook, client_factory=cf_runbook, + is_experimental=True) as g: + g.custom_command('list', 'automation_runbook_list') + g.custom_show_command('show', 'automation_runbook_show') + g.custom_command('create', 'automation_runbook_create') + g.custom_command('update', 'automation_runbook_update') + g.custom_command('delete', 'automation_runbook_delete') + g.custom_command('publish', 'automation_runbook_publish', supports_no_wait=True) + g.wait_command('wait') + + from azext_automation.generated._client_factory import cf_test_job_stream + automation_test_job_stream = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._test_job_stream_operations#TestJobStream' + 'Operations.{}', + client_factory=cf_test_job_stream) + with self.command_group('automation test-job-stream', automation_test_job_stream, + client_factory=cf_test_job_stream, is_experimental=True) as g: + g.custom_command('list', 'automation_test_job_stream_list') + g.custom_show_command('show', 'automation_test_job_stream_show') + + from azext_automation.generated._client_factory import cf_test_job + automation_test_job = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._test_job_operations#TestJobOperations.{}' + '', + client_factory=cf_test_job) + with self.command_group('automation test-job', automation_test_job, client_factory=cf_test_job, + is_experimental=True) as g: + g.custom_show_command('show', 'automation_test_job_show') + g.custom_command('create', 'automation_test_job_create') + g.custom_command('resume', 'automation_test_job_resume') + g.custom_command('stop', 'automation_test_job_stop') + g.custom_command('suspend', 'automation_test_job_suspend') + + from azext_automation.generated._client_factory import cf_python2package + automation_python2package = CliCommandType( + operations_tmpl='azext_automation.vendored_sdks.automation.operations._python2_package_operations#Python2Packag' + 'eOperations.{}', + client_factory=cf_python2package) + with self.command_group('automation python2-package', automation_python2package, client_factory=cf_python2package, + is_experimental=True) as g: + g.custom_command('list', 'automation_python2_package_list') + g.custom_show_command('show', 'automation_python2_package_show') + g.custom_command('create', 'automation_python2_package_create') + g.custom_command('update', 'automation_python2_package_update') + g.custom_command('delete', 'automation_python2_package_delete') diff --git a/src/automation/azext_automation/generated/custom.py b/src/automation/azext_automation/generated/custom.py new file mode 100644 index 00000000000..d8bf5e3fb16 --- /dev/null +++ b/src/automation/azext_automation/generated/custom.py @@ -0,0 +1,1776 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +import json + + +def automation_automation_account_list(cmd, client, + resource_group_name=None): + if resource_group_name is not None: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list() + + +def automation_automation_account_show(cmd, client, + resource_group_name, + automation_account_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_automation_account_create(cmd, client, + resource_group_name, + automation_account_name, + name=None, + location=None, + tags=None, + sku=None): + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + name=name, + location=location, + tags=tags, + sku=sku) + + +def automation_automation_account_update(cmd, client, + resource_group_name, + automation_account_name, + name=None, + location=None, + tags=None, + sku=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + name=name, + location=location, + tags=tags, + sku=sku) + + +def automation_automation_account_delete(cmd, client, + resource_group_name, + automation_account_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_statistics_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter) + + +def automation_usage_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_key_list_by_automation_account(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_certificate_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_certificate_show(cmd, client, + resource_group_name, + automation_account_name, + certificate_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + certificate_name=certificate_name) + + +def automation_certificate_create(cmd, client, + resource_group_name, + automation_account_name, + certificate_name, + name, + base64value, + description=None, + thumbprint=None, + is_exportable=None): + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + certificate_name=certificate_name, + name=name, + base64_value=base64value, + description=description, + thumbprint=thumbprint, + is_exportable=is_exportable) + + +def automation_certificate_update(cmd, client, + resource_group_name, + automation_account_name, + certificate_name, + name=None, + description=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + certificate_name=certificate_name, + name=name, + description=description) + + +def automation_certificate_delete(cmd, client, + resource_group_name, + automation_account_name, + certificate_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + certificate_name=certificate_name) + + +def automation_connection_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_connection_show(cmd, client, + resource_group_name, + automation_account_name, + connection_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + connection_name=connection_name) + + +def automation_connection_create(cmd, client, + resource_group_name, + automation_account_name, + connection_name, + name, + connection_type, + description=None, + field_definition_values=None): + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + connection_name=connection_name, + name=name, + description=description, + connection_type=connection_type, + field_definition_values=field_definition_values) + + +def automation_connection_update(cmd, client, + resource_group_name, + automation_account_name, + connection_name, + name=None, + description=None, + field_definition_values=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + connection_name=connection_name, + name=name, + description=description, + field_definition_values=field_definition_values) + + +def automation_connection_delete(cmd, client, + resource_group_name, + automation_account_name, + connection_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + connection_name=connection_name) + + +def automation_connection_type_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_connection_type_show(cmd, client, + resource_group_name, + automation_account_name, + connection_type_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + connection_type_name=connection_type_name) + + +def automation_connection_type_create(cmd, client, + resource_group_name, + automation_account_name, + connection_type_name, + name, + field_definitions, + is_global=None): + if isinstance(field_definitions, str): + field_definitions = json.loads(field_definitions) + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + connection_type_name=connection_type_name, + name=name, + is_global=is_global, + field_definitions=field_definitions) + + +def automation_connection_type_update(instance, cmd, + resource_group_name, + automation_account_name, + connection_type_name, + name, + field_definitions, + is_global=None): + if isinstance(field_definitions, str): + field_definitions = json.loads(field_definitions) + return instance + + +def automation_connection_type_delete(cmd, client, + resource_group_name, + automation_account_name, + connection_type_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + connection_type_name=connection_type_name) + + +def automation_credential_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_credential_show(cmd, client, + resource_group_name, + automation_account_name, + credential_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + credential_name=credential_name) + + +def automation_credential_create(cmd, client, + resource_group_name, + automation_account_name, + credential_name, + name, + user_name, + password, + description=None): + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + credential_name=credential_name, + name=name, + user_name=user_name, + password=password, + description=description) + + +def automation_credential_update(cmd, client, + resource_group_name, + automation_account_name, + credential_name, + name=None, + user_name=None, + password=None, + description=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + credential_name=credential_name, + name=name, + user_name=user_name, + password=password, + description=description) + + +def automation_credential_delete(cmd, client, + resource_group_name, + automation_account_name, + credential_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + credential_name=credential_name) + + +def automation_dsc_configuration_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None, + skip=None, + top=None, + inlinecount=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter, + skip=skip, + top=top, + inlinecount=inlinecount) + + +def automation_dsc_configuration_show(cmd, client, + resource_group_name, + automation_account_name, + configuration_name): + if resource_group_name is not None and automation_account_name is not None and configuration_name is not None: + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + configuration_name=configuration_name) + return client.get_content(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + configuration_name=configuration_name) + + +def automation_dsc_configuration_create(cmd, client, + resource_group_name, + automation_account_name, + configuration_name, + source, + name=None, + location=None, + tags=None, + log_verbose=None, + log_progress=None, + parameters=None, + description=None): + if isinstance(source, str): + source = json.loads(source) + if isinstance(parameters, str): + parameters = json.loads(parameters) + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + configuration_name=configuration_name, + name=name, + location=location, + tags=tags, + log_verbose=log_verbose, + log_progress=log_progress, + source=source, + parameters=parameters, + description=description) + + +def automation_dsc_configuration_update(cmd, client, + resource_group_name, + automation_account_name, + configuration_name, + name=None, + tags=None, + log_verbose=None, + log_progress=None, + source=None, + parameters=None, + description=None): + if isinstance(source, str): + source = json.loads(source) + if isinstance(parameters, str): + parameters = json.loads(parameters) + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + configuration_name=configuration_name, + name=name, + tags=tags, + log_verbose=log_verbose, + log_progress=log_progress, + source=source, + parameters=parameters, + description=description) + + +def automation_dsc_configuration_delete(cmd, client, + resource_group_name, + automation_account_name, + configuration_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + configuration_name=configuration_name) + + +def automation_hybrid_runbook_worker_group_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter) + + +def automation_hybrid_runbook_worker_group_show(cmd, client, + resource_group_name, + automation_account_name, + hybrid_runbook_worker_group_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + hybrid_runbook_worker_group_name=hybrid_runbook_worker_group_name) + + +def automation_hybrid_runbook_worker_group_update(cmd, client, + resource_group_name, + automation_account_name, + hybrid_runbook_worker_group_name, + credential=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + hybrid_runbook_worker_group_name=hybrid_runbook_worker_group_name, + credential=credential) + + +def automation_hybrid_runbook_worker_group_delete(cmd, client, + resource_group_name, + automation_account_name, + hybrid_runbook_worker_group_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + hybrid_runbook_worker_group_name=hybrid_runbook_worker_group_name) + + +def automation_job_schedule_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter) + + +def automation_job_schedule_show(cmd, client, + resource_group_name, + automation_account_name, + job_schedule_id): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_schedule_id=job_schedule_id) + + +def automation_job_schedule_create(cmd, client, + resource_group_name, + automation_account_name, + job_schedule_id, + schedule, + runbook, + run_on=None, + parameters=None): + return client.create(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_schedule_id=job_schedule_id, + schedule=schedule, + runbook=runbook, + run_on=run_on, + parameters=parameters) + + +def automation_job_schedule_delete(cmd, client, + resource_group_name, + automation_account_name, + job_schedule_id): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_schedule_id=job_schedule_id) + + +def automation_linked_workspace_show(cmd, client, + resource_group_name, + automation_account_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_activity_list(cmd, client, + resource_group_name, + automation_account_name, + module_name): + return client.list_by_module(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + module_name=module_name) + + +def automation_activity_show(cmd, client, + resource_group_name, + automation_account_name, + module_name, + activity_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + module_name=module_name, + activity_name=activity_name) + + +def automation_module_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_module_show(cmd, client, + resource_group_name, + automation_account_name, + module_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + module_name=module_name) + + +def automation_module_create(cmd, client, + resource_group_name, + automation_account_name, + module_name, + content_link, + name=None, + location=None, + tags=None): + if isinstance(content_link, str): + content_link = json.loads(content_link) + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + module_name=module_name, + name=name, + location=location, + tags=tags, + content_link=content_link) + + +def automation_module_update(cmd, client, + resource_group_name, + automation_account_name, + module_name, + name=None, + location=None, + tags=None, + content_link=None): + if isinstance(content_link, str): + content_link = json.loads(content_link) + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + module_name=module_name, + name=name, + location=location, + tags=tags, + content_link=content_link) + + +def automation_module_delete(cmd, client, + resource_group_name, + automation_account_name, + module_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + module_name=module_name) + + +def automation_object_data_type_list_field(cmd, client, + resource_group_name, + automation_account_name, + type_name, + module_name=None): + if resource_group_name is not None and automation_account_name is not None and module_name is not None and type_name is not None: + return client.list_field_by_module_and_type(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + module_name=module_name, + type_name=type_name) + return client.list_field_by_type(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + type_name=type_name) + + +def automation_field_list(cmd, client, + resource_group_name, + automation_account_name, + module_name, + type_name): + return client.list_by_type(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + module_name=module_name, + type_name=type_name) + + +def automation_schedule_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_schedule_show(cmd, client, + resource_group_name, + automation_account_name, + schedule_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + schedule_name=schedule_name) + + +def automation_schedule_create(cmd, client, + resource_group_name, + automation_account_name, + schedule_name, + name, + start_time, + frequency, + description=None, + expiry_time=None, + interval=None, + time_zone=None, + advanced_schedule_week_days=None, + advanced_schedule_month_days=None, + advanced_schedule_monthly_occurrences=None): + if isinstance(interval, str): + interval = json.loads(interval) + if isinstance(advanced_schedule_week_days, str): + advanced_schedule_week_days = json.loads(advanced_schedule_week_days) + if isinstance(advanced_schedule_month_days, str): + advanced_schedule_month_days = json.loads(advanced_schedule_month_days) + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + schedule_name=schedule_name, + name=name, + description=description, + start_time=start_time, + expiry_time=expiry_time, + interval=interval, + frequency=frequency, + time_zone=time_zone, + week_days=advanced_schedule_week_days, + month_days=advanced_schedule_month_days, + monthly_occurrences=advanced_schedule_monthly_occurrences) + + +def automation_schedule_update(cmd, client, + resource_group_name, + automation_account_name, + schedule_name, + name=None, + description=None, + is_enabled=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + schedule_name=schedule_name, + name=name, + description=description, + is_enabled=is_enabled) + + +def automation_schedule_delete(cmd, client, + resource_group_name, + automation_account_name, + schedule_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + schedule_name=schedule_name) + + +def automation_variable_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_variable_show(cmd, client, + resource_group_name, + automation_account_name, + variable_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + variable_name=variable_name) + + +def automation_variable_create(cmd, client, + resource_group_name, + automation_account_name, + variable_name, + name, + value=None, + description=None, + is_encrypted=None): + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + variable_name=variable_name, + name=name, + value=value, + description=description, + is_encrypted=is_encrypted) + + +def automation_variable_update(cmd, client, + resource_group_name, + automation_account_name, + variable_name, + name=None, + value=None, + description=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + variable_name=variable_name, + name=name, + value=value, + description=description) + + +def automation_variable_delete(cmd, client, + resource_group_name, + automation_account_name, + variable_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + variable_name=variable_name) + + +def automation_webhook_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter) + + +def automation_webhook_show(cmd, client, + resource_group_name, + automation_account_name, + webhook_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + webhook_name=webhook_name) + + +def automation_webhook_create(cmd, client, + resource_group_name, + automation_account_name, + webhook_name, + name, + is_enabled=None, + uri=None, + expiry_time=None, + parameters=None, + runbook=None, + run_on=None): + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + webhook_name=webhook_name, + name=name, + is_enabled=is_enabled, + uri=uri, + expiry_time=expiry_time, + parameters=parameters, + runbook=runbook, + run_on=run_on) + + +def automation_webhook_update(cmd, client, + resource_group_name, + automation_account_name, + webhook_name, + name=None, + is_enabled=None, + run_on=None, + parameters=None, + description=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + webhook_name=webhook_name, + name=name, + is_enabled=is_enabled, + run_on=run_on, + parameters=parameters, + description=description) + + +def automation_webhook_delete(cmd, client, + resource_group_name, + automation_account_name, + webhook_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + webhook_name=webhook_name) + + +def automation_webhook_generate_uri(cmd, client, + resource_group_name, + automation_account_name): + return client.generate_uri(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_watcher_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter) + + +def automation_watcher_show(cmd, client, + resource_group_name, + automation_account_name, + watcher_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + watcher_name=watcher_name) + + +def automation_watcher_create(cmd, client, + resource_group_name, + automation_account_name, + watcher_name, + tags=None, + location=None, + etag=None, + execution_frequency_in_seconds=None, + script_name=None, + script_parameters=None, + script_run_on=None, + description=None): + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + watcher_name=watcher_name, + tags=tags, + location=location, + etag=etag, + execution_frequency_in_seconds=execution_frequency_in_seconds, + script_name=script_name, + script_parameters=script_parameters, + script_run_on=script_run_on, + description=description) + + +def automation_watcher_update(cmd, client, + resource_group_name, + automation_account_name, + watcher_name, + name=None, + execution_frequency_in_seconds=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + watcher_name=watcher_name, + name=name, + execution_frequency_in_seconds=execution_frequency_in_seconds) + + +def automation_watcher_delete(cmd, client, + resource_group_name, + automation_account_name, + watcher_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + watcher_name=watcher_name) + + +def automation_watcher_start(cmd, client, + resource_group_name, + automation_account_name, + watcher_name): + return client.start(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + watcher_name=watcher_name) + + +def automation_watcher_stop(cmd, client, + resource_group_name, + automation_account_name, + watcher_name): + return client.stop(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + watcher_name=watcher_name) + + +def automation_software_update_configuration_list(cmd, client, + resource_group_name, + automation_account_name, + client_request_id=None, + filter=None): + return client.list(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + client_request_id=client_request_id, + filter=filter) + + +def automation_software_update_configuration_show(cmd, client, + resource_group_name, + automation_account_name, + software_update_configuration_name, + client_request_id=None): + return client.get_by_name(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + software_update_configuration_name=software_update_configuration_name, + client_request_id=client_request_id) + + +def automation_software_update_configuration_create(cmd, client, + resource_group_name, + automation_account_name, + software_update_configuration_name, + update_configuration_operating_system, + client_request_id=None, + error=None, + tasks_post_task_parameters=None, + tasks_post_task_source=None, + tasks_pre_task_parameters=None, + tasks_pre_task_source=None, + schedule_info_start_time=None, + schedule_info_expiry_time=None, + schedule_info_expiry_time_offset_minutes=None, + schedule_info_is_enabled=None, + schedule_info_next_run=None, + schedule_info_next_run_offset_minutes=None, + schedule_info_interval=None, + schedule_info_frequency=None, + schedule_info_time_zone=None, + schedule_info_creation_time=None, + schedule_info_last_modified_time=None, + schedule_info_description=None, + schedule_info_advanced_schedule_week_days=None, + schedule_info_advanced_schedule_month_days=None, + schedule_info_advanced_schedule_monthly_occurrences=None, + update_configuration_windows=None, + update_configuration_linux=None, + update_configuration_duration=None, + update_configuration_azure_virtual_machines=None, + update_configuration_non_azure_computer_names=None, + update_configuration_targets_azure_queries=None, + update_configuration_targets_non_azure_queries=None): + if isinstance(schedule_info_advanced_schedule_week_days, str): + schedule_info_advanced_schedule_week_days = json.loads(schedule_info_advanced_schedule_week_days) + if isinstance(schedule_info_advanced_schedule_month_days, str): + schedule_info_advanced_schedule_month_days = json.loads(schedule_info_advanced_schedule_month_days) + if isinstance(update_configuration_azure_virtual_machines, str): + update_configuration_azure_virtual_machines = json.loads(update_configuration_azure_virtual_machines) + if isinstance(update_configuration_non_azure_computer_names, str): + update_configuration_non_azure_computer_names = json.loads(update_configuration_non_azure_computer_names) + if isinstance(update_configuration_targets_azure_queries, str): + update_configuration_targets_azure_queries = json.loads(update_configuration_targets_azure_queries) + return client.create(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + software_update_configuration_name=software_update_configuration_name, + client_request_id=client_request_id, + error=error, + parameters=tasks_post_task_parameters, + source=tasks_post_task_source, + task_properties_parameters=tasks_pre_task_parameters, + task_properties_source=tasks_pre_task_source, + start_time=schedule_info_start_time, + expiry_time=schedule_info_expiry_time, + expiry_time_offset_minutes=schedule_info_expiry_time_offset_minutes, + is_enabled=schedule_info_is_enabled, + next_run=schedule_info_next_run, + next_run_offset_minutes=schedule_info_next_run_offset_minutes, + interval=schedule_info_interval, + frequency=schedule_info_frequency, + time_zone=schedule_info_time_zone, + creation_time=schedule_info_creation_time, + last_modified_time=schedule_info_last_modified_time, + description=schedule_info_description, + week_days=schedule_info_advanced_schedule_week_days, + month_days=schedule_info_advanced_schedule_month_days, + monthly_occurrences=schedule_info_advanced_schedule_monthly_occurrences, + operating_system=update_configuration_operating_system, + windows=update_configuration_windows, + linux=update_configuration_linux, + duration=update_configuration_duration, + azure_virtual_machines=update_configuration_azure_virtual_machines, + non_azure_computer_names=update_configuration_non_azure_computer_names, + azure_queries=update_configuration_targets_azure_queries, + non_azure_queries=update_configuration_targets_non_azure_queries) + + +def automation_software_update_configuration_delete(cmd, client, + resource_group_name, + automation_account_name, + software_update_configuration_name, + client_request_id=None): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + software_update_configuration_name=software_update_configuration_name, + client_request_id=client_request_id) + + +def automation_software_update_configuration_run_list(cmd, client, + resource_group_name, + automation_account_name, + client_request_id=None, + filter=None, + skip=None, + top=None): + return client.list(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + client_request_id=client_request_id, + filter=filter, + skip=skip, + top=top) + + +def automation_software_update_configuration_run_show(cmd, client, + resource_group_name, + automation_account_name, + software_update_configuration_run_id, + client_request_id=None): + return client.get_by_id(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + software_update_configuration_run_id=software_update_configuration_run_id, + client_request_id=client_request_id) + + +def automation_software_update_configuration_machine_run_list(cmd, client, + resource_group_name, + automation_account_name, + client_request_id=None, + filter=None, + skip=None, + top=None): + return client.list(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + client_request_id=client_request_id, + filter=filter, + skip=skip, + top=top) + + +def automation_software_update_configuration_machine_run_show(cmd, client, + resource_group_name, + automation_account_name, + software_update_configuration_machine_run_id, + client_request_id=None): + return client.get_by_id(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + software_update_configuration_machine_run_id=software_update_configuration_machine_run_id, + client_request_id=client_request_id) + + +def automation_source_control_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter) + + +def automation_source_control_show(cmd, client, + resource_group_name, + automation_account_name, + source_control_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + source_control_name=source_control_name) + + +def automation_source_control_create(cmd, client, + resource_group_name, + automation_account_name, + source_control_name, + repo_url=None, + branch=None, + folder_path=None, + auto_sync=None, + publish_runbook=None, + source_type=None, + security_token=None, + description=None): + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + source_control_name=source_control_name, + repo_url=repo_url, + branch=branch, + folder_path=folder_path, + auto_sync=auto_sync, + publish_runbook=publish_runbook, + source_type=source_type, + security_token=security_token, + description=description) + + +def automation_source_control_update(cmd, client, + resource_group_name, + automation_account_name, + source_control_name, + branch=None, + folder_path=None, + auto_sync=None, + publish_runbook=None, + security_token=None, + description=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + source_control_name=source_control_name, + branch=branch, + folder_path=folder_path, + auto_sync=auto_sync, + publish_runbook=publish_runbook, + security_token=security_token, + description=description) + + +def automation_source_control_delete(cmd, client, + resource_group_name, + automation_account_name, + source_control_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + source_control_name=source_control_name) + + +def automation_source_control_sync_job_list(cmd, client, + resource_group_name, + automation_account_name, + source_control_name, + filter=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + source_control_name=source_control_name, + filter=filter) + + +def automation_source_control_sync_job_show(cmd, client, + resource_group_name, + automation_account_name, + source_control_name, + source_control_sync_job_id): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + source_control_name=source_control_name, + source_control_sync_job_id=source_control_sync_job_id) + + +def automation_source_control_sync_job_create(cmd, client, + resource_group_name, + automation_account_name, + source_control_name, + source_control_sync_job_id, + commit_id): + return client.create(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + source_control_name=source_control_name, + source_control_sync_job_id=source_control_sync_job_id, + commit_id=commit_id) + + +def automation_source_control_sync_job_stream_list(cmd, client, + resource_group_name, + automation_account_name, + source_control_name, + source_control_sync_job_id, + filter=None): + return client.list_by_sync_job(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + source_control_name=source_control_name, + source_control_sync_job_id=source_control_sync_job_id, + filter=filter) + + +def automation_source_control_sync_job_stream_show(cmd, client, + resource_group_name, + automation_account_name, + source_control_name, + source_control_sync_job_id, + stream_id): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + source_control_name=source_control_name, + source_control_sync_job_id=source_control_sync_job_id, + stream_id=stream_id) + + +def automation_job_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None, + client_request_id=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter, + client_request_id=client_request_id) + + +def automation_job_show(cmd, client, + resource_group_name, + automation_account_name, + job_name, + client_request_id=None): + if resource_group_name is not None and automation_account_name is not None and job_name is not None: + return client.get_output(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_name=job_name, + client_request_id=client_request_id) + elif resource_group_name is not None and automation_account_name is not None and job_name is not None: + return client.get_runbook_content(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_name=job_name, + client_request_id=client_request_id) + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_name=job_name, + client_request_id=client_request_id) + + +def automation_job_create(cmd, client, + resource_group_name, + automation_account_name, + job_name, + client_request_id=None, + runbook=None, + parameters=None, + run_on=None): + return client.create(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_name=job_name, + client_request_id=client_request_id, + runbook=runbook, + parameters=parameters, + run_on=run_on) + + +def automation_job_resume(cmd, client, + resource_group_name, + automation_account_name, + job_name, + client_request_id=None): + return client.resume(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_name=job_name, + client_request_id=client_request_id) + + +def automation_job_stop(cmd, client, + resource_group_name, + automation_account_name, + job_name, + client_request_id=None): + return client.stop(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_name=job_name, + client_request_id=client_request_id) + + +def automation_job_suspend(cmd, client, + resource_group_name, + automation_account_name, + job_name, + client_request_id=None): + return client.suspend(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_name=job_name, + client_request_id=client_request_id) + + +def automation_job_stream_list(cmd, client, + resource_group_name, + automation_account_name, + job_name, + filter=None, + client_request_id=None): + return client.list_by_job(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_name=job_name, + filter=filter, + client_request_id=client_request_id) + + +def automation_job_stream_show(cmd, client, + resource_group_name, + automation_account_name, + job_name, + job_stream_id, + client_request_id=None): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_name=job_name, + job_stream_id=job_stream_id, + client_request_id=client_request_id) + + +def automation_agent_registration_information_show(cmd, client, + resource_group_name, + automation_account_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_agent_registration_information_regenerate_key(cmd, client, + resource_group_name, + automation_account_name, + key_name): + return client.regenerate_key(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + key_name=key_name) + + +def automation_dsc_node_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None, + skip=None, + top=None, + inlinecount=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter, + skip=skip, + top=top, + inlinecount=inlinecount) + + +def automation_dsc_node_show(cmd, client, + resource_group_name, + automation_account_name, + node_id): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_id=node_id) + + +def automation_dsc_node_update(cmd, client, + resource_group_name, + automation_account_name, + node_id, + node_configuration_name=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_id=node_id, + dsc_node_update_parameters_node_id=node_id, + name=node_configuration_name) + + +def automation_dsc_node_delete(cmd, client, + resource_group_name, + automation_account_name, + node_id): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_id=node_id) + + +def automation_node_report_list(cmd, client, + resource_group_name, + automation_account_name, + node_id, + filter=None): + return client.list_by_node(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_id=node_id, + filter=filter) + + +def automation_node_report_show(cmd, client, + resource_group_name, + automation_account_name, + node_id, + report_id): + if resource_group_name is not None and automation_account_name is not None and node_id is not None and report_id is not None: + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_id=node_id, + report_id=report_id) + return client.get_content(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_id=node_id, + report_id=report_id) + + +def automation_dsc_compilation_job_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter) + + +def automation_dsc_compilation_job_show(cmd, client, + resource_group_name, + automation_account_name, + job_id=None, + job_stream_id=None, + compilation_job_name=None): + if resource_group_name is not None and automation_account_name is not None and job_id is not None and job_stream_id is not None: + return client.get_stream(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_id=job_id, + job_stream_id=job_stream_id) + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + compilation_job_name=compilation_job_name) + + +def automation_dsc_compilation_job_create(cmd, client, + resource_group_name, + automation_account_name, + compilation_job_name, + configuration, + name=None, + location=None, + tags=None, + parameters=None, + increment_node_configuration_build=None): + return client.begin_create(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + compilation_job_name=compilation_job_name, + name=name, + location=location, + tags=tags, + configuration=configuration, + parameters=parameters, + increment_node_configuration_build=increment_node_configuration_build) + + +def automation_dsc_compilation_job_stream_list(cmd, client, + resource_group_name, + automation_account_name, + job_id): + return client.list_by_job(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + job_id=job_id) + + +def automation_dsc_node_configuration_list(cmd, client, + resource_group_name, + automation_account_name, + filter=None, + skip=None, + top=None, + inlinecount=None): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + filter=filter, + skip=skip, + top=top, + inlinecount=inlinecount) + + +def automation_dsc_node_configuration_show(cmd, client, + resource_group_name, + automation_account_name, + node_configuration_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_configuration_name=node_configuration_name) + + +def automation_dsc_node_configuration_create(cmd, client, + resource_group_name, + automation_account_name, + node_configuration_name, + name=None, + tags=None, + source=None, + configuration=None, + increment_node_configuration_build=None): + if isinstance(source, str): + source = json.loads(source) + return client.begin_create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_configuration_name=node_configuration_name, + name=name, + tags=tags, + source=source, + configuration=configuration, + increment_node_configuration_build=increment_node_configuration_build) + + +def automation_dsc_node_configuration_update(cmd, client, + resource_group_name, + automation_account_name, + node_configuration_name, + name=None, + tags=None, + source=None, + configuration=None, + increment_node_configuration_build=None): + if isinstance(source, str): + source = json.loads(source) + return client.begin_create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_configuration_name=node_configuration_name, + name=name, + tags=tags, + source=source, + configuration=configuration, + increment_node_configuration_build=increment_node_configuration_build) + + +def automation_dsc_node_configuration_delete(cmd, client, + resource_group_name, + automation_account_name, + node_configuration_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_configuration_name=node_configuration_name) + + +def automation_node_count_information_show(cmd, client, + resource_group_name, + automation_account_name, + count_type): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + count_type=count_type) + + +def automation_runbook_draft_show(cmd, client, + resource_group_name, + automation_account_name, + runbook_name): + if resource_group_name is not None and automation_account_name is not None and runbook_name is not None: + return client.get_content(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + + +def automation_runbook_draft_replace_content(cmd, client, + resource_group_name, + automation_account_name, + runbook_name, + runbook_content): + return client.begin_replace_content(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + runbook_content=runbook_content) + + +def automation_runbook_draft_undo_edit(cmd, client, + resource_group_name, + automation_account_name, + runbook_name): + return client.undo_edit(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + + +def automation_runbook_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_runbook_show(cmd, client, + resource_group_name, + automation_account_name, + runbook_name): + if resource_group_name is not None and automation_account_name is not None and runbook_name is not None: + return client.get_content(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + + +def automation_runbook_create(cmd, client, + resource_group_name, + automation_account_name, + runbook_name, + runbook_type, + name=None, + location=None, + tags=None, + log_verbose=None, + log_progress=None, + draft=None, + publish_content_link=None, + description=None, + log_activity_trace=None): + if isinstance(draft, str): + draft = json.loads(draft) + if isinstance(publish_content_link, str): + publish_content_link = json.loads(publish_content_link) + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + name=name, + location=location, + tags=tags, + log_verbose=log_verbose, + log_progress=log_progress, + runbook_type=runbook_type, + draft=draft, + publish_content_link=publish_content_link, + description=description, + log_activity_trace=log_activity_trace) + + +def automation_runbook_update(cmd, client, + resource_group_name, + automation_account_name, + runbook_name, + name=None, + location=None, + tags=None, + description=None, + log_verbose=None, + log_progress=None, + log_activity_trace=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + name=name, + location=location, + tags=tags, + description=description, + log_verbose=log_verbose, + log_progress=log_progress, + log_activity_trace=log_activity_trace) + + +def automation_runbook_delete(cmd, client, + resource_group_name, + automation_account_name, + runbook_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + + +def automation_runbook_publish(cmd, client, + resource_group_name, + automation_account_name, + runbook_name): + return client.begin_publish(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + + +def automation_test_job_stream_list(cmd, client, + resource_group_name, + automation_account_name, + runbook_name, + filter=None): + return client.list_by_test_job(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + filter=filter) + + +def automation_test_job_stream_show(cmd, client, + resource_group_name, + automation_account_name, + runbook_name, + job_stream_id): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + job_stream_id=job_stream_id) + + +def automation_test_job_show(cmd, client, + resource_group_name, + automation_account_name, + runbook_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + + +def automation_test_job_create(cmd, client, + resource_group_name, + automation_account_name, + runbook_name, + parameters=None, + run_on=None): + return client.create(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + parameters=parameters, + run_on=run_on) + + +def automation_test_job_resume(cmd, client, + resource_group_name, + automation_account_name, + runbook_name): + return client.resume(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + + +def automation_test_job_stop(cmd, client, + resource_group_name, + automation_account_name, + runbook_name): + return client.stop(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + + +def automation_test_job_suspend(cmd, client, + resource_group_name, + automation_account_name, + runbook_name): + return client.suspend(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name) + + +def automation_python2_package_list(cmd, client, + resource_group_name, + automation_account_name): + return client.list_by_automation_account(resource_group_name=resource_group_name, + automation_account_name=automation_account_name) + + +def automation_python2_package_show(cmd, client, + resource_group_name, + automation_account_name, + package_name): + return client.get(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + package_name=package_name) + + +def automation_python2_package_create(cmd, client, + resource_group_name, + automation_account_name, + package_name, + content_link, + tags=None): + if isinstance(content_link, str): + content_link = json.loads(content_link) + return client.create_or_update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + package_name=package_name, + tags=tags, + content_link=content_link) + + +def automation_python2_package_update(cmd, client, + resource_group_name, + automation_account_name, + package_name, + tags=None): + return client.update(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + package_name=package_name, + tags=tags) + + +def automation_python2_package_delete(cmd, client, + resource_group_name, + automation_account_name, + package_name): + return client.delete(resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + package_name=package_name) diff --git a/src/automation/azext_automation/manual/__init__.py b/src/automation/azext_automation/manual/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/automation/azext_automation/manual/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/automation/azext_automation/tests/__init__.py b/src/automation/azext_automation/tests/__init__.py new file mode 100644 index 00000000000..fe1bd438b46 --- /dev/null +++ b/src/automation/azext_automation/tests/__init__.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. +# -------------------------------------------------------------------------- +import inspect +import os + + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + print("running {}()...".format(func.__name__)) + return func_to_call(*args, **kwargs) + + if inspect.isclass(func): + return get_func_to_call() + else: + return wrapper diff --git a/src/automation/azext_automation/tests/latest/__init__.py b/src/automation/azext_automation/tests/latest/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/automation/azext_automation/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/automation/azext_automation/tests/latest/preparers.py b/src/automation/azext_automation/tests/latest/preparers.py new file mode 100644 index 00000000000..3d6672de64f --- /dev/null +++ b/src/automation/azext_automation/tests/latest/preparers.py @@ -0,0 +1,116 @@ +# -------------------------------------------------------------------------- +# 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 os +from datetime import datetime +from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer +from azure_devtools.scenario_tests import SingleValueReplacer +from azure.cli.testsdk.exceptions import CliTestError +from azure.cli.testsdk.reverse_dependency import get_dummy_cli + + +KEY_RESOURCE_GROUP = 'rg' +KEY_VIRTUAL_NETWORK = 'vnet' +KEY_VNET_SUBNET = 'subnet' + + +class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='virtual_network', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + dev_setting_name='AZURE_CLI_TEST_DEV_VIRTUAL_NETWORK_NAME', + random_name_length=24, key=KEY_VIRTUAL_NETWORK): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VirtualNetworkPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + + tags = {'product': 'azurecli', 'cause': 'automation', + 'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')} + if 'ENV_JOB_NAME' in os.environ: + tags['job'] = os.environ['ENV_JOB_NAME'] + tags = ' '.join(['{}={}'.format(key, value) + for key, value in tags.items()]) + template = 'az network vnet create --resource-group {} --name {} --tag ' + tags + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group_name, name)) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + # delete vnet if test is being recorded and if the vnet is not a dev rg + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, 'az network vnet delete --name {} --resource-group {}'.format(name, self.resource_group_name)) + + +class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='subnet', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + vnet_name=None, + vnet_key=KEY_VIRTUAL_NETWORK, + address_prefixes="11.0.0.0/24", + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_SUBNET_NAME', + random_name_length=24, key=KEY_VNET_SUBNET): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VnetSubnetPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.vnet_name = vnet_name + self.vnet_key = vnet_key + self.address_prefixes = address_prefixes + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + if not self.vnet_name: + self.vnet_name = self.test_class_instance.kwargs.get(self.vnet_key) + if not self.vnet_name: + raise CliTestError("Error: No vnet configured!") + + self.test_class_instance.kwargs[self.key] = 'default' + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + pass diff --git a/src/automation/azext_automation/tests/latest/test_automation_scenario.py b/src/automation/azext_automation/tests/latest/test_automation_scenario.py new file mode 100644 index 00000000000..62e17ad56d6 --- /dev/null +++ b/src/automation/azext_automation/tests/latest/test_automation_scenario.py @@ -0,0 +1,2121 @@ +# -------------------------------------------------------------------------- +# 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 os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import ScenarioTest +from .. import try_manual +from azure.cli.testsdk import ResourceGroupPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@try_manual +def setup(test, rg, rg_2, rg_3): + pass + + +# EXAMPLE: Create or update automation account +@try_manual +def step_create_or_update_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation automation-account create ' + '--automation-account-name "{myAutomationAccount9}" ' + '--name "myAutomationAccount9" ' + '--location "East US 2" ' + '--sku name="Free" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create job +@try_manual +def step_create_job(test, rg, rg_2, rg_3): + test.cmd('az automation job create ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--parameters properties={{"parameters":{{"key01":"value01","key02":"value02"}},"runOn":"","runbook":{{"na' + 'me":"TestRunbook"}}}} ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Create or update a module +@try_manual +def step_create_or_update_a_module(test, rg, rg_2, rg_3): + test.cmd('az automation module create ' + '--automation-account-name "{AutomationAccount_3}" ' + '--module-name "{OmsCompositeResources}" ' + '--content-link "{{\\"contentHash\\":{{\\"algorithm\\":\\"sha265\\",\\"value\\":\\"07E108A962B81DD9C9BAA89' + 'BB47C0F6EE52B29E83758B07795E408D258B2B87A\\"}},\\"uri\\":\\"https://teststorage.blob.core.windows.net/dsc' + 'composite/OmsCompositeResources.zip\\",\\"version\\":\\"1.0.0.0\\"}}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create or update webhook +@try_manual +def step_create_or_update_webhook(test, rg, rg_2, rg_3): + test.cmd('az automation webhook create ' + '--automation-account-name "{AutomationAccount_3}" ' + '--parameters name="TestWebhook" properties={{"expiryTime":"2018-03-29T22:18:13.7002872Z","isEnabled":true' + ',"runbook":{{"name":"TestRunbook"}},"uri":"https://s1events.azure-automation.net/webhooks?token ' + '--resource-group "{rg}" ' + '--webhook-name "{TestWebhook}"', + checks=[]) + + +# EXAMPLE: Create runbook as draft +@try_manual +def step_create_runbook_as_draft(test, rg, rg_2, rg_3): + test.cmd('az automation runbook create ' + '--automation-account-name "{AutomationAccount_2}" ' + '--name "Get-AzureVMTutorial" ' + '--location "East US 2" ' + '--description "Description of the Runbook" ' + '--draft "{{}}" ' + '--log-progress false ' + '--log-verbose false ' + '--runbook-type "PowerShellWorkflow" ' + '--tags tag01="value01" tag02="value02" ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Create or update runbook and publish it +@try_manual +def step_create_or_update_runbook_and_publish_it(test, rg, rg_2, rg_3): + test.cmd('az automation runbook create ' + '--automation-account-name "{AutomationAccount_2}" ' + '--name "Get-AzureVMTutorial" ' + '--location "East US 2" ' + '--description "Description of the Runbook" ' + '--log-activity-trace 1 ' + '--log-progress true ' + '--log-verbose false ' + '--publish-content-link "{{\\"contentHash\\":{{\\"algorithm\\":\\"SHA256\\",\\"value\\":\\"115775B8FF2BE67' + '2D8A946BD0B489918C724DDE15A440373CA54461D53010A80\\"}},\\"uri\\":\\"https://raw.githubusercontent.com/Azu' + 're/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1\\"}}"' + ' ' + '--runbook-type "PowerShellWorkflow" ' + '--tags tag01="value01" tag02="value02" ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Create or update watcher +@try_manual +def step_create_or_update_watcher(test, rg, rg_2, rg_3): + test.cmd('az automation watcher create ' + '--automation-account-name "{AutomationAccount_4}" ' + '--description "This is a test watcher." ' + '--execution-frequency-in-seconds 60 ' + '--script-name "MyTestWatcherRunbook" ' + '--script-run-on "MyTestHybridWorkerGroup" ' + '--resource-group "{rg}" ' + '--watcher-name "{MyTestWatcher}"', + checks=[]) + + +# EXAMPLE: Create or update a schedule +@try_manual +def step_create_or_update_a_schedule(test, rg, rg_2, rg_3): + test.cmd('az automation schedule create ' + '--automation-account-name "{AutomationAccount_3}" ' + '--name "mySchedule" ' + '--description "my description of schedule goes here" ' + '--expiry-time "2017-04-01T17:28:57.2494819Z" ' + '--frequency "Hour" ' + '--interval "1" ' + '--start-time "2017-03-27T17:28:57.2494819Z" ' + '--resource-group "{rg}" ' + '--schedule-name "{mySchedule}"', + checks=[]) + + +# EXAMPLE: Create or update a variable +@try_manual +def step_create_or_update_a_variable(test, rg, rg_2, rg_3): + test.cmd('az automation variable create ' + '--automation-account-name "{AutomationAccount_5}" ' + '--name "sampleVariable" ' + '--description "my description" ' + '--is-encrypted false ' + '--value "\\"ComputerName.domain.com\\"" ' + '--resource-group "{rg}" ' + '--variable-name "{sampleVariable}"', + checks=[]) + + +# EXAMPLE: Create a credential +@try_manual +def step_create_a_credential(test, rg, rg_2, rg_3): + test.cmd('az automation credential create ' + '--automation-account-name "{AutomationAccount_6}" ' + '--credential-name "{myCredential}" ' + '--name "myCredential" ' + '--description "my description goes here" ' + '--password "myPassw0rd" ' + '--user-name "mylingaiah" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create or update connection +@try_manual +def step_create_or_update_connection(test, rg, rg_2, rg_3): + test.cmd('az automation connection create ' + '--automation-account-name "{AutomationAccount_7}" ' + '--connection-name "{mysConnection}" ' + '--name "mysConnection" ' + '--description "my description goes here" ' + '--connection-type name="Azure" ' + '--field-definition-values AutomationCertificateName="mysCertificateName" SubscriptionID="subid" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create or update a certificate +@try_manual +def step_create_or_update_a_certificate(test, rg, rg_2, rg_3): + test.cmd('az automation certificate create ' + '--automation-account-name "{AutomationAccount_6}" ' + '--certificate-name "{testCert}" ' + '--name "testCert" ' + '--description "Sample Cert" ' + '--base64value "base 64 value of cert" ' + '--is-exportable false ' + '--thumbprint "thumbprint of cert" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create a job schedule +@try_manual +def step_create_a_job_schedule(test, rg, rg_2, rg_3): + test.cmd('az automation job-schedule create ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-schedule-id "0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc" ' + '--parameters properties={{"parameters":{{"jobscheduletag01":"jobschedulevalue01","jobscheduletag02":"jobs' + 'chedulevalue02"}},"runbook":{{"name":"TestRunbook"}},"schedule":{{"name":"ScheduleNameGoesHere332204b5-de' + 'be-4348-a5c7-6357457189f2"}}}} ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create or Update Configuration +@try_manual +def step_create_or_update_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-configuration create ' + '--automation-account-name "{AutomationAccount_6}" ' + '--configuration-name "SetupServer" ' + '--parameters "{{\\"name\\":\\"SetupServer\\",\\"location\\":\\"East US 2\\",\\"properties\\":{{\\"descrip' + 'tion\\":\\"sample configuration\\",\\"source\\":{{\\"type\\":\\"embeddedContent\\",\\"hash\\":{{\\"algori' + 'thm\\":\\"sha256\\",\\"value\\":\\"A9E5DB56BA21513F61E0B3868816FDC6D4DF5131F5617D7FF0D769674BD5072F\\"}},' + '\\"value\\":\\"Configuration SetupServer {{\\\\r\\\\n Node localhost {{\\\\r\\\\n ' + ' WindowsFeature IIS {{\\\\r\\\\n Name = \\\\\\"Web-Server\\\\\\";' + '\\\\r\\\\n Ensure = \\\\\\"Present\\\\\\"\\\\r\\\\n }}\\\\r\\\\n }}\\\\r\\\\n}}\\"}}' + '}}}}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create or update a source control +@try_manual +def step_create_or_update_a_source_control(test, rg, rg_2, rg_3): + test.cmd('az automation source-control create ' + '--automation-account-name "{AutomationAccount_5}" ' + '--description "my description" ' + '--auto-sync true ' + '--branch "master" ' + '--folder-path "/folderOne/folderTwo" ' + '--publish-runbook true ' + '--repo-url "https://sampleUser.visualstudio.com/myProject/_git/myRepository" ' + '--security-token access-token="3a326f7a0dcd343ea58fee21f2fd5fb4c1234567" token-type="PersonalAccessToken"' + ' ' + '--source-type "VsoGit" ' + '--resource-group "{rg}" ' + '--source-control-name "{sampleSourceControl}"', + checks=[]) + + +# EXAMPLE: Create or update a python 2 package +@try_manual +def step_create_or_update_a_python_2_package(test, rg, rg_2, rg_3): + test.cmd('az automation python2-package create ' + '--automation-account-name "{AutomationAccount_3}" ' + '--package-name "OmsCompositeResources" ' + '--content-link "{{\\"contentHash\\":{{\\"algorithm\\":\\"sha265\\",\\"value\\":\\"07E108A962B81DD9C9BAA89' + 'BB47C0F6EE52B29E83758B07795E408D258B2B87A\\"}},\\"uri\\":\\"https://teststorage.blob.core.windows.net/dsc' + 'composite/OmsCompositeResources.zip\\",\\"version\\":\\"1.0.0.0\\"}}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create or update a DSC Compilation job +@try_manual +def step_create_or_update_a_dsc_compilation_job(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-compilation-job create ' + '--automation-account-name "{AutomationAccount_3}" ' + '--compilation-job-name "TestCompilationJob" ' + '--parameters properties={{"configuration":{{"name":"SetupServer"}}}} ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az automation dsc-compilation-job wait --created ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create or update connection type +@try_manual +def step_create_or_update_connection_type(test, rg, rg_2, rg_3): + test.cmd('az automation connection-type create ' + '--automation-account-name "{AutomationAccount_8}" ' + '--connection-type-name "{myCT}" ' + '--name "myCT" ' + '--field-definitions "{{\\"myBoolField\\":{{\\"type\\":\\"bool\\",\\"isEncrypted\\":false,\\"isOptional\\"' + ':false}},\\"myStringField\\":{{\\"type\\":\\"string\\",\\"isEncrypted\\":false,\\"isOptional\\":false}},' + '\\"myStringFieldEncrypted\\":{{\\"type\\":\\"string\\",\\"isEncrypted\\":true,\\"isOptional\\":false}}}}"' + ' ' + '--is-global false ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create node configuration +@try_manual +def step_create_node_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node-configuration create ' + '--automation-account-name "{AutomationAccount_9}" ' + '--node-configuration-name "configName.nodeConfigName" ' + '--name "configName.nodeConfigName" ' + '--configuration name="configName" ' + '--increment-node-configuration-build true ' + '--source "{{\\"type\\":\\"embeddedContent\\",\\"hash\\":{{\\"algorithm\\":\\"sha256\\",\\"value\\":\\"6DE' + '256A57F01BFA29B88696D5E77A383D6E61484C7686E8DB955FA10ACE9FFE5\\"}},\\"value\\":\\"\\\\r\\\\ninstance of M' + 'SFT_RoleResource as $MSFT_RoleResource1ref\\\\r\\\\n{{\\\\r\\\\nResourceID = \\\\\\"[WindowsFeature]IIS\\' + '\\\\";\\\\r\\\\n Ensure = \\\\\\"Present\\\\\\";\\\\r\\\\n SourceInfo = \\\\\\"::3::32::WindowsFeature\\' + '\\\\";\\\\r\\\\n Name = \\\\\\"Web-Server\\\\\\";\\\\r\\\\n ModuleName = \\\\\\"PsDesiredStateConfigurati' + 'on\\\\\\";\\\\r\\\\n\\\\r\\\\nModuleVersion = \\\\\\"1.0\\\\\\";\\\\r\\\\r\\\\n ConfigurationName = \\\\' + '\\"configName\\\\\\";\\\\r\\\\r\\\\n}};\\\\r\\\\ninstance of OMI_ConfigurationDocument\\\\r\\\\n\\\\r\\\\' + 'r\\\\n {{\\\\r\\\\n Version=\\\\\\"2.0.0\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n ' + ' MinimumCompatibleVersion = \\\\\\"1.0.0\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n ' + ' CompatibleVersionAdditionalProperties= {{\\\\\\"Omi_BaseResource:ConfigurationName\\\\\\"}};\\\\r\\\\' + 'n \\\\r\\\\r\\\\n Author=\\\\\\"weijiel\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n ' + ' GenerationDate=\\\\\\"03/30/2017 13:40:25\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n ' + ' GenerationHost=\\\\\\"TEST-BACKEND\\\\\\";\\\\r\\\\n \\\\r\\\\r\\\\n Name' + '=\\\\\\"configName\\\\\\";\\\\r\\\\n\\\\r\\\\r\\\\n }};\\\\r\\\\n\\",\\"version\\":\\"' + '1.0\\"}}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Create or update runbook draft +@try_manual +def step_create_or_update_runbook_draft(test, rg, rg_2, rg_3): + test.cmd('az automation runbook-draft replace-content ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}" ' + '--runbook-content "<#\\r\\n .DESCRIPTION\\r\\n An example runbook which prints out the ' + 'first10 Azure VMs in your subscription (ordered alphabetically).\\r\\n For more information ab' + 'out how this runbook authenticates to your Azure subscription, see our documentation here: http: //aka.ms' + '/fxu3mn\\r\\n\\r\\n .NOTES\\r\\n AUTHOR: Azure Automation Team\\r\\n LASTEDI' + 'T: Mar27,\\r\\n 2015\\r\\n #>\\r\\n workflow Get-AzureVMTutorial{\\r\\n #The name' + ' of the Automation Credential Asset this runbook will use to authenticate to Azure.\\r\\n $Credent' + 'ialAssetName = \'DefaultAzureCredential\'\\r\\n\\r\\n #Get the credential with the above name from' + ' the Automation Asset store\\r\\n $Cred = Get-AutomationPSCredential -Name $CredentialAssetName\\r' + '\\n if(!$Cred){\\r\\n Throw\\"Could not find an Automation Credential Asset named \'${C' + 'redentialAssetName}\'. Make sure you have created one in this Automation Account.\\"\\r\\n ' + ' }\\r\\n\\r\\n #Connect to your Azure Account\\r\\n $Account = Add-AzureAccount -Credential' + ' $Cred\\r\\n if(!$Account){\\r\\n Throw\\"Could not authenticate to Azure using the cre' + 'dential asset \'${CredentialAssetName}\'. Make sure the user name and password are correct.\\"\\r\\n ' + ' }\\r\\n\\r\\n #TODO (optional): pick the right subscription to use. Without this line, ' + 'the default subscription for your Azure Account will be used.\\r\\n #Select-AzureSubscription -Sub' + 'scriptionName\\"TODO: your Azure subscription name here\\"\\r\\n \\r\\n #Get all the VMs yo' + 'u have in your Azure subscription\\r\\n $VMs = Get-AzureVM\\r\\n\\r\\n #Print out up to10 o' + 'f those VMs\\r\\n if(!$VMs){\\r\\n Write-Output\\"No VMs were found in your subscriptio' + 'n.\\"\\r\\n } else{\\r\\n Write-Output $VMs[0..9\\r\\n ]\\r' + '\\n }\\r\\n }" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Create test job +@try_manual +def step_create_test_job(test, rg, rg_2, rg_3): + test.cmd('az automation test-job create ' + '--automation-account-name "{AutomationAccount_2}" ' + '--parameters parameters={{"key01":"value01","key02":"value02"}} runOn="" ' + '--resource-group "{rg_2}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Create software update configuration +@try_manual +def step_create_software_update_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration create ' + '--automation-account-name "{AutomationAccount_10}" ' + '--tasks-pre-task-parameters properties={{"scheduleInfo":{{"advancedSchedule":{{"weekDays":["Monday","Thur' + 'sday"]}},"expiryTime":"2018-11-09T11:22:57+00:00","frequency":"Hour","interval":1,"startTime":"2017-10-19' + 'T12:22:57+00:00","timeZone":"America/Los_Angeles"}},"tasks":{{"postTask":{{"parameters":null,"source":"Ge' + 'tCache"}},"preTask":{{"parameters":{{"COMPUTERNAME":"Computer1"}},"source":"HelloWorld"}}}},"updateConfig' + 'uration":{{"azureVirtualMachines":["/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/my' + 'resources/providers/Microsoft.Compute/virtualMachines/vm-01","/subscriptions/5ae68d89-69a4-454f-b5ce-e443' + 'cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02","/subscriptions/5a' + 'e68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines' + '/vm-03"],"duration":"PT2H0M","nonAzureComputerNames":["box1.contoso.com","box2.contoso.com"],"operatingSy' + 'stem":"Windows","targets":{{"azureQueries":[{{"locations":["Japan East","UK South"],"scope":["/subscripti' + 'ons/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources","/subscriptions/5ae68d89-69a4-454f-b' + '5ce-e443cc4e0067"],"tagSettings":{{"filterOperator":"All","tags":[{{"tag1":["tag1Value1","tag1Value2","ta' + 'g1Value3"]}},{{"tag2":["tag2Value1","tag2Value2","tag2Value3"]}}]}}}}],"nonAzureQueries":[{{"functionAlia' + 's":"SavedSearch1","workspaceId":"WorkspaceId1"}},{{"functionAlias":"SavedSearch2","workspaceId":"Workspac' + 'eId2"}}]}},"windows":{{"excludedKbNumbers":["168934","168973"],"includedUpdateClassifications":"Critical"' + ',"rebootSetting":"IfRequired"}}}}}} ' + '--resource-group "{rg_2}" ' + '--software-update-configuration-name "{testpatch}"', + checks=[]) + + +# EXAMPLE: Create or update a source control sync job +@try_manual +def step_create_or_update_a_source_control_sync_job(test, rg, rg_2, rg_3): + test.cmd('az automation source-control-sync-job create ' + '--automation-account-name "{AutomationAccount_3}" ' + '--commit-id "9de0980bfb45026a3d97a1b0522d98a9f604226e" ' + '--resource-group "{rg}" ' + '--source-control-name "{SourceControl_2}" ' + '--source-control-sync-job-id "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a"', + checks=[]) + + +# EXAMPLE: Get a sync job stream identified by sync job stream id. +@try_manual +def step_get_a_sync_job_stream_identified_by_sync_job_stream_id_(test, rg, rg_2, rg_3): + test.cmd('az automation source-control-sync-job-stream show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}" ' + '--source-control-name "{SourceControl_2}" ' + '--source-control-sync-job-id "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a2b" ' + '--stream-id "b86c5c31-e9fd-4734-8764-ddd6c101e706_00636596855139029522_00000000000000000007"', + checks=[]) + + +# EXAMPLE: Get a list of sync job streams identified by sync job id +@try_manual +def step_get_a_list_of_sync_job_streams_identified_by_sync_job_id(test, rg, rg_2, rg_3): + test.cmd('az automation source-control-sync-job-stream list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}" ' + '--source-control-name "{SourceControl_2}" ' + '--source-control-sync-job-id "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a2b"', + checks=[]) + + +# EXAMPLE: Get a source control sync job by job id +@try_manual +def step_get_a_source_control_sync_job_by_job_id(test, rg, rg_2, rg_3): + test.cmd('az automation source-control-sync-job show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}" ' + '--source-control-name "{SourceControl_2}" ' + '--source-control-sync-job-id "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a"', + checks=[]) + + +# EXAMPLE: Get software update configuration machine run +@try_manual +def step_get_software_update_configuration_machine_run(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration-machine-run show ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}" ' + '--software-update-configuration-machine-run-id "ca440719-34a4-4234-a1a9-3f84faf7788f"', + checks=[]) + + +# EXAMPLE: Get test job stream +@try_manual +def step_get_test_job_stream(test, rg, rg_2, rg_3): + test.cmd('az automation test-job-stream show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-stream-id "851b2101-686f-40e2-8a4b-5b8df08afbd1_00636535684910693884_00000000000000000001" ' + '--resource-group "{rg_2}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Get software update configuration runs by Id +@try_manual +def step_get_software_update_configuration_runs_by_id(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration-run show ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}" ' + '--software-update-configuration-run-id "2bd77cfa-2e9c-41b4-a45b-684a77cfeca9"', + checks=[]) + + +# EXAMPLE: Get a list of fields of a given type +@try_manual +def step_get_a_list_of_fields_of_a_given_type(test, rg, rg_2, rg_3): + test.cmd('az automation object-data-type list-field ' + '--automation-account-name "{AutomationAccount_11}" ' + '--module-name "{Module_2}" ' + '--resource-group "{rg}" ' + '--type-name "MyCustomType"', + checks=[]) + + +# EXAMPLE: Get software update configuration by name +@try_manual +def step_get_software_update_configuration_by_name(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration show ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}" ' + '--software-update-configuration-name "{SoftwareUpdateConfigurations_2}"', + checks=[]) + + +# EXAMPLE: Get a DSC Compilation job stream by job stream id +@try_manual +def step_get_a_dsc_compilation_job_stream_by_job_stream_id(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-compilation-job show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--job-id "836d4e06-2d88-46b4-8500-7febd4906838" ' + '--job-stream-id "836d4e06-2d88-46b4-8500-7febd4906838_00636481062421684835_00000000000000000008" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a hybrid worker group +@try_manual +def step_get_a_hybrid_worker_group(test, rg, rg_2, rg_3): + test.cmd('az automation hybrid-runbook-worker-group show ' + '--automation-account-name "{AutomationAccount_12}" ' + '--hybrid-runbook-worker-group-name "{TestHybridGroup}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a list of source control sync jobs +@try_manual +def step_get_a_list_of_source_control_sync_jobs(test, rg, rg_2, rg_3): + test.cmd('az automation source-control-sync-job list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}" ' + '--source-control-name "{SourceControl_2}"', + checks=[]) + + +# EXAMPLE: List job streams by job name +@try_manual +def step_list_job_streams_by_job_name(test, rg, rg_2, rg_3): + test.cmd('az automation job-stream list ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Get Activity in a module +@try_manual +def step_get_activity_in_a_module(test, rg, rg_2, rg_3): + test.cmd('az automation activity show ' + '--activity-name "{Add-AzureRmAccount}" ' + '--automation-account-name "{AutomationAccount_3}" ' + '--module-name "{OmsCompositeResources}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get content of node +@try_manual +def step_get_content_of_node(test, rg, rg_2, rg_3): + test.cmd('az automation node-report show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--node-id "nodeId" ' + '--report-id "reportId" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a list of fields of a given type +@try_manual +def step_get_a_list_of_fields_of_a_given_type(test, rg, rg_2, rg_3): + test.cmd('az automation object-data-type list-field ' + '--automation-account-name "{AutomationAccount_11}" ' + '--module-name "{Module_2}" ' + '--resource-group "{rg}" ' + '--type-name "MyCustomType"', + checks=[]) + + +# EXAMPLE: Get a list of fields of a given type across all accessible modules +@try_manual +def step_get_a_list_of_fields_of_a_given_type_across_all_accessible_modules(test, rg, rg_2, rg_3): + test.cmd('az automation object-data-type list-field ' + '--automation-account-name "{AutomationAccount_11}" ' + '--resource-group "{rg}" ' + '--type-name "MyCustomType"', + checks=[]) + + +# EXAMPLE: Get runbook draft content +@try_manual +def step_get_runbook_draft_content(test, rg, rg_2, rg_3): + test.cmd('az automation runbook-draft show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Get test job +@try_manual +def step_get_test_job(test, rg, rg_2, rg_3): + test.cmd('az automation test-job show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg_2}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: List DSC Compilation job streams +@try_manual +def step_list_dsc_compilation_job_streams(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-compilation-job-stream list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--job-id "836d4e06-2d88-46b4-8500-7febd4906838" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a DSC node configuration +@try_manual +def step_get_a_dsc_node_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node-configuration show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--node-configuration-name "SetupServer.localhost" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get DSC Configuration content +@try_manual +def step_get_dsc_configuration_content(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-configuration show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--configuration-name "ConfigName" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get Dsc node report data by node id and report id. +@try_manual +def step_get_dsc_node_report_data_by_node_id_and_report_id_(test, rg, rg_2, rg_3): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: Get job stream +@try_manual +def step_get_job_stream(test, rg, rg_2, rg_3): + test.cmd('az automation job-stream show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--job-stream-id "851b2101-686f-40e2-8a4b-5b8df08afbd1_00636535684910693884_00000000000000000001" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Get connection type +@try_manual +def step_get_connection_type(test, rg, rg_2, rg_3): + test.cmd('az automation connection-type show ' + '--automation-account-name "{AutomationAccount_8}" ' + '--connection-type-name "{myCT}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a DSC Compilation job +@try_manual +def step_get_a_dsc_compilation_job(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-compilation-job show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--compilation-job-name "TestCompilationJob" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a python 2 package +@try_manual +def step_get_a_python_2_package(test, rg, rg_2, rg_3): + test.cmd('az automation python2-package show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--package-name "OmsCompositeResources" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a source control +@try_manual +def step_get_a_source_control(test, rg, rg_2, rg_3): + test.cmd('az automation source-control show ' + '--automation-account-name "{AutomationAccount_5}" ' + '--resource-group "{rg}" ' + '--source-control-name "{sampleSourceControl}"', + checks=[]) + + +# EXAMPLE: Get a DSC Configuration +@try_manual +def step_get_a_dsc_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-configuration show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--configuration-name "TemplateBasic" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List software update configuration machine runs for a specific software update configuration run +@try_manual +def step_list_software_update_configuration_machine_runs_for_a_specific_software_update_configuration_run(test, rg, + rg_2, rg_3): + test.cmd('az automation software-update-configuration-machine-run list ' + '--filter "$filter=properties/correlationId%20eq%200b943e57-44d3-4f05-898c-6e92aa617e59" ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: List software update configuration machine runs +@try_manual +def step_list_software_update_configuration_machine_runs(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration-run list ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: List activities by a module +@try_manual +def step_list_activities_by_a_module(test, rg, rg_2, rg_3): + test.cmd('az automation activity list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--module-name "{OmsCompositeResources}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a job schedule +@try_manual +def step_get_a_job_schedule(test, rg, rg_2, rg_3): + test.cmd('az automation job-schedule show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-schedule-id "0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get runbook content +@try_manual +def step_get_runbook_content(test, rg, rg_2, rg_3): + test.cmd('az automation runbook show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Get a certificate +@try_manual +def step_get_a_certificate(test, rg, rg_2, rg_3): + test.cmd('az automation certificate show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--certificate-name "{testCert}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get Job Runbook Content +@try_manual +def step_get_job_runbook_content(test, rg, rg_2, rg_3): + test.cmd('az automation job show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Get runbook draft +@try_manual +def step_get_runbook_draft(test, rg, rg_2, rg_3): + test.cmd('az automation runbook-draft show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Get a connection +@try_manual +def step_get_a_connection(test, rg, rg_2, rg_3): + test.cmd('az automation connection show ' + '--automation-account-name "{AutomationAccount_7}" ' + '--connection-name "{Connection_2}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a credential +@try_manual +def step_get_a_credential(test, rg, rg_2, rg_3): + test.cmd('az automation credential show ' + '--automation-account-name "{AutomationAccount_6}" ' + '--credential-name "{myCredential}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get node's status counts +@try_manual +def step_get_node_s_status_counts(test, rg, rg_2, rg_3): + test.cmd('az automation node-count-information show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--count-type "status" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get node's node configuration counts +@try_manual +def step_get_node_s_node_configuration_counts(test, rg, rg_2, rg_3): + test.cmd('az automation node-count-information show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--count-type "nodeconfiguration" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List software update configuration machine run with status equal to 'Failed' +@try_manual +def step_list_software_update_configuration_machine_run_with_status_equal_to__failed_(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration-run list ' + '--filter "properties/status%20eq%20\'Failed\'" ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: List software update configuration machine runs +@try_manual +def step_list_software_update_configuration_machine_runs(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration-run list ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: List DSC reports by node id. +@try_manual +def step_list_dsc_reports_by_node_id_(test, rg, rg_2, rg_3): + test.cmd('az automation node-report list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--node-id "nodeId" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a variable +@try_manual +def step_get_a_variable(test, rg, rg_2, rg_3): + test.cmd('az automation variable show ' + '--automation-account-name "{AutomationAccount_5}" ' + '--resource-group "{rg}" ' + '--variable-name "{sampleVariable}"', + checks=[]) + + +# EXAMPLE: Get a schedule +@try_manual +def step_get_a_schedule(test, rg, rg_2, rg_3): + test.cmd('az automation schedule show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}" ' + '--schedule-name "{mySchedule}"', + checks=[]) + + +# EXAMPLE: Get the agent registration information +@try_manual +def step_get_the_agent_registration_information(test, rg, rg_2, rg_3): + test.cmd('az automation agent-registration-information show ' + '--automation-account-name "{AutomationAccount_6}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List software update configurations Targeting a specific azure virtual machine +@try_manual +def step_list_software_update_configurations_targeting_a_specific_azure_virtual_machine(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration list ' + '--filter "properties/updateConfiguration/azureVirtualMachines/any(m: m eq \'/subscriptions/1a7d4044-286c-' + '4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01\')" ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: List software update configurations +@try_manual +def step_list_software_update_configurations(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration list ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Get runbook +@try_manual +def step_get_runbook(test, rg, rg_2, rg_3): + test.cmd('az automation runbook show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: List job streams by job name +@try_manual +def step_list_job_streams_by_job_name(test, rg, rg_2, rg_3): + test.cmd('az automation job-stream list ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Get watcher +@try_manual +def step_get_watcher(test, rg, rg_2, rg_3): + test.cmd('az automation watcher show ' + '--automation-account-name "{AutomationAccount_4}" ' + '--resource-group "{rg}" ' + '--watcher-name "{MyTestWatcher}"', + checks=[]) + + +# EXAMPLE: Get webhook +@try_manual +def step_get_webhook(test, rg, rg_2, rg_3): + test.cmd('az automation webhook show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}" ' + '--webhook-name "{TestWebhook}"', + checks=[]) + + +# EXAMPLE: Get Job Output +@try_manual +def step_get_job_output(test, rg, rg_2, rg_3): + test.cmd('az automation job show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: List hybrid worker groups by Automation Account +@try_manual +def step_list_hybrid_worker_groups_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation hybrid-runbook-worker-group list ' + '--automation-account-name "{AutomationAccount_12}" ' + '--resource-group "{rg_3}"', + checks=[]) + + +# EXAMPLE: Get a module +@try_manual +def step_get_a_module(test, rg, rg_2, rg_3): + test.cmd('az automation module show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--module-name "{OmsCompositeResources}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get a node +@try_manual +def step_get_a_node(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node show ' + '--automation-account-name "{AutomationAccount_3}" ' + '--node-id "nodeId" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get job +@try_manual +def step_get_job(test, rg, rg_2, rg_3): + test.cmd('az automation job show ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: List Paged DSC node configurations by Automation Account with name filter +@try_manual +def step_list_paged_dsc_node_configurations_by_automation_account_with_name_filter(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node-configuration list ' + '--filter "contains(\'.localhost\',name)" ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 2 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List DSC node configurations by Automation Account +@try_manual +def step_list_dsc_node_configurations_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node-configuration list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC node configurations by Automation Account with no filter +@try_manual +def step_list_paged_dsc_node_configurations_by_automation_account_with_no_filter(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node-configuration list ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 4 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List python 2 packages by automation account +@try_manual +def step_list_python_2_packages_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation python2-package list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get connection types, first 100 +@try_manual +def step_get_connection_types__first_100(test, rg, rg_2, rg_3): + test.cmd('az automation connection-type list ' + '--automation-account-name "{AutomationAccount_13}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List DSC Compilation job in Automation Account +@try_manual +def step_list_dsc_compilation_job_in_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-compilation-job list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get connection types, next 100 +@try_manual +def step_get_connection_types__next_100(test, rg, rg_2, rg_3): + test.cmd('az automation connection-type list ' + '--automation-account-name "{AutomationAccount_13}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get the linked workspace of an automation account +@try_manual +def step_get_the_linked_workspace_of_an_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation linked-workspace show ' + '--automation-account-name "{AutomationAccount_14}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get DSC Configuration +@try_manual +def step_get_dsc_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-configuration list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC Configurations with name filter +@try_manual +def step_list_paged_dsc_configurations_with_name_filter(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-configuration list ' + '--filter "contains(name,\'server\')" ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 2 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List sourceControls +@try_manual +def step_list_sourcecontrols(test, rg, rg_2, rg_3): + test.cmd('az automation source-control list ' + '--automation-account-name "{AutomationAccount_5}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC Configurations with no filter +@try_manual +def step_list_paged_dsc_configurations_with_no_filter(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-configuration list ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 3 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List certificates +@try_manual +def step_list_certificates(test, rg, rg_2, rg_3): + test.cmd('az automation certificate list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List all job schedules by automation account +@try_manual +def step_list_all_job_schedules_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation job-schedule list ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List credentials by automation account, next 100 +@try_manual +def step_list_credentials_by_automation_account__next_100(test, rg, rg_2, rg_3): + test.cmd('az automation credential list ' + '--automation-account-name "{AutomationAccount_9}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List credentials by automation account, first 100 +@try_manual +def step_list_credentials_by_automation_account__first_100(test, rg, rg_2, rg_3): + test.cmd('az automation credential list ' + '--automation-account-name "{AutomationAccount_9}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List connections by automation account, next 100 +@try_manual +def step_list_connections_by_automation_account__next_100(test, rg, rg_2, rg_3): + test.cmd('az automation connection list ' + '--automation-account-name "{AutomationAccount_7}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List connections by automation account, first 100 +@try_manual +def step_list_connections_by_automation_account__first_100(test, rg, rg_2, rg_3): + test.cmd('az automation connection list ' + '--automation-account-name "{AutomationAccount_7}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get statistics of an automation account +@try_manual +def step_get_statistics_of_an_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation statistics list ' + '--automation-account-name "{AutomationAccount_15}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List variables, First 100 +@try_manual +def step_list_variables__first_100(test, rg, rg_2, rg_3): + test.cmd('az automation variable list ' + '--automation-account-name "{AutomationAccount_5}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List variables, Next 100 +@try_manual +def step_list_variables__next_100(test, rg, rg_2, rg_3): + test.cmd('az automation variable list ' + '--automation-account-name "{AutomationAccount_5}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List schedules by automation account, first 100 +@try_manual +def step_list_schedules_by_automation_account__first_100(test, rg, rg_2, rg_3): + test.cmd('az automation schedule list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List schedules by automation account, next 100 +@try_manual +def step_list_schedules_by_automation_account__next_100(test, rg, rg_2, rg_3): + test.cmd('az automation schedule list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List watchers by Automation Account +@try_manual +def step_list_watchers_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation watcher list ' + '--automation-account-name "{AutomationAccount_4}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List runbooks by automation account +@try_manual +def step_list_runbooks_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation runbook list ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List webhooks by Automation Account +@try_manual +def step_list_webhooks_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation webhook list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List modules by automation account +@try_manual +def step_list_modules_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation module list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get usages of an automation account +@try_manual +def step_get_usages_of_an_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation usage list ' + '--automation-account-name "{AutomationAccount_15}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC nodes by Automation Account with version filter +@try_manual +def step_list_paged_dsc_nodes_by_automation_account_with_version_filter(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node list ' + '--filter "properties/extensionHandler/any(eh: eh/version le \'2.70\')" ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 4 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC nodes by Automation Account with name filter +@try_manual +def step_list_paged_dsc_nodes_by_automation_account_with_name_filter(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node list ' + '--filter "contains(\'DSCCOMP\',name)" ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 6 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC nodes by Automation Account with no filters +@try_manual +def step_list_paged_dsc_nodes_by_automation_account_with_no_filters(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node list ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 2 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List DSC nodes by Automation Account +@try_manual +def step_list_dsc_nodes_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node list ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC nodes by Automation Account with node status filter +@try_manual +def step_list_paged_dsc_nodes_by_automation_account_with_node_status_filter(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node list ' + '--filter "contains(properties/status,\'Compliant,NotCompliant\')" ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 4 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC nodes by Automation Account with Node Configuration Custom filter +@try_manual +def step_list_paged_dsc_nodes_by_automation_account_with_node_configuration_custom_filter(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node list ' + '--filter "contains(properties/nodeConfiguration/name,\'SetupServer.localhost,SetupClient.localhost,$$Not$' + '$Configured$$\')" ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 4 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC nodes by Automation Account where Node Configurations are not assigned filter +@try_manual +def step_list_paged_dsc_nodes_by_automation_account_where_node_configurations_are_not_assigned_filter(test, rg, rg_2, + rg_3): + test.cmd('az automation dsc-node list ' + '--filter "properties/nodeConfiguration/name eq \'\'" ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 20 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List Paged DSC nodes with filters separated by 'and' +@try_manual +def step_list_paged_dsc_nodes_with_filters_separated_by__and_(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node list ' + '--filter "properties/extensionHandler/any(eh: eh/version gt \'2.70\') and contains(name,\'sql\') and cont' + 'ains(properties/nodeConfiguration/name,\'$$Not$$Configured$$\')" ' + '--inlinecount "allpages" ' + '--skip 0 ' + '--top 10 ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List jobs by automation account +@try_manual +def step_list_jobs_by_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation job list ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Get automation account +@try_manual +def step_get_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation automation-account show ' + '--automation-account-name "{myAutomationAccount9}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List automation accounts by resource group +@try_manual +def step_list_automation_accounts_by_resource_group(test, rg, rg_2, rg_3): + test.cmd('az automation automation-account list ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: List automation accounts by resource group +@try_manual +def step_list_automation_accounts_by_resource_group(test, rg, rg_2, rg_3): + test.cmd('az automation automation-account list ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Regenerate registration key +@try_manual +def step_regenerate_registration_key(test, rg, rg_2, rg_3): + test.cmd('az automation agent-registration-information regenerate-key ' + '--automation-account-name "{AutomationAccount_6}" ' + '--key-name "{primary}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Update hybrid worker group +@try_manual +def step_update_hybrid_worker_group(test, rg, rg_2, rg_3): + test.cmd('az automation hybrid-runbook-worker-group update ' + '--automation-account-name "{AutomationAccount_12}" ' + '--hybrid-runbook-worker-group-name "{TestHybridGroup}" ' + '--credential name="myRunAsCredentialName" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Suspend test job +@try_manual +def step_suspend_test_job(test, rg, rg_2, rg_3): + test.cmd('az automation test-job suspend ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg_2}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Resume test job +@try_manual +def step_resume_test_job(test, rg, rg_2, rg_3): + test.cmd('az automation test-job resume ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg_2}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Stop test job +@try_manual +def step_stop_test_job(test, rg, rg_2, rg_3): + test.cmd('az automation test-job stop ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg_2}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Undo draft edit to last known published state +@try_manual +def step_undo_draft_edit_to_last_known_published_state(test, rg, rg_2, rg_3): + test.cmd('az automation runbook-draft undo-edit ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Update a module +@try_manual +def step_update_a_module(test, rg, rg_2, rg_3): + test.cmd('az automation module update ' + '--automation-account-name "{AutomationAccount_11}" ' + '--module-name "{Module_2}" ' + '--content-link "{{\\"contentHash\\":{{\\"algorithm\\":\\"sha265\\",\\"value\\":\\"07E108A962B81DD9C9BAA89' + 'BB47C0F6EE52B29E83758B07795E408D258B2B87A\\"}},\\"uri\\":\\"https://teststorage.blob.core.windows.net/myc' + 'ontainer/MyModule.zip\\",\\"version\\":\\"1.0.0.0\\"}}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Update a source control +@try_manual +def step_update_a_source_control(test, rg, rg_2, rg_3): + test.cmd('az automation source-control update ' + '--automation-account-name "{AutomationAccount_5}" ' + '--description "my description" ' + '--auto-sync true ' + '--branch "master" ' + '--folder-path "/folderOne/folderTwo" ' + '--publish-runbook true ' + '--security-token access-token="3a326f7a0dcd343ea58fee21f2fd5fb4c1234567" token-type="PersonalAccessToken"' + ' ' + '--resource-group "{rg}" ' + '--source-control-name "{sampleSourceControl}"', + checks=[]) + + +# EXAMPLE: Create or Update Configuration +@try_manual +def step_create_or_update_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-configuration create ' + '--automation-account-name "{AutomationAccount_6}" ' + '--configuration-name "SetupServer" ' + '--parameters "{{\\"name\\":\\"SetupServer\\",\\"location\\":\\"East US 2\\",\\"properties\\":{{\\"descrip' + 'tion\\":\\"sample configuration\\",\\"source\\":{{\\"type\\":\\"embeddedContent\\",\\"hash\\":{{\\"algori' + 'thm\\":\\"sha256\\",\\"value\\":\\"A9E5DB56BA21513F61E0B3868816FDC6D4DF5131F5617D7FF0D769674BD5072F\\"}},' + '\\"value\\":\\"Configuration SetupServer {{\\\\r\\\\n Node localhost {{\\\\r\\\\n ' + ' WindowsFeature IIS {{\\\\r\\\\n Name = \\\\\\"Web-Server\\\\\\";' + '\\\\r\\\\n Ensure = \\\\\\"Present\\\\\\"\\\\r\\\\n }}\\\\r\\\\n }}\\\\r\\\\n}}\\"}}' + '}}}}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Update a certificate +@try_manual +def step_update_a_certificate(test, rg, rg_2, rg_3): + test.cmd('az automation certificate update ' + '--automation-account-name "{AutomationAccount_3}" ' + '--certificate-name "{testCert}" ' + '--name "testCert" ' + '--description "sample certificate. Description updated" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Publish runbook draft +@try_manual +def step_publish_runbook_draft(test, rg, rg_2, rg_3): + test.cmd('az automation runbook publish ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Update a credential +@try_manual +def step_update_a_credential(test, rg, rg_2, rg_3): + test.cmd('az automation credential update ' + '--automation-account-name "{AutomationAccount_6}" ' + '--credential-name "{myCredential}" ' + '--name "myCredential" ' + '--description "my description goes here" ' + '--password "myPassw0rd3" ' + '--user-name "mylingaiah" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Update a connection +@try_manual +def step_update_a_connection(test, rg, rg_2, rg_3): + test.cmd('az automation connection update ' + '--automation-account-name "{AutomationAccount_7}" ' + '--connection-name "{Connection_2}" ' + '--name "myConnection" ' + '--description "my description goes here" ' + '--field-definition-values AutomationCertificateName="myCertificateName" SubscriptionID="b5e4748c-f69a-467' + 'c-8749-e2f9c8cd3009" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Start Watcher +@try_manual +def step_start_watcher(test, rg, rg_2, rg_3): + test.cmd('az automation watcher start ' + '--automation-account-name "{AutomationAccount_4}" ' + '--resource-group "{rg}" ' + '--watcher-name "{MyTestWatcher}"', + checks=[]) + + +# EXAMPLE: Start Watcher +@try_manual +def step_start_watcher(test, rg, rg_2, rg_3): + test.cmd('az automation watcher start ' + '--automation-account-name "{AutomationAccount_4}" ' + '--resource-group "{rg}" ' + '--watcher-name "{MyTestWatcher}"', + checks=[]) + + +# EXAMPLE: Update a variable +@try_manual +def step_update_a_variable(test, rg, rg_2, rg_3): + test.cmd('az automation variable update ' + '--automation-account-name "{AutomationAccount_5}" ' + '--name "sampleVariable" ' + '--value "\\"ComputerName3.domain.com\\"" ' + '--resource-group "{rg}" ' + '--variable-name "{sampleVariable}"', + checks=[]) + + +# EXAMPLE: Update a schedule +@try_manual +def step_update_a_schedule(test, rg, rg_2, rg_3): + test.cmd('az automation schedule update ' + '--automation-account-name "{AutomationAccount_3}" ' + '--name "mySchedule" ' + '--description "my updated description of schedule goes here" ' + '--is-enabled false ' + '--resource-group "{rg}" ' + '--schedule-name "{mySchedule}"', + checks=[]) + + +# EXAMPLE: Update runbook +@try_manual +def step_update_runbook(test, rg, rg_2, rg_3): + test.cmd('az automation runbook update ' + '--automation-account-name "{AutomationAccount_2}" ' + '--description "Updated Description of the Runbook" ' + '--log-activity-trace 1 ' + '--log-progress true ' + '--log-verbose false ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Update watcher +@try_manual +def step_update_watcher(test, rg, rg_2, rg_3): + test.cmd('az automation watcher update ' + '--automation-account-name "{AutomationAccount_4}" ' + '--name "MyTestWatcher" ' + '--execution-frequency-in-seconds 600 ' + '--resource-group "{rg}" ' + '--watcher-name "{MyTestWatcher}"', + checks=[]) + + +# EXAMPLE: Suspend job +@try_manual +def step_suspend_job(test, rg, rg_2, rg_3): + test.cmd('az automation job suspend ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Update webhook +@try_manual +def step_update_webhook(test, rg, rg_2, rg_3): + test.cmd('az automation webhook update ' + '--automation-account-name "{AutomationAccount_3}" ' + '--parameters name="TestWebhook" properties={{"description":"updated webhook","isEnabled":false}} ' + '--resource-group "{rg}" ' + '--webhook-name "{TestWebhook}"', + checks=[]) + + +# EXAMPLE: Generate webhook uri +@try_manual +def step_generate_webhook_uri(test, rg, rg_2, rg_3): + test.cmd('az automation webhook generate-uri ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Resume job +@try_manual +def step_resume_job(test, rg, rg_2, rg_3): + test.cmd('az automation job resume ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Update a module +@try_manual +def step_update_a_module(test, rg, rg_2, rg_3): + test.cmd('az automation module update ' + '--automation-account-name "{AutomationAccount_11}" ' + '--module-name "{Module_2}" ' + '--content-link "{{\\"contentHash\\":{{\\"algorithm\\":\\"sha265\\",\\"value\\":\\"07E108A962B81DD9C9BAA89' + 'BB47C0F6EE52B29E83758B07795E408D258B2B87A\\"}},\\"uri\\":\\"https://teststorage.blob.core.windows.net/myc' + 'ontainer/MyModule.zip\\",\\"version\\":\\"1.0.0.0\\"}}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Stop job +@try_manual +def step_stop_job(test, rg, rg_2, rg_3): + test.cmd('az automation job stop ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-name "{foo}" ' + '--resource-group "{rg_2}"', + checks=[]) + + +# EXAMPLE: Update a node +@try_manual +def step_update_a_node(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node update ' + '--automation-account-name "{AutomationAccount_3}" ' + '--node-id "nodeId" ' + '--node-configuration-name "SetupServer.localhost" ' + '--node-id "nodeId" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Get lists of an automation account +@try_manual +def step_get_lists_of_an_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation key list-by-automation-account ' + '--automation-account-name "{AutomationAccount_11}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Update an automation account +@try_manual +def step_update_an_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation automation-account update ' + '--automation-account-name "{myAutomationAccount9}" ' + '--name "myAutomationAccount9" ' + '--location "East US 2" ' + '--sku name="Free" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete software update configuration +@try_manual +def step_delete_software_update_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation software-update-configuration delete ' + '--automation-account-name "{AutomationAccount_10}" ' + '--resource-group "{rg_2}" ' + '--software-update-configuration-name "{SoftwareUpdateConfigurations_2}"', + checks=[]) + + +# EXAMPLE: Delete a hybrid worker group +@try_manual +def step_delete_a_hybrid_worker_group(test, rg, rg_2, rg_3): + test.cmd('az automation hybrid-runbook-worker-group delete ' + '--automation-account-name "{AutomationAccount_9}" ' + '--hybrid-runbook-worker-group-name "{HybridRunbookWorkerGroup_2}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete a DSC node configuration +@try_manual +def step_delete_a_dsc_node_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node-configuration delete ' + '--automation-account-name "{AutomationAccount_9}" ' + '--node-configuration-name "configName.nodeConfigName" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete an existing connection type +@try_manual +def step_delete_an_existing_connection_type(test, rg, rg_2, rg_3): + test.cmd('az automation connection-type delete ' + '--automation-account-name "{AutomationAccount_8}" ' + '--connection-type-name "{myCT}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete a python 2 package +@try_manual +def step_delete_a_python_2_package(test, rg, rg_2, rg_3): + test.cmd('az automation python2-package delete ' + '--automation-account-name "{AutomationAccount_3}" ' + '--package-name "OmsCompositeResources" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete a source control +@try_manual +def step_delete_a_source_control(test, rg, rg_2, rg_3): + test.cmd('az automation source-control delete ' + '--automation-account-name "{AutomationAccount_5}" ' + '--resource-group "{rg}" ' + '--source-control-name "{sampleSourceControl}"', + checks=[]) + + +# EXAMPLE: Delete DSC Configuration +@try_manual +def step_delete_dsc_configuration(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-configuration delete ' + '--automation-account-name "{AutomationAccount_3}" ' + '--configuration-name "TemplateBasic" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete a job schedule +@try_manual +def step_delete_a_job_schedule(test, rg, rg_2, rg_3): + test.cmd('az automation job-schedule delete ' + '--automation-account-name "{AutomationAccount_2}" ' + '--job-schedule-id "0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete a certificate +@try_manual +def step_delete_a_certificate(test, rg, rg_2, rg_3): + test.cmd('az automation certificate delete ' + '--automation-account-name "{AutomationAccount_3}" ' + '--certificate-name "{testCert}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete a credential +@try_manual +def step_delete_a_credential(test, rg, rg_2, rg_3): + test.cmd('az automation credential delete ' + '--automation-account-name "{AutomationAccount_9}" ' + '--credential-name "{myCredential}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete an existing connection +@try_manual +def step_delete_an_existing_connection(test, rg, rg_2, rg_3): + test.cmd('az automation connection delete ' + '--automation-account-name "{AutomationAccount_7}" ' + '--connection-name "{Connection_2}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete schedule +@try_manual +def step_delete_schedule(test, rg, rg_2, rg_3): + test.cmd('az automation schedule delete ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}" ' + '--schedule-name "{mySchedule}"', + checks=[]) + + +# EXAMPLE: Delete a variable +@try_manual +def step_delete_a_variable(test, rg, rg_2, rg_3): + test.cmd('az automation variable delete ' + '--automation-account-name "{AutomationAccount_5}" ' + '--resource-group "{rg}" ' + '--variable-name "{sampleVariable}"', + checks=[]) + + +# EXAMPLE: Delete webhook +@try_manual +def step_delete_webhook(test, rg, rg_2, rg_3): + test.cmd('az automation webhook delete ' + '--automation-account-name "{AutomationAccount_3}" ' + '--resource-group "{rg}" ' + '--webhook-name "{TestWebhook}"', + checks=[]) + + +# EXAMPLE: Delete a runbook +@try_manual +def step_delete_a_runbook(test, rg, rg_2, rg_3): + test.cmd('az automation runbook delete ' + '--automation-account-name "{AutomationAccount_2}" ' + '--resource-group "{rg}" ' + '--runbook-name "{Get-AzureVMTutorial}"', + checks=[]) + + +# EXAMPLE: Delete watcher +@try_manual +def step_delete_watcher(test, rg, rg_2, rg_3): + test.cmd('az automation watcher delete ' + '--automation-account-name "{AutomationAccount_4}" ' + '--resource-group "{rg}" ' + '--watcher-name "{MyTestWatcher}"', + checks=[]) + + +# EXAMPLE: Delete a module +@try_manual +def step_delete_a_module(test, rg, rg_2, rg_3): + test.cmd('az automation module delete ' + '--automation-account-name "{AutomationAccount_3}" ' + '--module-name "{OmsCompositeResources}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete a DSC Node +@try_manual +def step_delete_a_dsc_node(test, rg, rg_2, rg_3): + test.cmd('az automation dsc-node delete ' + '--automation-account-name "{myAutomationAccount9}" ' + '--node-id "e1243a76-a9bd-432f-bde3-ad8f317ee786" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: Delete automation account +@try_manual +def step_delete_automation_account(test, rg, rg_2, rg_3): + test.cmd('az automation automation-account delete ' + '--automation-account-name "{myAutomationAccount9}" ' + '--resource-group "{rg}"', + checks=[]) + + +@try_manual +def cleanup(test, rg, rg_2, rg_3): + pass + + +@try_manual +def call_scenario(test, rg, rg_2, rg_3): + setup(test, rg, rg_2, rg_3) + step_create_or_update_automation_account(test, rg, rg_2, rg_3) + step_create_job(test, rg, rg_2, rg_3) + step_create_or_update_a_module(test, rg, rg_2, rg_3) + step_create_or_update_webhook(test, rg, rg_2, rg_3) + step_create_runbook_as_draft(test, rg, rg_2, rg_3) + step_create_or_update_runbook_and_publish_it(test, rg, rg_2, rg_3) + step_create_or_update_watcher(test, rg, rg_2, rg_3) + step_create_or_update_a_schedule(test, rg, rg_2, rg_3) + step_create_or_update_a_variable(test, rg, rg_2, rg_3) + step_create_a_credential(test, rg, rg_2, rg_3) + step_create_or_update_connection(test, rg, rg_2, rg_3) + step_create_or_update_a_certificate(test, rg, rg_2, rg_3) + step_create_a_job_schedule(test, rg, rg_2, rg_3) + step_create_or_update_configuration(test, rg, rg_2, rg_3) + step_create_or_update_a_source_control(test, rg, rg_2, rg_3) + step_create_or_update_a_python_2_package(test, rg, rg_2, rg_3) + step_create_or_update_a_dsc_compilation_job(test, rg, rg_2, rg_3) + step_create_or_update_connection_type(test, rg, rg_2, rg_3) + step_create_node_configuration(test, rg, rg_2, rg_3) + step_create_or_update_runbook_draft(test, rg, rg_2, rg_3) + step_create_test_job(test, rg, rg_2, rg_3) + step_create_software_update_configuration(test, rg, rg_2, rg_3) + step_create_or_update_a_source_control_sync_job(test, rg, rg_2, rg_3) + step_get_a_sync_job_stream_identified_by_sync_job_stream_id_(test, rg, rg_2, rg_3) + step_get_a_list_of_sync_job_streams_identified_by_sync_job_id(test, rg, rg_2, rg_3) + step_get_a_source_control_sync_job_by_job_id(test, rg, rg_2, rg_3) + step_get_software_update_configuration_machine_run(test, rg, rg_2, rg_3) + step_get_test_job_stream(test, rg, rg_2, rg_3) + step_get_software_update_configuration_runs_by_id(test, rg, rg_2, rg_3) + step_get_a_list_of_fields_of_a_given_type(test, rg, rg_2, rg_3) + step_get_software_update_configuration_by_name(test, rg, rg_2, rg_3) + step_get_a_dsc_compilation_job_stream_by_job_stream_id(test, rg, rg_2, rg_3) + step_get_a_hybrid_worker_group(test, rg, rg_2, rg_3) + step_get_a_list_of_source_control_sync_jobs(test, rg, rg_2, rg_3) + step_list_job_streams_by_job_name(test, rg, rg_2, rg_3) + step_get_activity_in_a_module(test, rg, rg_2, rg_3) + step_get_content_of_node(test, rg, rg_2, rg_3) + step_get_a_list_of_fields_of_a_given_type(test, rg, rg_2, rg_3) + step_get_a_list_of_fields_of_a_given_type_across_all_accessible_modules(test, rg, rg_2, rg_3) + step_get_runbook_draft_content(test, rg, rg_2, rg_3) + step_get_test_job(test, rg, rg_2, rg_3) + step_list_dsc_compilation_job_streams(test, rg, rg_2, rg_3) + step_get_a_dsc_node_configuration(test, rg, rg_2, rg_3) + step_get_dsc_configuration_content(test, rg, rg_2, rg_3) + step_get_dsc_node_report_data_by_node_id_and_report_id_(test, rg, rg_2, rg_3) + step_get_job_stream(test, rg, rg_2, rg_3) + step_get_connection_type(test, rg, rg_2, rg_3) + step_get_a_dsc_compilation_job(test, rg, rg_2, rg_3) + step_get_a_python_2_package(test, rg, rg_2, rg_3) + step_get_a_source_control(test, rg, rg_2, rg_3) + step_get_a_dsc_configuration(test, rg, rg_2, rg_3) + step_list_software_update_configuration_machine_runs_for_a_specific_software_update_configuration_run(test, rg, + rg_2, rg_3) + step_list_software_update_configuration_machine_runs(test, rg, rg_2, rg_3) + step_list_activities_by_a_module(test, rg, rg_2, rg_3) + step_get_a_job_schedule(test, rg, rg_2, rg_3) + step_get_runbook_content(test, rg, rg_2, rg_3) + step_get_a_certificate(test, rg, rg_2, rg_3) + step_get_job_runbook_content(test, rg, rg_2, rg_3) + step_get_runbook_draft(test, rg, rg_2, rg_3) + step_get_a_connection(test, rg, rg_2, rg_3) + step_get_a_credential(test, rg, rg_2, rg_3) + step_get_node_s_status_counts(test, rg, rg_2, rg_3) + step_get_node_s_node_configuration_counts(test, rg, rg_2, rg_3) + step_list_software_update_configuration_machine_run_with_status_equal_to__failed_(test, rg, rg_2, rg_3) + step_list_software_update_configuration_machine_runs(test, rg, rg_2, rg_3) + step_list_dsc_reports_by_node_id_(test, rg, rg_2, rg_3) + step_get_a_variable(test, rg, rg_2, rg_3) + step_get_a_schedule(test, rg, rg_2, rg_3) + step_get_the_agent_registration_information(test, rg, rg_2, rg_3) + step_list_software_update_configurations_targeting_a_specific_azure_virtual_machine(test, rg, rg_2, rg_3) + step_list_software_update_configurations(test, rg, rg_2, rg_3) + step_get_runbook(test, rg, rg_2, rg_3) + step_list_job_streams_by_job_name(test, rg, rg_2, rg_3) + step_get_watcher(test, rg, rg_2, rg_3) + step_get_webhook(test, rg, rg_2, rg_3) + step_get_job_output(test, rg, rg_2, rg_3) + step_list_hybrid_worker_groups_by_automation_account(test, rg, rg_2, rg_3) + step_get_a_module(test, rg, rg_2, rg_3) + step_get_a_node(test, rg, rg_2, rg_3) + step_get_job(test, rg, rg_2, rg_3) + step_list_paged_dsc_node_configurations_by_automation_account_with_name_filter(test, rg, rg_2, rg_3) + step_list_dsc_node_configurations_by_automation_account(test, rg, rg_2, rg_3) + step_list_paged_dsc_node_configurations_by_automation_account_with_no_filter(test, rg, rg_2, rg_3) + step_list_python_2_packages_by_automation_account(test, rg, rg_2, rg_3) + step_get_connection_types__first_100(test, rg, rg_2, rg_3) + step_list_dsc_compilation_job_in_automation_account(test, rg, rg_2, rg_3) + step_get_connection_types__next_100(test, rg, rg_2, rg_3) + step_get_the_linked_workspace_of_an_automation_account(test, rg, rg_2, rg_3) + step_get_dsc_configuration(test, rg, rg_2, rg_3) + step_list_paged_dsc_configurations_with_name_filter(test, rg, rg_2, rg_3) + step_list_sourcecontrols(test, rg, rg_2, rg_3) + step_list_paged_dsc_configurations_with_no_filter(test, rg, rg_2, rg_3) + step_list_certificates(test, rg, rg_2, rg_3) + step_list_all_job_schedules_by_automation_account(test, rg, rg_2, rg_3) + step_list_credentials_by_automation_account__next_100(test, rg, rg_2, rg_3) + step_list_credentials_by_automation_account__first_100(test, rg, rg_2, rg_3) + step_list_connections_by_automation_account__next_100(test, rg, rg_2, rg_3) + step_list_connections_by_automation_account__first_100(test, rg, rg_2, rg_3) + step_get_statistics_of_an_automation_account(test, rg, rg_2, rg_3) + step_list_variables__first_100(test, rg, rg_2, rg_3) + step_list_variables__next_100(test, rg, rg_2, rg_3) + step_list_schedules_by_automation_account__first_100(test, rg, rg_2, rg_3) + step_list_schedules_by_automation_account__next_100(test, rg, rg_2, rg_3) + step_list_watchers_by_automation_account(test, rg, rg_2, rg_3) + step_list_runbooks_by_automation_account(test, rg, rg_2, rg_3) + step_list_webhooks_by_automation_account(test, rg, rg_2, rg_3) + step_list_modules_by_automation_account(test, rg, rg_2, rg_3) + step_get_usages_of_an_automation_account(test, rg, rg_2, rg_3) + step_list_paged_dsc_nodes_by_automation_account_with_version_filter(test, rg, rg_2, rg_3) + step_list_paged_dsc_nodes_by_automation_account_with_name_filter(test, rg, rg_2, rg_3) + step_list_paged_dsc_nodes_by_automation_account_with_no_filters(test, rg, rg_2, rg_3) + step_list_dsc_nodes_by_automation_account(test, rg, rg_2, rg_3) + step_list_paged_dsc_nodes_by_automation_account_with_node_status_filter(test, rg, rg_2, rg_3) + step_list_paged_dsc_nodes_by_automation_account_with_node_configuration_custom_filter(test, rg, rg_2, rg_3) + step_list_paged_dsc_nodes_by_automation_account_where_node_configurations_are_not_assigned_filter(test, rg, rg_2, + rg_3) + step_list_paged_dsc_nodes_with_filters_separated_by__and_(test, rg, rg_2, rg_3) + step_list_jobs_by_automation_account(test, rg, rg_2, rg_3) + step_get_automation_account(test, rg, rg_2, rg_3) + step_list_automation_accounts_by_resource_group(test, rg, rg_2, rg_3) + step_list_automation_accounts_by_resource_group(test, rg, rg_2, rg_3) + step_regenerate_registration_key(test, rg, rg_2, rg_3) + step_update_hybrid_worker_group(test, rg, rg_2, rg_3) + step_suspend_test_job(test, rg, rg_2, rg_3) + step_resume_test_job(test, rg, rg_2, rg_3) + step_stop_test_job(test, rg, rg_2, rg_3) + step_undo_draft_edit_to_last_known_published_state(test, rg, rg_2, rg_3) + step_update_a_module(test, rg, rg_2, rg_3) + step_update_a_source_control(test, rg, rg_2, rg_3) + step_create_or_update_configuration(test, rg, rg_2, rg_3) + step_update_a_certificate(test, rg, rg_2, rg_3) + step_publish_runbook_draft(test, rg, rg_2, rg_3) + step_update_a_credential(test, rg, rg_2, rg_3) + step_update_a_connection(test, rg, rg_2, rg_3) + step_start_watcher(test, rg, rg_2, rg_3) + step_start_watcher(test, rg, rg_2, rg_3) + step_update_a_variable(test, rg, rg_2, rg_3) + step_update_a_schedule(test, rg, rg_2, rg_3) + step_update_runbook(test, rg, rg_2, rg_3) + step_update_watcher(test, rg, rg_2, rg_3) + step_suspend_job(test, rg, rg_2, rg_3) + step_update_webhook(test, rg, rg_2, rg_3) + step_generate_webhook_uri(test, rg, rg_2, rg_3) + step_resume_job(test, rg, rg_2, rg_3) + step_update_a_module(test, rg, rg_2, rg_3) + step_stop_job(test, rg, rg_2, rg_3) + step_update_a_node(test, rg, rg_2, rg_3) + step_get_lists_of_an_automation_account(test, rg, rg_2, rg_3) + step_update_an_automation_account(test, rg, rg_2, rg_3) + step_delete_software_update_configuration(test, rg, rg_2, rg_3) + step_delete_a_hybrid_worker_group(test, rg, rg_2, rg_3) + step_delete_a_dsc_node_configuration(test, rg, rg_2, rg_3) + step_delete_an_existing_connection_type(test, rg, rg_2, rg_3) + step_delete_a_python_2_package(test, rg, rg_2, rg_3) + step_delete_a_source_control(test, rg, rg_2, rg_3) + step_delete_dsc_configuration(test, rg, rg_2, rg_3) + step_delete_a_job_schedule(test, rg, rg_2, rg_3) + step_delete_a_certificate(test, rg, rg_2, rg_3) + step_delete_a_credential(test, rg, rg_2, rg_3) + step_delete_an_existing_connection(test, rg, rg_2, rg_3) + step_delete_schedule(test, rg, rg_2, rg_3) + step_delete_a_variable(test, rg, rg_2, rg_3) + step_delete_webhook(test, rg, rg_2, rg_3) + step_delete_a_runbook(test, rg, rg_2, rg_3) + step_delete_watcher(test, rg, rg_2, rg_3) + step_delete_a_module(test, rg, rg_2, rg_3) + step_delete_a_dsc_node(test, rg, rg_2, rg_3) + step_delete_automation_account(test, rg, rg_2, rg_3) + cleanup(test, rg, rg_2, rg_3) + + +@try_manual +class AutomationClientScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestautomation_rg'[:7], key='rg', parameter_name='rg') + @ResourceGroupPreparer(name_prefix='clitestautomation_mygroup'[:7], key='rg_2', parameter_name='rg_2') + @ResourceGroupPreparer(name_prefix='clitestautomation_udtest'[:7], key='rg_3', parameter_name='rg_3') + def test_automation(self, rg, rg_2, rg_3): + + self.kwargs.update({ + 'myAutomationAccount9': 'myAutomationAccount9', + 'AutomationAccount_2': 'AutomationAccount_2', + 'AutomationAccount_3': 'AutomationAccount_3', + 'AutomationAccount_4': 'AutomationAccount_4', + 'AutomationAccount_5': 'AutomationAccount_5', + 'AutomationAccount_6': 'AutomationAccount_6', + 'AutomationAccount_7': 'AutomationAccount_7', + 'AutomationAccount_8': 'AutomationAccount_8', + 'AutomationAccount_9': 'AutomationAccount_9', + 'AutomationAccount_10': 'AutomationAccount_10', + 'AutomationAccount_11': 'AutomationAccount_11', + 'AutomationAccount_12': 'AutomationAccount_12', + 'AutomationAccount_13': 'AutomationAccount_13', + 'AutomationAccount_14': 'AutomationAccount_14', + 'AutomationAccount_15': 'AutomationAccount_15', + 'primary': 'primary', + 'testCert': 'testCert', + 'myCT': 'myCT', + 'myCredential': 'myCredential', + 'TestHybridGroup': 'TestHybridGroup', + 'HybridRunbookWorkerGroup_2': 'HybridRunbookWorkerGroup_2', + 'OmsCompositeResources': 'OmsCompositeResources', + 'Module_2': 'Module_2', + 'mySchedule': 'mySchedule', + 'sampleVariable': 'sampleVariable', + 'TestWebhook': 'TestWebhook', + 'MyTestWatcher': 'MyTestWatcher', + 'testpatch': 'testpatch', + 'SoftwareUpdateConfigurations_2': 'SoftwareUpdateConfigurations_2', + 'sampleSourceControl': 'sampleSourceControl', + 'SourceControl_2': 'SourceControl_2', + 'foo': 'foo', + 'Get-AzureVMTutorial': 'Get-AzureVMTutorial', + 'mysConnection': 'mysConnection', + 'Connection_2': 'Connection_2', + 'Add-AzureRmAccount': 'Add-AzureRmAccount', + }) + + call_scenario(self, rg, rg_2, rg_3) diff --git a/src/automation/azext_automation/vendored_sdks/__init__.py b/src/automation/azext_automation/vendored_sdks/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/automation/azext_automation/vendored_sdks/automation/__init__.py b/src/automation/azext_automation/vendored_sdks/automation/__init__.py new file mode 100644 index 00000000000..304a41bf5c4 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._automation_client import AutomationClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['AutomationClient'] + +try: + from .patch import patch_sdk + patch_sdk() +except ImportError: + pass diff --git a/src/automation/azext_automation/vendored_sdks/automation/_automation_client.py b/src/automation/azext_automation/vendored_sdks/automation/_automation_client.py new file mode 100644 index 00000000000..ab9e179cb4d --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/_automation_client.py @@ -0,0 +1,266 @@ +# 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 typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + +from ._configuration import AutomationClientConfiguration +from .operations import AutomationAccountOperations +from .operations import OperationOperations +from .operations import StatisticsOperations +from .operations import UsageOperations +from .operations import KeyOperations +from .operations import CertificateOperations +from .operations import ConnectionOperations +from .operations import ConnectionTypeOperations +from .operations import CredentialOperations +from .operations import DscConfigurationOperations +from .operations import HybridRunbookWorkerGroupOperations +from .operations import JobScheduleOperations +from .operations import LinkedWorkspaceOperations +from .operations import ActivityOperations +from .operations import ModuleOperations +from .operations import ObjectDataTypeOperations +from .operations import FieldOperations +from .operations import ScheduleOperations +from .operations import VariableOperations +from .operations import WebhookOperations +from .operations import WatcherOperations +from .operations import SoftwareUpdateConfigurationOperations +from .operations import SoftwareUpdateConfigurationRunOperations +from .operations import SoftwareUpdateConfigurationMachineRunOperations +from .operations import SourceControlOperations +from .operations import SourceControlSyncJobOperations +from .operations import SourceControlSyncJobStreamOperations +from .operations import JobOperations +from .operations import JobStreamOperations +from .operations import AgentRegistrationInformationOperations +from .operations import DscNodeOperations +from .operations import NodeReportOperations +from .operations import DscCompilationJobOperations +from .operations import DscCompilationJobStreamOperations +from .operations import DscNodeConfigurationOperations +from .operations import NodeCountInformationOperations +from .operations import RunbookDraftOperations +from .operations import RunbookOperations +from .operations import TestJobStreamOperations +from .operations import TestJobOperations +from .operations import Python2PackageOperations +from . import models + + +class AutomationClient(object): + """Automation Client. + + :ivar automation_account: AutomationAccountOperations operations + :vartype automation_account: azure.mgmt.automation.operations.AutomationAccountOperations + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.automation.operations.OperationOperations + :ivar statistics: StatisticsOperations operations + :vartype statistics: azure.mgmt.automation.operations.StatisticsOperations + :ivar usage: UsageOperations operations + :vartype usage: azure.mgmt.automation.operations.UsageOperations + :ivar key: KeyOperations operations + :vartype key: azure.mgmt.automation.operations.KeyOperations + :ivar certificate: CertificateOperations operations + :vartype certificate: azure.mgmt.automation.operations.CertificateOperations + :ivar connection: ConnectionOperations operations + :vartype connection: azure.mgmt.automation.operations.ConnectionOperations + :ivar connection_type: ConnectionTypeOperations operations + :vartype connection_type: azure.mgmt.automation.operations.ConnectionTypeOperations + :ivar credential: CredentialOperations operations + :vartype credential: azure.mgmt.automation.operations.CredentialOperations + :ivar dsc_configuration: DscConfigurationOperations operations + :vartype dsc_configuration: azure.mgmt.automation.operations.DscConfigurationOperations + :ivar hybrid_runbook_worker_group: HybridRunbookWorkerGroupOperations operations + :vartype hybrid_runbook_worker_group: azure.mgmt.automation.operations.HybridRunbookWorkerGroupOperations + :ivar job_schedule: JobScheduleOperations operations + :vartype job_schedule: azure.mgmt.automation.operations.JobScheduleOperations + :ivar linked_workspace: LinkedWorkspaceOperations operations + :vartype linked_workspace: azure.mgmt.automation.operations.LinkedWorkspaceOperations + :ivar activity: ActivityOperations operations + :vartype activity: azure.mgmt.automation.operations.ActivityOperations + :ivar module: ModuleOperations operations + :vartype module: azure.mgmt.automation.operations.ModuleOperations + :ivar object_data_type: ObjectDataTypeOperations operations + :vartype object_data_type: azure.mgmt.automation.operations.ObjectDataTypeOperations + :ivar field: FieldOperations operations + :vartype field: azure.mgmt.automation.operations.FieldOperations + :ivar schedule: ScheduleOperations operations + :vartype schedule: azure.mgmt.automation.operations.ScheduleOperations + :ivar variable: VariableOperations operations + :vartype variable: azure.mgmt.automation.operations.VariableOperations + :ivar webhook: WebhookOperations operations + :vartype webhook: azure.mgmt.automation.operations.WebhookOperations + :ivar watcher: WatcherOperations operations + :vartype watcher: azure.mgmt.automation.operations.WatcherOperations + :ivar software_update_configuration: SoftwareUpdateConfigurationOperations operations + :vartype software_update_configuration: azure.mgmt.automation.operations.SoftwareUpdateConfigurationOperations + :ivar software_update_configuration_run: SoftwareUpdateConfigurationRunOperations operations + :vartype software_update_configuration_run: azure.mgmt.automation.operations.SoftwareUpdateConfigurationRunOperations + :ivar software_update_configuration_machine_run: SoftwareUpdateConfigurationMachineRunOperations operations + :vartype software_update_configuration_machine_run: azure.mgmt.automation.operations.SoftwareUpdateConfigurationMachineRunOperations + :ivar source_control: SourceControlOperations operations + :vartype source_control: azure.mgmt.automation.operations.SourceControlOperations + :ivar source_control_sync_job: SourceControlSyncJobOperations operations + :vartype source_control_sync_job: azure.mgmt.automation.operations.SourceControlSyncJobOperations + :ivar source_control_sync_job_stream: SourceControlSyncJobStreamOperations operations + :vartype source_control_sync_job_stream: azure.mgmt.automation.operations.SourceControlSyncJobStreamOperations + :ivar job: JobOperations operations + :vartype job: azure.mgmt.automation.operations.JobOperations + :ivar job_stream: JobStreamOperations operations + :vartype job_stream: azure.mgmt.automation.operations.JobStreamOperations + :ivar agent_registration_information: AgentRegistrationInformationOperations operations + :vartype agent_registration_information: azure.mgmt.automation.operations.AgentRegistrationInformationOperations + :ivar dsc_node: DscNodeOperations operations + :vartype dsc_node: azure.mgmt.automation.operations.DscNodeOperations + :ivar node_report: NodeReportOperations operations + :vartype node_report: azure.mgmt.automation.operations.NodeReportOperations + :ivar dsc_compilation_job: DscCompilationJobOperations operations + :vartype dsc_compilation_job: azure.mgmt.automation.operations.DscCompilationJobOperations + :ivar dsc_compilation_job_stream: DscCompilationJobStreamOperations operations + :vartype dsc_compilation_job_stream: azure.mgmt.automation.operations.DscCompilationJobStreamOperations + :ivar dsc_node_configuration: DscNodeConfigurationOperations operations + :vartype dsc_node_configuration: azure.mgmt.automation.operations.DscNodeConfigurationOperations + :ivar node_count_information: NodeCountInformationOperations operations + :vartype node_count_information: azure.mgmt.automation.operations.NodeCountInformationOperations + :ivar runbook_draft: RunbookDraftOperations operations + :vartype runbook_draft: azure.mgmt.automation.operations.RunbookDraftOperations + :ivar runbook: RunbookOperations operations + :vartype runbook: azure.mgmt.automation.operations.RunbookOperations + :ivar test_job_stream: TestJobStreamOperations operations + :vartype test_job_stream: azure.mgmt.automation.operations.TestJobStreamOperations + :ivar test_job: TestJobOperations operations + :vartype test_job: azure.mgmt.automation.operations.TestJobOperations + :ivar python2_package: Python2PackageOperations operations + :vartype python2_package: azure.mgmt.automation.operations.Python2PackageOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = AutomationClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + 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.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.statistics = StatisticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self._config, self._serialize, self._deserialize) + self.key = KeyOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate = CertificateOperations( + self._client, self._config, self._serialize, self._deserialize) + self.connection = ConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.connection_type = ConnectionTypeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.credential = CredentialOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_configuration = DscConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hybrid_runbook_worker_group = HybridRunbookWorkerGroupOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_schedule = JobScheduleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.linked_workspace = LinkedWorkspaceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.activity = ActivityOperations( + self._client, self._config, self._serialize, self._deserialize) + self.module = ModuleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.object_data_type = ObjectDataTypeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.field = FieldOperations( + self._client, self._config, self._serialize, self._deserialize) + self.schedule = ScheduleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.variable = VariableOperations( + self._client, self._config, self._serialize, self._deserialize) + self.webhook = WebhookOperations( + self._client, self._config, self._serialize, self._deserialize) + self.watcher = WatcherOperations( + self._client, self._config, self._serialize, self._deserialize) + self.software_update_configuration = SoftwareUpdateConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.software_update_configuration_run = SoftwareUpdateConfigurationRunOperations( + self._client, self._config, self._serialize, self._deserialize) + self.software_update_configuration_machine_run = SoftwareUpdateConfigurationMachineRunOperations( + self._client, self._config, self._serialize, self._deserialize) + self.source_control = SourceControlOperations( + self._client, self._config, self._serialize, self._deserialize) + self.source_control_sync_job = SourceControlSyncJobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.source_control_sync_job_stream = SourceControlSyncJobStreamOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_stream = JobStreamOperations( + self._client, self._config, self._serialize, self._deserialize) + self.agent_registration_information = AgentRegistrationInformationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_node = DscNodeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.node_report = NodeReportOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_compilation_job = DscCompilationJobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_compilation_job_stream = DscCompilationJobStreamOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_node_configuration = DscNodeConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.node_count_information = NodeCountInformationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.runbook_draft = RunbookDraftOperations( + self._client, self._config, self._serialize, self._deserialize) + self.runbook = RunbookOperations( + self._client, self._config, self._serialize, self._deserialize) + self.test_job_stream = TestJobStreamOperations( + self._client, self._config, self._serialize, self._deserialize) + self.test_job = TestJobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.python2_package = Python2PackageOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AutomationClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/automation/azext_automation/vendored_sdks/automation/_configuration.py b/src/automation/azext_automation/vendored_sdks/automation/_configuration.py new file mode 100644 index 00000000000..e4b6e9c5a5e --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/_configuration.py @@ -0,0 +1,68 @@ +# 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 typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class AutomationClientConfiguration(Configuration): + """Configuration for AutomationClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :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 + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AutomationClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = ['https://management.azure.com/.default'] + kwargs.setdefault('sdk_moniker', 'mgmt-automation/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/automation/azext_automation/vendored_sdks/automation/_version.py b/src/automation/azext_automation/vendored_sdks/automation/_version.py new file mode 100644 index 00000000000..8761a6c8ec5 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/_version.py @@ -0,0 +1,9 @@ +# 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 = "0.1.1" diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/__init__.py b/src/automation/azext_automation/vendored_sdks/automation/aio/__init__.py new file mode 100644 index 00000000000..9f38664105b --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/__init__.py @@ -0,0 +1,10 @@ +# 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_async import AutomationClient +__all__ = ['AutomationClient'] diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/_automation_client_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/_automation_client_async.py new file mode 100644 index 00000000000..f6988b65061 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/_automation_client_async.py @@ -0,0 +1,258 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import AutomationClientConfiguration +from .operations_async import AutomationAccountOperations +from .operations_async import OperationOperations +from .operations_async import StatisticsOperations +from .operations_async import UsageOperations +from .operations_async import KeyOperations +from .operations_async import CertificateOperations +from .operations_async import ConnectionOperations +from .operations_async import ConnectionTypeOperations +from .operations_async import CredentialOperations +from .operations_async import DscConfigurationOperations +from .operations_async import HybridRunbookWorkerGroupOperations +from .operations_async import JobScheduleOperations +from .operations_async import LinkedWorkspaceOperations +from .operations_async import ActivityOperations +from .operations_async import ModuleOperations +from .operations_async import ObjectDataTypeOperations +from .operations_async import FieldOperations +from .operations_async import ScheduleOperations +from .operations_async import VariableOperations +from .operations_async import WebhookOperations +from .operations_async import WatcherOperations +from .operations_async import SoftwareUpdateConfigurationOperations +from .operations_async import SoftwareUpdateConfigurationRunOperations +from .operations_async import SoftwareUpdateConfigurationMachineRunOperations +from .operations_async import SourceControlOperations +from .operations_async import SourceControlSyncJobOperations +from .operations_async import SourceControlSyncJobStreamOperations +from .operations_async import JobOperations +from .operations_async import JobStreamOperations +from .operations_async import AgentRegistrationInformationOperations +from .operations_async import DscNodeOperations +from .operations_async import NodeReportOperations +from .operations_async import DscCompilationJobOperations +from .operations_async import DscCompilationJobStreamOperations +from .operations_async import DscNodeConfigurationOperations +from .operations_async import NodeCountInformationOperations +from .operations_async import RunbookDraftOperations +from .operations_async import RunbookOperations +from .operations_async import TestJobStreamOperations +from .operations_async import TestJobOperations +from .operations_async import Python2PackageOperations +from .. import models + + +class AutomationClient(object): + """Automation Client. + + :ivar automation_account: AutomationAccountOperations operations + :vartype automation_account: azure.mgmt.automation.aio.operations_async.AutomationAccountOperations + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.automation.aio.operations_async.OperationOperations + :ivar statistics: StatisticsOperations operations + :vartype statistics: azure.mgmt.automation.aio.operations_async.StatisticsOperations + :ivar usage: UsageOperations operations + :vartype usage: azure.mgmt.automation.aio.operations_async.UsageOperations + :ivar key: KeyOperations operations + :vartype key: azure.mgmt.automation.aio.operations_async.KeyOperations + :ivar certificate: CertificateOperations operations + :vartype certificate: azure.mgmt.automation.aio.operations_async.CertificateOperations + :ivar connection: ConnectionOperations operations + :vartype connection: azure.mgmt.automation.aio.operations_async.ConnectionOperations + :ivar connection_type: ConnectionTypeOperations operations + :vartype connection_type: azure.mgmt.automation.aio.operations_async.ConnectionTypeOperations + :ivar credential: CredentialOperations operations + :vartype credential: azure.mgmt.automation.aio.operations_async.CredentialOperations + :ivar dsc_configuration: DscConfigurationOperations operations + :vartype dsc_configuration: azure.mgmt.automation.aio.operations_async.DscConfigurationOperations + :ivar hybrid_runbook_worker_group: HybridRunbookWorkerGroupOperations operations + :vartype hybrid_runbook_worker_group: azure.mgmt.automation.aio.operations_async.HybridRunbookWorkerGroupOperations + :ivar job_schedule: JobScheduleOperations operations + :vartype job_schedule: azure.mgmt.automation.aio.operations_async.JobScheduleOperations + :ivar linked_workspace: LinkedWorkspaceOperations operations + :vartype linked_workspace: azure.mgmt.automation.aio.operations_async.LinkedWorkspaceOperations + :ivar activity: ActivityOperations operations + :vartype activity: azure.mgmt.automation.aio.operations_async.ActivityOperations + :ivar module: ModuleOperations operations + :vartype module: azure.mgmt.automation.aio.operations_async.ModuleOperations + :ivar object_data_type: ObjectDataTypeOperations operations + :vartype object_data_type: azure.mgmt.automation.aio.operations_async.ObjectDataTypeOperations + :ivar field: FieldOperations operations + :vartype field: azure.mgmt.automation.aio.operations_async.FieldOperations + :ivar schedule: ScheduleOperations operations + :vartype schedule: azure.mgmt.automation.aio.operations_async.ScheduleOperations + :ivar variable: VariableOperations operations + :vartype variable: azure.mgmt.automation.aio.operations_async.VariableOperations + :ivar webhook: WebhookOperations operations + :vartype webhook: azure.mgmt.automation.aio.operations_async.WebhookOperations + :ivar watcher: WatcherOperations operations + :vartype watcher: azure.mgmt.automation.aio.operations_async.WatcherOperations + :ivar software_update_configuration: SoftwareUpdateConfigurationOperations operations + :vartype software_update_configuration: azure.mgmt.automation.aio.operations_async.SoftwareUpdateConfigurationOperations + :ivar software_update_configuration_run: SoftwareUpdateConfigurationRunOperations operations + :vartype software_update_configuration_run: azure.mgmt.automation.aio.operations_async.SoftwareUpdateConfigurationRunOperations + :ivar software_update_configuration_machine_run: SoftwareUpdateConfigurationMachineRunOperations operations + :vartype software_update_configuration_machine_run: azure.mgmt.automation.aio.operations_async.SoftwareUpdateConfigurationMachineRunOperations + :ivar source_control: SourceControlOperations operations + :vartype source_control: azure.mgmt.automation.aio.operations_async.SourceControlOperations + :ivar source_control_sync_job: SourceControlSyncJobOperations operations + :vartype source_control_sync_job: azure.mgmt.automation.aio.operations_async.SourceControlSyncJobOperations + :ivar source_control_sync_job_stream: SourceControlSyncJobStreamOperations operations + :vartype source_control_sync_job_stream: azure.mgmt.automation.aio.operations_async.SourceControlSyncJobStreamOperations + :ivar job: JobOperations operations + :vartype job: azure.mgmt.automation.aio.operations_async.JobOperations + :ivar job_stream: JobStreamOperations operations + :vartype job_stream: azure.mgmt.automation.aio.operations_async.JobStreamOperations + :ivar agent_registration_information: AgentRegistrationInformationOperations operations + :vartype agent_registration_information: azure.mgmt.automation.aio.operations_async.AgentRegistrationInformationOperations + :ivar dsc_node: DscNodeOperations operations + :vartype dsc_node: azure.mgmt.automation.aio.operations_async.DscNodeOperations + :ivar node_report: NodeReportOperations operations + :vartype node_report: azure.mgmt.automation.aio.operations_async.NodeReportOperations + :ivar dsc_compilation_job: DscCompilationJobOperations operations + :vartype dsc_compilation_job: azure.mgmt.automation.aio.operations_async.DscCompilationJobOperations + :ivar dsc_compilation_job_stream: DscCompilationJobStreamOperations operations + :vartype dsc_compilation_job_stream: azure.mgmt.automation.aio.operations_async.DscCompilationJobStreamOperations + :ivar dsc_node_configuration: DscNodeConfigurationOperations operations + :vartype dsc_node_configuration: azure.mgmt.automation.aio.operations_async.DscNodeConfigurationOperations + :ivar node_count_information: NodeCountInformationOperations operations + :vartype node_count_information: azure.mgmt.automation.aio.operations_async.NodeCountInformationOperations + :ivar runbook_draft: RunbookDraftOperations operations + :vartype runbook_draft: azure.mgmt.automation.aio.operations_async.RunbookDraftOperations + :ivar runbook: RunbookOperations operations + :vartype runbook: azure.mgmt.automation.aio.operations_async.RunbookOperations + :ivar test_job_stream: TestJobStreamOperations operations + :vartype test_job_stream: azure.mgmt.automation.aio.operations_async.TestJobStreamOperations + :ivar test_job: TestJobOperations operations + :vartype test_job: azure.mgmt.automation.aio.operations_async.TestJobOperations + :ivar python2_package: Python2PackageOperations operations + :vartype python2_package: azure.mgmt.automation.aio.operations_async.Python2PackageOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = AutomationClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + 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.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.statistics = StatisticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self._config, self._serialize, self._deserialize) + self.key = KeyOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate = CertificateOperations( + self._client, self._config, self._serialize, self._deserialize) + self.connection = ConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.connection_type = ConnectionTypeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.credential = CredentialOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_configuration = DscConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hybrid_runbook_worker_group = HybridRunbookWorkerGroupOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_schedule = JobScheduleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.linked_workspace = LinkedWorkspaceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.activity = ActivityOperations( + self._client, self._config, self._serialize, self._deserialize) + self.module = ModuleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.object_data_type = ObjectDataTypeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.field = FieldOperations( + self._client, self._config, self._serialize, self._deserialize) + self.schedule = ScheduleOperations( + self._client, self._config, self._serialize, self._deserialize) + self.variable = VariableOperations( + self._client, self._config, self._serialize, self._deserialize) + self.webhook = WebhookOperations( + self._client, self._config, self._serialize, self._deserialize) + self.watcher = WatcherOperations( + self._client, self._config, self._serialize, self._deserialize) + self.software_update_configuration = SoftwareUpdateConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.software_update_configuration_run = SoftwareUpdateConfigurationRunOperations( + self._client, self._config, self._serialize, self._deserialize) + self.software_update_configuration_machine_run = SoftwareUpdateConfigurationMachineRunOperations( + self._client, self._config, self._serialize, self._deserialize) + self.source_control = SourceControlOperations( + self._client, self._config, self._serialize, self._deserialize) + self.source_control_sync_job = SourceControlSyncJobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.source_control_sync_job_stream = SourceControlSyncJobStreamOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_stream = JobStreamOperations( + self._client, self._config, self._serialize, self._deserialize) + self.agent_registration_information = AgentRegistrationInformationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_node = DscNodeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.node_report = NodeReportOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_compilation_job = DscCompilationJobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_compilation_job_stream = DscCompilationJobStreamOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dsc_node_configuration = DscNodeConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.node_count_information = NodeCountInformationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.runbook_draft = RunbookDraftOperations( + self._client, self._config, self._serialize, self._deserialize) + self.runbook = RunbookOperations( + self._client, self._config, self._serialize, self._deserialize) + self.test_job_stream = TestJobStreamOperations( + self._client, self._config, self._serialize, self._deserialize) + self.test_job = TestJobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.python2_package = Python2PackageOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AutomationClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/_configuration_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/_configuration_async.py new file mode 100644 index 00000000000..742bb26dcf5 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/_configuration_async.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 typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class AutomationClientConfiguration(Configuration): + """Configuration for AutomationClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :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 + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AutomationClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = ['https://management.azure.com/.default'] + kwargs.setdefault('sdk_moniker', 'mgmt-automation/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/__init__.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/__init__.py new file mode 100644 index 00000000000..748f3450dcf --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/__init__.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 ._automation_account_operations_async import AutomationAccountOperations +from ._operation_operations_async import OperationOperations +from ._statistics_operations_async import StatisticsOperations +from ._usage_operations_async import UsageOperations +from ._key_operations_async import KeyOperations +from ._certificate_operations_async import CertificateOperations +from ._connection_operations_async import ConnectionOperations +from ._connection_type_operations_async import ConnectionTypeOperations +from ._credential_operations_async import CredentialOperations +from ._dsc_configuration_operations_async import DscConfigurationOperations +from ._hybrid_runbook_worker_group_operations_async import HybridRunbookWorkerGroupOperations +from ._job_schedule_operations_async import JobScheduleOperations +from ._linked_workspace_operations_async import LinkedWorkspaceOperations +from ._activity_operations_async import ActivityOperations +from ._module_operations_async import ModuleOperations +from ._object_data_type_operations_async import ObjectDataTypeOperations +from ._field_operations_async import FieldOperations +from ._schedule_operations_async import ScheduleOperations +from ._variable_operations_async import VariableOperations +from ._webhook_operations_async import WebhookOperations +from ._watcher_operations_async import WatcherOperations +from ._software_update_configuration_operations_async import SoftwareUpdateConfigurationOperations +from ._software_update_configuration_run_operations_async import SoftwareUpdateConfigurationRunOperations +from ._software_update_configuration_machine_run_operations_async import SoftwareUpdateConfigurationMachineRunOperations +from ._source_control_operations_async import SourceControlOperations +from ._source_control_sync_job_operations_async import SourceControlSyncJobOperations +from ._source_control_sync_job_stream_operations_async import SourceControlSyncJobStreamOperations +from ._job_operations_async import JobOperations +from ._job_stream_operations_async import JobStreamOperations +from ._agent_registration_information_operations_async import AgentRegistrationInformationOperations +from ._dsc_node_operations_async import DscNodeOperations +from ._node_report_operations_async import NodeReportOperations +from ._dsc_compilation_job_operations_async import DscCompilationJobOperations +from ._dsc_compilation_job_stream_operations_async import DscCompilationJobStreamOperations +from ._dsc_node_configuration_operations_async import DscNodeConfigurationOperations +from ._node_count_information_operations_async import NodeCountInformationOperations +from ._runbook_draft_operations_async import RunbookDraftOperations +from ._runbook_operations_async import RunbookOperations +from ._test_job_stream_operations_async import TestJobStreamOperations +from ._test_job_operations_async import TestJobOperations +from ._python2_package_operations_async import Python2PackageOperations + +__all__ = [ + 'AutomationAccountOperations', + 'OperationOperations', + 'StatisticsOperations', + 'UsageOperations', + 'KeyOperations', + 'CertificateOperations', + 'ConnectionOperations', + 'ConnectionTypeOperations', + 'CredentialOperations', + 'DscConfigurationOperations', + 'HybridRunbookWorkerGroupOperations', + 'JobScheduleOperations', + 'LinkedWorkspaceOperations', + 'ActivityOperations', + 'ModuleOperations', + 'ObjectDataTypeOperations', + 'FieldOperations', + 'ScheduleOperations', + 'VariableOperations', + 'WebhookOperations', + 'WatcherOperations', + 'SoftwareUpdateConfigurationOperations', + 'SoftwareUpdateConfigurationRunOperations', + 'SoftwareUpdateConfigurationMachineRunOperations', + 'SourceControlOperations', + 'SourceControlSyncJobOperations', + 'SourceControlSyncJobStreamOperations', + 'JobOperations', + 'JobStreamOperations', + 'AgentRegistrationInformationOperations', + 'DscNodeOperations', + 'NodeReportOperations', + 'DscCompilationJobOperations', + 'DscCompilationJobStreamOperations', + 'DscNodeConfigurationOperations', + 'NodeCountInformationOperations', + 'RunbookDraftOperations', + 'RunbookOperations', + 'TestJobStreamOperations', + 'TestJobOperations', + 'Python2PackageOperations', +] diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_activity_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_activity_operations_async.py new file mode 100644 index 00000000000..ce2440f5bc5 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_activity_operations_async.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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ActivityOperations: + """ActivityOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + module_name: str, + activity_name: str, + **kwargs + ) -> "models.Activity": + """Retrieve the activity in the module identified by module name and activity name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param activity_name: The name of activity. + :type activity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Activity or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Activity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Activity"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'activityName': self._serialize.url("activity_name", activity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Activity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}'} + + def list_by_module( + self, + resource_group_name: str, + automation_account_name: str, + module_name: str, + **kwargs + ) -> "models.ActivityListResult": + """Retrieve a list of activities in the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ActivityListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ActivityListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_module.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ActivityListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_agent_registration_information_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_agent_registration_information_operations_async.py new file mode 100644 index 00000000000..455785bd179 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_agent_registration_information_operations_async.py @@ -0,0 +1,164 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AgentRegistrationInformationOperations: + """AgentRegistrationInformationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.AgentRegistration": + """Retrieve the automation agent registration information. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentRegistration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AgentRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentRegistration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation'} + + async def regenerate_key( + self, + resource_group_name: str, + automation_account_name: str, + key_name: Union[str, "models.AgentRegistrationKeyName"], + **kwargs + ) -> "models.AgentRegistration": + """Regenerate a primary or secondary agent registration key. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param key_name: Gets or sets the agent registration key name - primary or secondary. + :type key_name: str or ~azure.mgmt.automation.models.AgentRegistrationKeyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentRegistration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AgentRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentRegistration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.AgentRegistrationRegenerateKeyParameter(key_name=key_name) + api_version = "2018-01-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'AgentRegistrationRegenerateKeyParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_automation_account_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_automation_account_operations_async.py new file mode 100644 index 00000000000..dfa01a5eb75 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_automation_account_operations_async.py @@ -0,0 +1,439 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AutomationAccountOperations: + """AutomationAccountOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + **kwargs + ) -> "models.AutomationAccount": + """Update an automation account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param 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] + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccount or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.AutomationAccountUpdateParameters(name=name, location=location, tags=tags, sku=sku) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'AutomationAccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutomationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + **kwargs + ) -> "models.AutomationAccount": + """Create or update automation account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param 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] + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccount or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccount or ~azure.mgmt.automation.models.AutomationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.AutomationAccountCreateOrUpdateParameters(name=name, location=location, tags=tags, sku=sku) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'AutomationAccountCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AutomationAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AutomationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> None: + """Delete an automation account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.AutomationAccount": + """Get information about an Automation Account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccount or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutomationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> "models.AutomationAccountListResult": + """Retrieve a list of accounts within a given resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccountListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccountListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccountListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AutomationAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts'} + + def list( + self, + **kwargs + ) -> "models.AutomationAccountListResult": + """Retrieve a list of accounts within a given subscription. + + Lists the Automation Accounts within an Azure subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccountListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccountListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccountListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AutomationAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_certificate_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_certificate_operations_async.py new file mode 100644 index 00000000000..98d71283bed --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_certificate_operations_async.py @@ -0,0 +1,391 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificateOperations: + """CertificateOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + certificate_name: str, + **kwargs + ) -> None: + """Delete the certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The name of certificate. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + certificate_name: str, + **kwargs + ) -> "models.Certificate": + """Retrieve the certificate identified by certificate name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The name of certificate. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Certificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + certificate_name: str, + name: str, + base64_value: str, + description: Optional[str] = None, + thumbprint: Optional[str] = None, + is_exportable: Optional[bool] = None, + **kwargs + ) -> "models.Certificate": + """Create a certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The parameters supplied to the create or update certificate operation. + :type certificate_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Certificate or ~azure.mgmt.automation.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Certificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.CertificateCreateOrUpdateParameters(name=name, base64_value=base64_value, description=description, thumbprint=thumbprint, is_exportable=is_exportable) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'CertificateCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Certificate', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + certificate_name: str, + name: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ) -> "models.Certificate": + """Update a certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The parameters supplied to the update certificate operation. + :type certificate_name: str + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Certificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.CertificateUpdateParameters(name=name, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'CertificateUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.CertificateListResult": + """Retrieve a list of certificates. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.CertificateListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_connection_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_connection_operations_async.py new file mode 100644 index 00000000000..9fd156cfd4a --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_connection_operations_async.py @@ -0,0 +1,397 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ConnectionOperations: + """ConnectionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + connection_name: str, + **kwargs + ) -> "models.Connection": + """Delete the connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The name of connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Connection or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Connection or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Connection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Connection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + connection_name: str, + **kwargs + ) -> "models.Connection": + """Retrieve the connection identified by connection name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The name of connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Connection or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Connection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Connection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Connection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + connection_name: str, + name: str, + connection_type: "models.ConnectionTypeAssociationProperty", + description: Optional[str] = None, + field_definition_values: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.Connection": + """Create or update a connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The parameters supplied to the create or update connection operation. + :type connection_name: str + :param name: Gets or sets the name of the connection. + :type name: str + :param connection_type: Gets or sets the connectionType of the connection. + :type connection_type: ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :param description: Gets or sets the description of the connection. + :type description: str + :param field_definition_values: Gets or sets the field definition properties of the connection. + :type field_definition_values: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Connection or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Connection or ~azure.mgmt.automation.models.Connection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Connection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ConnectionCreateOrUpdateParameters(name=name, description=description, connection_type=connection_type, field_definition_values=field_definition_values) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ConnectionCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Connection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Connection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + connection_name: str, + name: Optional[str] = None, + description: Optional[str] = None, + field_definition_values: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.Connection": + """Update a connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The parameters supplied to the update a connection operation. + :type connection_name: str + :param 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] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Connection or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Connection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Connection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ConnectionUpdateParameters(name=name, description=description, field_definition_values=field_definition_values) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ConnectionUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Connection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.ConnectionListResult": + """Retrieve a list of connections. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_connection_type_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_connection_type_operations_async.py new file mode 100644 index 00000000000..f5910a840b7 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_connection_type_operations_async.py @@ -0,0 +1,312 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ConnectionTypeOperations: + """ConnectionTypeOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + connection_type_name: str, + **kwargs + ) -> None: + """Delete the connection type. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_type_name: The name of connection type. + :type connection_type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + connection_type_name: str, + **kwargs + ) -> "models.ConnectionType": + """Retrieve the connection type identified by connection type name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_type_name: The name of connection type. + :type connection_type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionType or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ConnectionType + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionType"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionType', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + connection_type_name: str, + name: str, + field_definitions: Dict[str, "FieldDefinition"], + is_global: Optional[bool] = None, + **kwargs + ) -> "models.ConnectionType": + """Create a connection type. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_type_name: The parameters supplied to the create or update connection type + operation. + :type connection_type_name: str + :param name: Gets or sets the name of the connection type. + :type name: str + :param field_definitions: Gets or sets the field definitions of the connection type. + :type field_definitions: dict[str, ~azure.mgmt.automation.models.FieldDefinition] + :param is_global: Gets or sets a Boolean value to indicate if the connection type is global. + :type is_global: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionType or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ConnectionType or ~azure.mgmt.automation.models.ConnectionType + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionType"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ConnectionTypeCreateOrUpdateParameters(name=name, is_global=is_global, field_definitions=field_definitions) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ConnectionTypeCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('ConnectionType', pipeline_response) + + if response.status_code == 409: + deserialized = self._deserialize('ConnectionType', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.ConnectionTypeListResult": + """Retrieve a list of connection types. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionTypeListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ConnectionTypeListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionTypeListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ConnectionTypeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_credential_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_credential_operations_async.py new file mode 100644 index 00000000000..fa6ab55b65a --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_credential_operations_async.py @@ -0,0 +1,393 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CredentialOperations: + """CredentialOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + credential_name: str, + **kwargs + ) -> None: + """Delete the credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The name of credential. + :type credential_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + credential_name: str, + **kwargs + ) -> "models.Credential": + """Retrieve the credential identified by credential name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The name of credential. + :type credential_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Credential or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Credential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Credential"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Credential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + credential_name: str, + name: str, + user_name: str, + password: str, + description: Optional[str] = None, + **kwargs + ) -> "models.Credential": + """Create a credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The parameters supplied to the create or update credential operation. + :type credential_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Credential or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Credential or ~azure.mgmt.automation.models.Credential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Credential"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.CredentialCreateOrUpdateParameters(name=name, user_name=user_name, password=password, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'CredentialCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Credential', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Credential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + credential_name: str, + name: Optional[str] = None, + user_name: Optional[str] = None, + password: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ) -> "models.Credential": + """Update a credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The parameters supplied to the Update credential operation. + :type credential_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Credential or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Credential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Credential"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.CredentialUpdateParameters(name=name, user_name=user_name, password=password, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'CredentialUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Credential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.CredentialListResult": + """Retrieve a list of credentials. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.CredentialListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CredentialListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CredentialListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_compilation_job_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_compilation_job_operations_async.py new file mode 100644 index 00000000000..ac1522891fd --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_compilation_job_operations_async.py @@ -0,0 +1,381 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DscCompilationJobOperations: + """DscCompilationJobOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + automation_account_name: str, + compilation_job_name: str, + configuration: "models.DscConfigurationAssociationProperty", + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + parameters: Optional[Dict[str, str]] = None, + increment_node_configuration_build: Optional[bool] = None, + **kwargs + ) -> "models.DscCompilationJob": + cls = kwargs.pop('cls', None) # type: ClsType["models.DscCompilationJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DscCompilationJobCreateParameters(name=name, location=location, tags=tags, configuration=configuration, parameters=parameters, increment_node_configuration_build=increment_node_configuration_build) + api_version = "2018-01-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobName': self._serialize.url("compilation_job_name", compilation_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DscCompilationJobCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscCompilationJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + async def create( + self, + resource_group_name: str, + automation_account_name: str, + compilation_job_name: str, + configuration: "models.DscConfigurationAssociationProperty", + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + parameters: Optional[Dict[str, str]] = None, + increment_node_configuration_build: Optional[bool] = None, + **kwargs + ) -> "models.DscCompilationJob": + """Creates the Dsc compilation job of the configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param compilation_job_name: The DSC configuration Id. + :type compilation_job_name: str + :param configuration: Gets or sets the configuration. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :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] + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns DscCompilationJob + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.automation.models.DscCompilationJob] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DscCompilationJob"] + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + compilation_job_name=compilation_job_name, + configuration=configuration, + name=name, + location=location, + tags=tags, + parameters=parameters, + increment_node_configuration_build=increment_node_configuration_build, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DscCompilationJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + compilation_job_name: str, + **kwargs + ) -> "models.DscCompilationJob": + """Retrieve the Dsc configuration compilation job identified by job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param compilation_job_name: The DSC configuration Id. + :type compilation_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscCompilationJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscCompilationJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscCompilationJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobName': self._serialize.url("compilation_job_name", compilation_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscCompilationJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.DscCompilationJobListResult": + """Retrieve a list of dsc compilation jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscCompilationJobListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscCompilationJobListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscCompilationJobListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DscCompilationJobListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs'} + + async def get_stream( + self, + resource_group_name: str, + automation_account_name: str, + job_id: str, + job_stream_id: str, + **kwargs + ) -> "models.JobStream": + """Retrieve the job stream identified by job stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_id: The job id. + :type job_id: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStream or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStream + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStream"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get_stream.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobStream', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_stream.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_compilation_job_stream_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_compilation_job_stream_operations_async.py new file mode 100644 index 00000000000..c8b27aee787 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_compilation_job_stream_operations_async.py @@ -0,0 +1,101 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DscCompilationJobStreamOperations: + """DscCompilationJobStreamOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_by_job( + self, + resource_group_name: str, + automation_account_name: str, + job_id: str, + **kwargs + ) -> "models.JobStreamListResult": + """Retrieve all the job streams for the compilation Job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_id: The job id. + :type job_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStreamListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStreamListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStreamListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobStreamListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_configuration_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_configuration_operations_async.py new file mode 100644 index 00000000000..d570d9b4ff8 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_configuration_operations_async.py @@ -0,0 +1,497 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DscConfigurationOperations: + """DscConfigurationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + configuration_name: str, + **kwargs + ) -> None: + """Delete the dsc configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + configuration_name: str, + **kwargs + ) -> "models.DscConfiguration": + """Retrieve the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + configuration_name: str, + source: "models.ContentSource", + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + parameters: Optional[Dict[str, "DscConfigurationParameter"]] = None, + description: Optional[str] = None, + **kwargs + ) -> "models.DscConfiguration": + """Create the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The create or update parameters for configuration. + :type configuration_name: str + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :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] + :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 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscConfiguration or ~azure.mgmt.automation.models.DscConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DscConfigurationCreateOrUpdateParameters(name=name, location=location, tags=tags, log_verbose=log_verbose, log_progress=log_progress, source=source, parameters=parameters, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DscConfigurationCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DscConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + configuration_name: str, + name: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + source: Optional["models.ContentSource"] = None, + parameters: Optional[Dict[str, "DscConfigurationParameter"]] = None, + description: Optional[str] = None, + **kwargs + ) -> "models.DscConfiguration": + """Create the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The create or update parameters for configuration. + :type configuration_name: str + :param name: Gets or sets name of the resource. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DscConfigurationUpdateParameters(name=name, tags=tags, log_verbose=log_verbose, log_progress=log_progress, source=source, parameters=parameters, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + if _parameters is not None: + body_content = self._serialize.body(_parameters, 'DscConfigurationUpdateParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + async def get_content( + self, + resource_group_name: str, + automation_account_name: str, + configuration_name: str, + **kwargs + ) -> str: + """Retrieve the configuration script identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'text/powershell' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + inlinecount: Optional[str] = None, + **kwargs + ) -> "models.DscConfigurationListResult": + """Retrieve a list of configurations. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param skip: The number of rows to skip. + :type skip: int + :param top: The number of rows to take. + :type top: int + :param inlinecount: Return total rows. + :type inlinecount: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscConfigurationListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscConfigurationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscConfigurationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if inlinecount is not None: + query_parameters['$inlinecount'] = self._serialize.query("inlinecount", inlinecount, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DscConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_node_configuration_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_node_configuration_operations_async.py new file mode 100644 index 00000000000..b563674cf29 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_node_configuration_operations_async.py @@ -0,0 +1,385 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DscNodeConfigurationOperations: + """DscNodeConfigurationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + node_configuration_name: str, + **kwargs + ) -> None: + """Delete the Dsc node configurations by node configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + node_configuration_name: str, + **kwargs + ) -> "models.DscNodeConfiguration": + """Retrieve the Dsc node configurations by node configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNodeConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + async def _create_or_update_initial( + self, + resource_group_name: str, + automation_account_name: str, + node_configuration_name: str, + name: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + source: Optional["models.ContentSource"] = None, + configuration: Optional["models.DscConfigurationAssociationProperty"] = None, + increment_node_configuration_build: Optional[bool] = None, + **kwargs + ) -> "models.DscNodeConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DscNodeConfigurationCreateOrUpdateParameters(name=name, tags=tags, source=source, configuration=configuration, increment_node_configuration_build=increment_node_configuration_build) + api_version = "2018-01-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DscNodeConfigurationCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('DscNodeConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + node_configuration_name: str, + name: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + source: Optional["models.ContentSource"] = None, + configuration: Optional["models.DscConfigurationAssociationProperty"] = None, + increment_node_configuration_build: Optional[bool] = None, + **kwargs + ) -> "models.DscNodeConfiguration": + """Create the node configuration identified by node configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :param name: Name of the node configuration. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param configuration: Gets or sets the configuration of the node. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeConfiguration"] + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_configuration_name=node_configuration_name, + name=name, + tags=tags, + source=source, + configuration=configuration, + increment_node_configuration_build=increment_node_configuration_build, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DscNodeConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + inlinecount: Optional[str] = None, + **kwargs + ) -> "models.DscNodeConfigurationListResult": + """Retrieve a list of dsc node configurations. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param skip: The number of rows to skip. + :type skip: int + :param top: The number of rows to take. + :type top: int + :param inlinecount: Return total rows. + :type inlinecount: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeConfigurationListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeConfigurationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeConfigurationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if inlinecount is not None: + query_parameters['$inlinecount'] = self._serialize.query("inlinecount", inlinecount, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DscNodeConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_node_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_node_operations_async.py new file mode 100644 index 00000000000..da6d64e2f42 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_dsc_node_operations_async.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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DscNodeOperations: + """DscNodeOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + node_id: str, + **kwargs + ) -> "models.DscNode": + """Delete the dsc node identified by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The node id. + :type node_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNode or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNode"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + node_id: str, + **kwargs + ) -> "models.DscNode": + """Retrieve the dsc node identified by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The node id. + :type node_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNode or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNode"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + node_id: str, + dsc_node_update_parameters_node_id: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ) -> "models.DscNode": + """Update the dsc node. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: Parameters supplied to the update dsc node. + :type node_id: str + :param dsc_node_update_parameters_node_id: Gets or sets the id of the dsc node. + :type dsc_node_update_parameters_node_id: str + :param name: Gets or sets the name of the dsc node configuration. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNode or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNode"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _dsc_node_update_parameters = models.DscNodeUpdateParameters(node_id=dsc_node_update_parameters_node_id, name=name) + api_version = "2018-01-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_dsc_node_update_parameters, 'DscNodeUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + inlinecount: Optional[str] = None, + **kwargs + ) -> "models.DscNodeListResult": + """Retrieve a list of dsc nodes. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param skip: The number of rows to skip. + :type skip: int + :param top: The number of rows to take. + :type top: int + :param inlinecount: Return total rows. + :type inlinecount: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if inlinecount is not None: + query_parameters['$inlinecount'] = self._serialize.query("inlinecount", inlinecount, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DscNodeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_field_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_field_operations_async.py new file mode 100644 index 00000000000..da809f8bb9c --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_field_operations_async.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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FieldOperations: + """FieldOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_type( + self, + resource_group_name: str, + automation_account_name: str, + module_name: str, + type_name: str, + **kwargs + ) -> "models.TypeFieldListResult": + """Retrieve a list of fields of a given type identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param type_name: The name of type. + :type type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TypeFieldListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TypeFieldListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TypeFieldListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TypeFieldListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_hybrid_runbook_worker_group_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_hybrid_runbook_worker_group_operations_async.py new file mode 100644 index 00000000000..5b29ba5030f --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_hybrid_runbook_worker_group_operations_async.py @@ -0,0 +1,305 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class HybridRunbookWorkerGroupOperations: + """HybridRunbookWorkerGroupOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + hybrid_runbook_worker_group_name: str, + **kwargs + ) -> None: + """Delete a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. + :type hybrid_runbook_worker_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + hybrid_runbook_worker_group_name: str, + **kwargs + ) -> "models.HybridRunbookWorkerGroup": + """Retrieve a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. + :type hybrid_runbook_worker_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridRunbookWorkerGroup or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridRunbookWorkerGroup"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridRunbookWorkerGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + hybrid_runbook_worker_group_name: str, + credential: Optional["models.RunAsCredentialAssociationProperty"] = None, + **kwargs + ) -> "models.HybridRunbookWorkerGroup": + """Update a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. + :type hybrid_runbook_worker_group_name: str + :param credential: Sets the credential of a worker group. + :type credential: ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridRunbookWorkerGroup or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridRunbookWorkerGroup"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.HybridRunbookWorkerGroupUpdateParameters(credential=credential) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'HybridRunbookWorkerGroupUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridRunbookWorkerGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.HybridRunbookWorkerGroupsListResult": + """Retrieve a list of hybrid runbook worker groups. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridRunbookWorkerGroupsListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroupsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridRunbookWorkerGroupsListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HybridRunbookWorkerGroupsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_job_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_job_operations_async.py new file mode 100644 index 00000000000..fc984265c41 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_job_operations_async.py @@ -0,0 +1,583 @@ +# 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 typing import Any, Callable, Dict, Generic, IO, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobOperations: + """JobOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_output( + self, + resource_group_name: str, + automation_account_name: str, + job_name: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> str: + """Retrieve the job output identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The name of the job to be created. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_output.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'text/plain' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_output.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output'} + + async def get_runbook_content( + self, + resource_group_name: str, + automation_account_name: str, + job_name: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> IO: + """Retrieve the runbook content of the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_runbook_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_runbook_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent'} + + async def suspend( + self, + resource_group_name: str, + automation_account_name: str, + job_name: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> None: + """Suspend the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.suspend.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend'} + + async def stop( + self, + resource_group_name: str, + automation_account_name: str, + job_name: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> None: + """Stop the job identified by jobName. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + job_name: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> "models.Job": + """Retrieve the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Job or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Job"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Job', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'} + + async def create( + self, + resource_group_name: str, + automation_account_name: str, + job_name: str, + client_request_id: Optional[str] = None, + runbook: Optional["models.RunbookAssociationProperty"] = None, + parameters: Optional[Dict[str, str]] = None, + run_on: Optional[str] = None, + **kwargs + ) -> "models.Job": + """Create a job of the runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Job or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Job"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.JobCreateParameters(runbook=runbook, parameters=parameters, run_on=run_on) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'JobCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Job', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + client_request_id: Optional[str] = None, + **kwargs + ) -> "models.JobListResultV2": + """Retrieve a list of jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobListResultV2 or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobListResultV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobListResultV2"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobListResultV2', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs'} + + async def resume( + self, + resource_group_name: str, + automation_account_name: str, + job_name: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> None: + """Resume the job identified by jobName. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.resume.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_job_schedule_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_job_schedule_operations_async.py new file mode 100644 index 00000000000..6f7513c82f2 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_job_schedule_operations_async.py @@ -0,0 +1,314 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobScheduleOperations: + """JobScheduleOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + job_schedule_id: str, + **kwargs + ) -> None: + """Delete the job schedule identified by job schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + job_schedule_id: str, + **kwargs + ) -> "models.JobSchedule": + """Retrieve the job schedule identified by job schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobSchedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobSchedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobSchedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + async def create( + self, + resource_group_name: str, + automation_account_name: str, + job_schedule_id: str, + schedule: "models.ScheduleAssociationProperty", + runbook: "models.RunbookAssociationProperty", + run_on: Optional[str] = None, + parameters: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.JobSchedule": + """Create a job schedule. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :param 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] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobSchedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobSchedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobSchedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.JobScheduleCreateParameters(schedule=schedule, runbook=runbook, run_on=run_on, parameters=parameters) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'JobScheduleCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.JobScheduleListResult": + """Retrieve a list of job schedules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobScheduleListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobScheduleListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobScheduleListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobScheduleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_job_stream_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_job_stream_operations_async.py new file mode 100644 index 00000000000..39db14a2b81 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_job_stream_operations_async.py @@ -0,0 +1,196 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobStreamOperations: + """JobStreamOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + job_name: str, + job_stream_id: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> "models.JobStream": + """Retrieve the job stream identified by job stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStream or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStream + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStream"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobStream', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}'} + + def list_by_job( + self, + resource_group_name: str, + automation_account_name: str, + job_name: str, + filter: Optional[str] = None, + client_request_id: Optional[str] = None, + **kwargs + ) -> "models.JobStreamListResult": + """Retrieve a list of jobs streams identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStreamListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStreamListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStreamListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobStreamListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_key_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_key_operations_async.py new file mode 100644 index 00000000000..911155f77cd --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_key_operations_async.py @@ -0,0 +1,97 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class KeyOperations: + """KeyOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.KeyListResult": + """Retrieve the automation keys for an account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.KeyListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('KeyListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_linked_workspace_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_linked_workspace_operations_async.py new file mode 100644 index 00000000000..6faee18d4d1 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_linked_workspace_operations_async.py @@ -0,0 +1,97 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LinkedWorkspaceOperations: + """LinkedWorkspaceOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.LinkedWorkspace": + """Retrieve the linked workspace for the account id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LinkedWorkspace or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.LinkedWorkspace + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LinkedWorkspace"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LinkedWorkspace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_module_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_module_operations_async.py new file mode 100644 index 00000000000..eb794f924d7 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_module_operations_async.py @@ -0,0 +1,394 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ModuleOperations: + """ModuleOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + module_name: str, + **kwargs + ) -> None: + """Delete the module by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The module name. + :type module_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + module_name: str, + **kwargs + ) -> "models.Module": + """Retrieve the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The module name. + :type module_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + module_name: str, + content_link: "models.ContentLink", + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.Module": + """Create or Update the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param 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] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module or ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ModuleCreateOrUpdateParameters(name=name, location=location, tags=tags, content_link=content_link) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ModuleCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + module_name: str, + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + content_link: Optional["models.ContentLink"] = None, + **kwargs + ) -> "models.Module": + """Update the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param 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] + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ModuleUpdateParameters(name=name, location=location, tags=tags, content_link=content_link) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ModuleUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.ModuleListResult": + """Retrieve a list of modules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ModuleListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ModuleListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ModuleListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ModuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_node_count_information_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_node_count_information_operations_async.py new file mode 100644 index 00000000000..83cb3acad37 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_node_count_information_operations_async.py @@ -0,0 +1,101 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NodeCountInformationOperations: + """NodeCountInformationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + count_type: Union[str, "models.CountType"], + **kwargs + ) -> "models.NodeCounts": + """Retrieve counts for Dsc Nodes. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param count_type: The type of counts to retrieve. + :type count_type: str or ~azure.mgmt.automation.models.CountType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NodeCounts or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.NodeCounts + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NodeCounts"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'countType': self._serialize.url("count_type", count_type, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NodeCounts', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodecounts/{countType}'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_node_report_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_node_report_operations_async.py new file mode 100644 index 00000000000..06eec2897ae --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_node_report_operations_async.py @@ -0,0 +1,250 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NodeReportOperations: + """NodeReportOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_node( + self, + resource_group_name: str, + automation_account_name: str, + node_id: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.DscNodeReportListResult": + """Retrieve the Dsc node report list by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The parameters supplied to the list operation. + :type node_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeReportListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeReportListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeReportListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_node.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DscNodeReportListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + node_id: str, + report_id: str, + **kwargs + ) -> "models.DscNodeReport": + """Retrieve the Dsc node report data by node id and report id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The Dsc node id. + :type node_id: str + :param report_id: The report id. + :type report_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeReport or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeReport + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeReport"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNodeReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}'} + + async def get_content( + self, + resource_group_name: str, + automation_account_name: str, + node_id: str, + report_id: str, + **kwargs + ) -> object: + """Retrieve the Dsc node reports by node id and report id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The Dsc node id. + :type node_id: str + :param report_id: The report id. + :type report_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_object_data_type_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_object_data_type_operations_async.py new file mode 100644 index 00000000000..58543041731 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_object_data_type_operations_async.py @@ -0,0 +1,196 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ObjectDataTypeOperations: + """ObjectDataTypeOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_field_by_module_and_type( + self, + resource_group_name: str, + automation_account_name: str, + module_name: str, + type_name: str, + **kwargs + ) -> "models.TypeFieldListResult": + """Retrieve a list of fields of a given type identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param type_name: The name of type. + :type type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TypeFieldListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TypeFieldListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TypeFieldListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_field_by_module_and_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TypeFieldListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_field_by_module_and_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields'} + + def list_field_by_type( + self, + resource_group_name: str, + automation_account_name: str, + type_name: str, + **kwargs + ) -> "models.TypeFieldListResult": + """Retrieve a list of fields of a given type across all accessible modules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param type_name: The name of type. + :type type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TypeFieldListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TypeFieldListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TypeFieldListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_field_by_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TypeFieldListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_field_by_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_operation_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_operation_operations_async.py new file mode 100644 index 00000000000..b40bf457868 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_operation_operations_async.py @@ -0,0 +1,101 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> "models.OperationListResult": + """Lists all of the available Automation REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.OperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Automation/operations'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_python2_package_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_python2_package_operations_async.py new file mode 100644 index 00000000000..4fba7dd1c85 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_python2_package_operations_async.py @@ -0,0 +1,379 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Python2PackageOperations: + """Python2PackageOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + package_name: str, + **kwargs + ) -> None: + """Delete the python 2 package by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The python package name. + :type package_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + package_name: str, + **kwargs + ) -> "models.Module": + """Retrieve the python 2 package identified by package name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The python package name. + :type package_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + package_name: str, + content_link: "models.ContentLink", + tags: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.Module": + """Create or Update the python 2 package identified by package name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The name of python package. + :type package_name: str + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module or ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.PythonPackageCreateParameters(tags=tags, content_link=content_link) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'PythonPackageCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + package_name: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.Module": + """Update the python 2 package identified by package name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The name of python package. + :type package_name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.PythonPackageUpdateParameters(tags=tags) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'PythonPackageUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.ModuleListResult": + """Retrieve a list of python 2 packages. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ModuleListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ModuleListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ModuleListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ModuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_runbook_draft_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_runbook_draft_operations_async.py new file mode 100644 index 00000000000..50a90b9a361 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_runbook_draft_operations_async.py @@ -0,0 +1,337 @@ +# 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 typing import Any, Callable, Dict, Generic, IO, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RunbookDraftOperations: + """RunbookDraftOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_content( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> str: + """Retrieve the content of runbook draft identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'text/powershell' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + async def _replace_content_initial( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + runbook_content: str, + **kwargs + ) -> IO: + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "text/powershell") + + # Construct URL + url = self._replace_content_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(runbook_content, 'str') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if response.status_code == 202: + response_headers['location']=self._deserialize('str', response.headers.get('location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _replace_content_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + async def replace_content( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + runbook_content: str, + **kwargs + ) -> IO: + """Replaces the runbook draft content. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param runbook_content: The runbook draft content. + :type runbook_content: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns + :rtype: ~azure.core.polling.LROPoller[IO] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[IO] + raw_result = await self._replace_content_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + runbook_content=runbook_content, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + replace_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> "models.RunbookDraft": + """Retrieve the runbook draft identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunbookDraft or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.RunbookDraft + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunbookDraft"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RunbookDraft', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft'} + + async def undo_edit( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> "models.RunbookDraftUndoEditResult": + """Undo draft edit to last known published state identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunbookDraftUndoEditResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.RunbookDraftUndoEditResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunbookDraftUndoEditResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.undo_edit.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RunbookDraftUndoEditResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + undo_edit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_runbook_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_runbook_operations_async.py new file mode 100644 index 00000000000..401a61185ed --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_runbook_operations_async.py @@ -0,0 +1,576 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RunbookOperations: + """RunbookOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _publish_initial( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self._publish_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['location']=self._deserialize('str', response.headers.get('location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _publish_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/publish'} + + async def publish( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> None: + """Publish runbook draft. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the publish runbook operation. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._publish_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + publish.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/publish'} + + async def get_content( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> str: + """Retrieve the content of runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'text/powershell' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> "models.Runbook": + """Retrieve the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Runbook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Runbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Runbook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Runbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + runbook_type: Union[str, "models.RunbookTypeEnum"], + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + draft: Optional["models.RunbookDraft"] = None, + publish_content_link: Optional["models.ContentLink"] = None, + description: Optional[str] = None, + log_activity_trace: Optional[int] = None, + **kwargs + ) -> "models.Runbook": + """Create the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param runbook_type: Gets or sets the type of the runbook. + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :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] + :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 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Runbook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Runbook or ~azure.mgmt.automation.models.Runbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Runbook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.RunbookCreateOrUpdateParameters(name=name, location=location, tags=tags, log_verbose=log_verbose, log_progress=log_progress, runbook_type=runbook_type, draft=draft, publish_content_link=publish_content_link, description=description, log_activity_trace=log_activity_trace) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'RunbookCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Runbook', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Runbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + log_activity_trace: Optional[int] = None, + **kwargs + ) -> "models.Runbook": + """Update the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param 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] + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Runbook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Runbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Runbook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.RunbookUpdateParameters(name=name, location=location, tags=tags, description=description, log_verbose=log_verbose, log_progress=log_progress, log_activity_trace=log_activity_trace) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'RunbookUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Runbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> None: + """Delete the runbook by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.RunbookListResult": + """Retrieve a list of runbooks. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunbookListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.RunbookListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunbookListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RunbookListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_schedule_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_schedule_operations_async.py new file mode 100644 index 00000000000..1241403f566 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_schedule_operations_async.py @@ -0,0 +1,410 @@ +# 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 datetime +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ScheduleOperations: + """ScheduleOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + schedule_name: str, + name: str, + start_time: datetime.datetime, + frequency: Union[str, "models.ScheduleFrequency"], + description: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + interval: Optional[object] = None, + time_zone: Optional[str] = None, + week_days: Optional[List[str]] = None, + month_days: Optional[List[int]] = None, + monthly_occurrences: Optional[List["AdvancedScheduleMonthlyOccurrence"]] = None, + **kwargs + ) -> "models.Schedule": + """Create a schedule. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param 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.datetime + :param frequency: Gets or sets the frequency of the schedule. + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param description: Gets or sets the description of the schedule. + :type description: str + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: ~datetime.datetime + :param interval: Gets or sets the interval of the schedule. + :type interval: object + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :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] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Schedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Schedule or ~azure.mgmt.automation.models.Schedule or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ScheduleCreateOrUpdateParameters(name=name, description=description, start_time=start_time, expiry_time=expiry_time, interval=interval, frequency=frequency, time_zone=time_zone, week_days=week_days, month_days=month_days, monthly_occurrences=monthly_occurrences) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ScheduleCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Schedule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Schedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + schedule_name: str, + name: Optional[str] = None, + description: Optional[str] = None, + is_enabled: Optional[bool] = None, + **kwargs + ) -> "models.Schedule": + """Update the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Schedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Schedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ScheduleUpdateParameters(name=name, description=description, is_enabled=is_enabled) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ScheduleUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Schedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + schedule_name: str, + **kwargs + ) -> "models.Schedule": + """Retrieve the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Schedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Schedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Schedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + schedule_name: str, + **kwargs + ) -> None: + """Delete the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.ScheduleListResult": + """Retrieve a list of schedules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduleListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ScheduleListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_software_update_configuration_machine_run_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_software_update_configuration_machine_run_operations_async.py new file mode 100644 index 00000000000..d029f62f64d --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_software_update_configuration_machine_run_operations_async.py @@ -0,0 +1,185 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SoftwareUpdateConfigurationMachineRunOperations: + """SoftwareUpdateConfigurationMachineRunOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_by_id( + self, + resource_group_name: str, + automation_account_name: str, + software_update_configuration_machine_run_id: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> "models.SoftwareUpdateConfigurationMachineRun": + """Get a single software update configuration machine run by Id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_machine_run_id: The Id of the software update + configuration machine run. + :type software_update_configuration_machine_run_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationMachineRun or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationMachineRun"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationMachineRunId': self._serialize.url("software_update_configuration_machine_run_id", software_update_configuration_machine_run_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationMachineRun', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}'} + + async def list( + self, + resource_group_name: str, + automation_account_name: str, + client_request_id: Optional[str] = None, + filter: Optional[str] = None, + skip: Optional[str] = None, + top: Optional[str] = None, + **kwargs + ) -> "models.SoftwareUpdateConfigurationMachineRunListResult": + """Return list of software update configuration machine runs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. You can use the following filters: + 'properties/osType', 'properties/status', 'properties/startTime', and + 'properties/softwareUpdateConfiguration/name'. + :type filter: str + :param skip: number of entries you skip before returning results. + :type skip: str + :param top: Maximum number of entries returned in the results collection. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationMachineRunListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRunListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationMachineRunListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationMachineRunListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_software_update_configuration_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_software_update_configuration_operations_async.py new file mode 100644 index 00000000000..5e444220ec0 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_software_update_configuration_operations_async.py @@ -0,0 +1,402 @@ +# 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 datetime +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SoftwareUpdateConfigurationOperations: + """SoftwareUpdateConfigurationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create( + self, + resource_group_name: str, + automation_account_name: str, + software_update_configuration_name: str, + operating_system: Union[str, "models.OperatingSystemType"], + client_request_id: Optional[str] = None, + error: Optional["models.ErrorResponse"] = None, + parameters: Optional[Dict[str, str]] = None, + source: Optional[str] = None, + task_properties_parameters: Optional[Dict[str, str]] = None, + task_properties_source: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + expiry_time: Optional[datetime.datetime] = None, + expiry_time_offset_minutes: Optional[float] = None, + is_enabled: Optional[bool] = False, + next_run: Optional[datetime.datetime] = None, + next_run_offset_minutes: Optional[float] = None, + interval: Optional[int] = None, + frequency: Optional[Union[str, "models.ScheduleFrequency"]] = None, + time_zone: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + week_days: Optional[List[str]] = None, + month_days: Optional[List[int]] = None, + monthly_occurrences: Optional[List["AdvancedScheduleMonthlyOccurrence"]] = None, + windows: Optional["models.WindowsProperties"] = None, + linux: Optional["models.LinuxProperties"] = None, + duration: Optional[datetime.timedelta] = None, + azure_virtual_machines: Optional[List[str]] = None, + non_azure_computer_names: Optional[List[str]] = None, + azure_queries: Optional[List["AzureQueryProperties"]] = None, + non_azure_queries: Optional[List["NonAzureQueryProperties"]] = None, + **kwargs + ) -> "models.SoftwareUpdateConfiguration": + """Create a new software update configuration with the name given in the URI. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software update configuration to be + created. + :type software_update_configuration_name: str + :param operating_system: operating system of target machines. + :type operating_system: str or ~azure.mgmt.automation.models.OperatingSystemType + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param error: Details of provisioning error. + :type error: ~azure.mgmt.automation.models.ErrorResponse + :param parameters: Gets or sets the parameters of the task. + :type parameters: dict[str, str] + :param source: Gets or sets the name of the runbook. + :type source: str + :param task_properties_parameters: Gets or sets the parameters of the task. + :type task_properties_parameters: dict[str, str] + :param task_properties_source: Gets or sets the name of the runbook. + :type task_properties_source: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: ~datetime.datetime + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: ~datetime.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. + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: ~datetime.datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. + :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 creation_time: Gets or sets the creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :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] + :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: ~datetime.timedelta + :param azure_virtual_machines: List of azure resource Ids for azure virtual machines targeted + by the software update configuration. + :type azure_virtual_machines: list[str] + :param non_azure_computer_names: List of names of non-azure machines targeted by the software + update configuration. + :type non_azure_computer_names: list[str] + :param azure_queries: List of Azure queries in the software update configuration. + :type azure_queries: list[~azure.mgmt.automation.models.AzureQueryProperties] + :param non_azure_queries: List of non Azure queries in the software update configuration. + :type non_azure_queries: list[~azure.mgmt.automation.models.NonAzureQueryProperties] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration or ~azure.mgmt.automation.models.SoftwareUpdateConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.SoftwareUpdateConfiguration(error=error, parameters_properties_tasks_post_task_parameters=parameters, source_properties_tasks_post_task_source=source, parameters_properties_tasks_pre_task_parameters=task_properties_parameters, source_properties_tasks_pre_task_source=task_properties_source, start_time=start_time, expiry_time=expiry_time, expiry_time_offset_minutes=expiry_time_offset_minutes, is_enabled=is_enabled, next_run=next_run, next_run_offset_minutes=next_run_offset_minutes, interval=interval, frequency=frequency, time_zone=time_zone, creation_time_properties_schedule_info_creation_time=creation_time, last_modified_time_properties_schedule_info_last_modified_time=last_modified_time, description=description, week_days=week_days, month_days=month_days, monthly_occurrences=monthly_occurrences, operating_system=operating_system, windows=windows, linux=linux, duration=duration, azure_virtual_machines=azure_virtual_machines, non_azure_computer_names=non_azure_computer_names, azure_queries=azure_queries, non_azure_queries=non_azure_queries) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'SoftwareUpdateConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SoftwareUpdateConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + async def get_by_name( + self, + resource_group_name: str, + automation_account_name: str, + software_update_configuration_name: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> "models.SoftwareUpdateConfiguration": + """Get a single software update configuration by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software update configuration to be + created. + :type software_update_configuration_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_by_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + software_update_configuration_name: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> None: + """delete a specific software update configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software update configuration to be + created. + :type software_update_configuration_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + async def list( + self, + resource_group_name: str, + automation_account_name: str, + client_request_id: Optional[str] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.SoftwareUpdateConfigurationListResult": + """Get all software update configurations for the account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_software_update_configuration_run_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_software_update_configuration_run_operations_async.py new file mode 100644 index 00000000000..6d9026bf114 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_software_update_configuration_run_operations_async.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SoftwareUpdateConfigurationRunOperations: + """SoftwareUpdateConfigurationRunOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_by_id( + self, + resource_group_name: str, + automation_account_name: str, + software_update_configuration_run_id: str, + client_request_id: Optional[str] = None, + **kwargs + ) -> "models.SoftwareUpdateConfigurationRun": + """Get a single software update configuration Run by Id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_run_id: The Id of the software update configuration run. + :type software_update_configuration_run_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationRun or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationRun"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationRunId': self._serialize.url("software_update_configuration_run_id", software_update_configuration_run_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationRun', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}'} + + async def list( + self, + resource_group_name: str, + automation_account_name: str, + client_request_id: Optional[str] = None, + filter: Optional[str] = None, + skip: Optional[str] = None, + top: Optional[str] = None, + **kwargs + ) -> "models.SoftwareUpdateConfigurationRunListResult": + """Return list of software update configuration runs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. You can use the following filters: + 'properties/osType', 'properties/status', 'properties/startTime', and + 'properties/softwareUpdateConfiguration/name'. + :type filter: str + :param skip: Number of entries you skip before returning results. + :type skip: str + :param top: Maximum number of entries returned in the results collection. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationRunListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationRunListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationRunListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationRunListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_source_control_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_source_control_operations_async.py new file mode 100644 index 00000000000..7ebd595ac11 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_source_control_operations_async.py @@ -0,0 +1,418 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SourceControlOperations: + """SourceControlOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + source_control_name: str, + repo_url: Optional[str] = None, + branch: Optional[str] = None, + folder_path: Optional[str] = None, + auto_sync: Optional[bool] = None, + publish_runbook: Optional[bool] = None, + source_type: Optional[Union[str, "models.SourceType"]] = None, + security_token: Optional["models.SourceControlSecurityTokenProperties"] = None, + description: Optional[str] = None, + **kwargs + ) -> "models.SourceControl": + """Create a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as empty string for + VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. Path must be relative. + :type folder_path: str + :param auto_sync: The auto async of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param security_token: The authorization token for the repo of the source control. + :type security_token: ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControl or ~azure.mgmt.automation.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.SourceControlCreateOrUpdateParameters(repo_url=repo_url, branch=branch, folder_path=folder_path, auto_sync=auto_sync, publish_runbook=publish_runbook, source_type=source_type, security_token=security_token, description=description) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'SourceControlCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + source_control_name: str, + branch: Optional[str] = None, + folder_path: Optional[str] = None, + auto_sync: Optional[bool] = None, + publish_runbook: Optional[bool] = None, + security_token: Optional["models.SourceControlSecurityTokenProperties"] = None, + description: Optional[str] = None, + **kwargs + ) -> "models.SourceControl": + """Update a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param branch: The repo branch of the source control. + :type branch: str + :param folder_path: The folder path of the source control. Path must be relative. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param security_token: The authorization token for the repo of the source control. + :type security_token: ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.SourceControlUpdateParameters(branch=branch, folder_path=folder_path, auto_sync=auto_sync, publish_runbook=publish_runbook, security_token=security_token, description=description) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'SourceControlUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + source_control_name: str, + **kwargs + ) -> None: + """Delete the source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The name of source control. + :type source_control_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + source_control_name: str, + **kwargs + ) -> "models.SourceControl": + """Retrieve the source control identified by source control name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The name of source control. + :type source_control_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.SourceControlListResult": + """Retrieve a list of source controls. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_source_control_sync_job_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_source_control_sync_job_operations_async.py new file mode 100644 index 00000000000..68fa8ceb46f --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_source_control_sync_job_operations_async.py @@ -0,0 +1,262 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SourceControlSyncJobOperations: + """SourceControlSyncJobOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create( + self, + resource_group_name: str, + automation_account_name: str, + source_control_name: str, + source_control_sync_job_id: str, + commit_id: str, + **kwargs + ) -> "models.SourceControlSyncJob": + """Creates the sync job for a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param commit_id: The commit id of the source control sync job. If not syncing to a commitId, + enter an empty string. + :type commit_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.SourceControlSyncJobCreateParameters(commit_id=commit_id) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'SourceControlSyncJobCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControlSyncJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + source_control_name: str, + source_control_sync_job_id: str, + **kwargs + ) -> "models.SourceControlSyncJobById": + """Retrieve the source control sync job identified by job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJobById or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobById + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJobById"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControlSyncJobById', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + source_control_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.SourceControlSyncJobListResult": + """Retrieve a list of source control sync jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJobListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJobListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlSyncJobListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_source_control_sync_job_stream_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_source_control_sync_job_stream_operations_async.py new file mode 100644 index 00000000000..8c77a36122d --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_source_control_sync_job_stream_operations_async.py @@ -0,0 +1,194 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SourceControlSyncJobStreamOperations: + """SourceControlSyncJobStreamOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_sync_job( + self, + resource_group_name: str, + automation_account_name: str, + source_control_name: str, + source_control_sync_job_id: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.SourceControlSyncJobStreamsListBySyncJob": + """Retrieve a list of sync job streams identified by sync job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJobStreamsListBySyncJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobStreamsListBySyncJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJobStreamsListBySyncJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_sync_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlSyncJobStreamsListBySyncJob', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_sync_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + source_control_name: str, + source_control_sync_job_id: str, + stream_id: str, + **kwargs + ) -> "models.SourceControlSyncJobStreamById": + """Retrieve a sync job stream identified by stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param stream_id: The id of the sync job stream. + :type stream_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJobStreamById or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobStreamById + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJobStreamById"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'streamId': self._serialize.url("stream_id", stream_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControlSyncJobStreamById', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams/{streamId}'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_statistics_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_statistics_operations_async.py new file mode 100644 index 00000000000..678706f5d6e --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_statistics_operations_async.py @@ -0,0 +1,118 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StatisticsOperations: + """StatisticsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.StatisticsListResult": + """Retrieve the statistics for the account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StatisticsListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.StatisticsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StatisticsListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StatisticsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_test_job_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_test_job_operations_async.py new file mode 100644 index 00000000000..3b25d9b8889 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_test_job_operations_async.py @@ -0,0 +1,344 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TestJobOperations: + """TestJobOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + parameters: Optional[Dict[str, str]] = None, + run_on: Optional[str] = None, + **kwargs + ) -> "models.TestJob": + """Create a test job of the runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the create test job operation. + :type runbook_name: str + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TestJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TestJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TestJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.TestJobCreateParameters(parameters=parameters, run_on=run_on) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'TestJobCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TestJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> "models.TestJob": + """Retrieve the test job for the specified runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TestJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TestJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TestJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TestJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'} + + async def resume( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> None: + """Resume the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.resume.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume'} + + async def stop( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> None: + """Stop the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop'} + + async def suspend( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + **kwargs + ) -> None: + """Suspend the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.suspend.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_test_job_stream_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_test_job_stream_operations_async.py new file mode 100644 index 00000000000..01ec59a2f04 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_test_job_stream_operations_async.py @@ -0,0 +1,186 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TestJobStreamOperations: + """TestJobStreamOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + job_stream_id: str, + **kwargs + ) -> "models.JobStream": + """Retrieve a test job stream of the test job identified by runbook name and stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStream or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStream + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStream"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobStream', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}'} + + def list_by_test_job( + self, + resource_group_name: str, + automation_account_name: str, + runbook_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.JobStreamListResult": + """Retrieve a list of test job streams identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStreamListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStreamListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStreamListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_test_job.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobStreamListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_test_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_usage_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_usage_operations_async.py new file mode 100644 index 00000000000..666d7b39282 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_usage_operations_async.py @@ -0,0 +1,113 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsageOperations: + """UsageOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.UsageListResult": + """Retrieve the usage for the account id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UsageListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.UsageListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsageListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_variable_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_variable_operations_async.py new file mode 100644 index 00000000000..7886f98053e --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_variable_operations_async.py @@ -0,0 +1,391 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VariableOperations: + """VariableOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + variable_name: str, + name: str, + value: Optional[str] = None, + description: Optional[str] = None, + is_encrypted: Optional[bool] = None, + **kwargs + ) -> "models.Variable": + """Create a variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The variable name. + :type variable_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Variable or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Variable or ~azure.mgmt.automation.models.Variable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Variable"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.VariableCreateOrUpdateParameters(name=name, value=value, description=description, is_encrypted=is_encrypted) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'VariableCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Variable', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Variable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + variable_name: str, + name: Optional[str] = None, + value: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ) -> "models.Variable": + """Update a variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The variable name. + :type variable_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Variable or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Variable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Variable"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.VariableUpdateParameters(name=name, value=value, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'VariableUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Variable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + variable_name: str, + **kwargs + ) -> None: + """Delete the variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The name of variable. + :type variable_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + variable_name: str, + **kwargs + ) -> "models.Variable": + """Retrieve the variable identified by variable name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The name of variable. + :type variable_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Variable or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Variable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Variable"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Variable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> "models.VariableListResult": + """Retrieve a list of variables. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VariableListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.VariableListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VariableListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VariableListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_watcher_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_watcher_operations_async.py new file mode 100644 index 00000000000..32f3ddd93db --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_watcher_operations_async.py @@ -0,0 +1,520 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WatcherOperations: + """WatcherOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + watcher_name: str, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + etag: Optional[str] = None, + execution_frequency_in_seconds: Optional[int] = None, + script_name: Optional[str] = None, + script_parameters: Optional[Dict[str, str]] = None, + script_run_on: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ) -> "models.Watcher": + """Create the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which the watcher is + invoked. + :type execution_frequency_in_seconds: long + :param script_name: Gets or sets the name of the script the watcher is attached to, i.e. the + name of an existing runbook. + :type script_name: str + :param script_parameters: Gets or sets the parameters of the script. + :type script_parameters: dict[str, str] + :param script_run_on: Gets or sets the name of the hybrid worker group the watcher will run on. + :type script_run_on: str + :param description: Gets or sets the description. + :type description: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Watcher or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Watcher or ~azure.mgmt.automation.models.Watcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Watcher"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.Watcher(tags=tags, location=location, etag=etag, execution_frequency_in_seconds=execution_frequency_in_seconds, script_name=script_name, script_parameters=script_parameters, script_run_on=script_run_on, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'Watcher') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Watcher', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Watcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + watcher_name: str, + **kwargs + ) -> "models.Watcher": + """Retrieve the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Watcher or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Watcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Watcher"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Watcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + watcher_name: str, + name: Optional[str] = None, + execution_frequency_in_seconds: Optional[int] = None, + **kwargs + ) -> "models.Watcher": + """Update the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param name: Gets or sets the name of the resource. + :type name: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which the watcher is + invoked. + :type execution_frequency_in_seconds: long + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Watcher or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Watcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Watcher"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.WatcherUpdateParameters(name=name, execution_frequency_in_seconds=execution_frequency_in_seconds) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'WatcherUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Watcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + watcher_name: str, + **kwargs + ) -> None: + """Delete the watcher by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + async def start( + self, + resource_group_name: str, + automation_account_name: str, + watcher_name: str, + **kwargs + ) -> None: + """Resume the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/start'} + + async def stop( + self, + resource_group_name: str, + automation_account_name: str, + watcher_name: str, + **kwargs + ) -> None: + """Resume the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/stop'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.WatcherListResult": + """Retrieve a list of watchers. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WatcherListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.WatcherListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WatcherListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WatcherListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_webhook_operations_async.py b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_webhook_operations_async.py new file mode 100644 index 00000000000..90637342bc0 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/aio/operations_async/_webhook_operations_async.py @@ -0,0 +1,468 @@ +# 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 datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WebhookOperations: + """WebhookOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def generate_uri( + self, + resource_group_name: str, + automation_account_name: str, + **kwargs + ) -> str: + """Generates a Uri for use in creating a webhook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.generate_uri.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_uri.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri'} + + async def delete( + self, + resource_group_name: str, + automation_account_name: str, + webhook_name: str, + **kwargs + ) -> None: + """Delete the webhook by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + async def get( + self, + resource_group_name: str, + automation_account_name: str, + webhook_name: str, + **kwargs + ) -> "models.Webhook": + """Retrieve the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Webhook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Webhook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Webhook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Webhook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + async def create_or_update( + self, + resource_group_name: str, + automation_account_name: str, + webhook_name: str, + name: str, + is_enabled: Optional[bool] = None, + uri: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + parameters: Optional[Dict[str, str]] = None, + runbook: Optional["models.RunbookAssociationProperty"] = None, + run_on: Optional[str] = None, + **kwargs + ) -> "models.Webhook": + """Create the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param 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.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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Webhook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Webhook or ~azure.mgmt.automation.models.Webhook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Webhook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.WebhookCreateOrUpdateParameters(name=name, is_enabled=is_enabled, uri=uri, expiry_time=expiry_time, parameters=parameters, runbook=runbook, run_on=run_on) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'WebhookCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Webhook', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Webhook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + async def update( + self, + resource_group_name: str, + automation_account_name: str, + webhook_name: str, + name: Optional[str] = None, + is_enabled: Optional[bool] = None, + run_on: Optional[str] = None, + parameters: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + **kwargs + ) -> "models.Webhook": + """Update the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Webhook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Webhook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Webhook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.WebhookUpdateParameters(name=name, is_enabled=is_enabled, run_on=run_on, parameters=parameters, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'WebhookUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Webhook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def list_by_automation_account( + self, + resource_group_name: str, + automation_account_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "models.WebhookListResult": + """Retrieve a list of webhooks. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebhookListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.WebhookListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebhookListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebhookListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/models/__init__.py b/src/automation/azext_automation/vendored_sdks/automation/models/__init__.py new file mode 100644 index 00000000000..1c8fcc06efa --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/models/__init__.py @@ -0,0 +1,538 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Activity + from ._models_py3 import ActivityListResult + from ._models_py3 import ActivityOutputType + from ._models_py3 import ActivityParameter + from ._models_py3 import ActivityParameterSet + from ._models_py3 import ActivityParameterValidationSet + from ._models_py3 import AdvancedScheduleMonthlyOccurrence + from ._models_py3 import AgentRegistration + from ._models_py3 import AgentRegistrationKeys + from ._models_py3 import AgentRegistrationRegenerateKeyParameter + from ._models_py3 import AutomationAccount + from ._models_py3 import AutomationAccountCreateOrUpdateParameters + from ._models_py3 import AutomationAccountListResult + from ._models_py3 import AutomationAccountUpdateParameters + from ._models_py3 import AzureQueryProperties + from ._models_py3 import Certificate + from ._models_py3 import CertificateCreateOrUpdateParameters + from ._models_py3 import CertificateListResult + from ._models_py3 import CertificateUpdateParameters + from ._models_py3 import CollectionItemUpdateConfiguration + from ._models_py3 import Connection + from ._models_py3 import ConnectionCreateOrUpdateParameters + from ._models_py3 import ConnectionListResult + from ._models_py3 import ConnectionType + from ._models_py3 import ConnectionTypeAssociationProperty + from ._models_py3 import ConnectionTypeCreateOrUpdateParameters + from ._models_py3 import ConnectionTypeListResult + from ._models_py3 import ConnectionUpdateParameters + from ._models_py3 import ContentHash + from ._models_py3 import ContentLink + from ._models_py3 import ContentSource + from ._models_py3 import Credential + from ._models_py3 import CredentialCreateOrUpdateParameters + from ._models_py3 import CredentialListResult + from ._models_py3 import CredentialUpdateParameters + from ._models_py3 import DscCompilationJob + from ._models_py3 import DscCompilationJobCreateParameters + from ._models_py3 import DscCompilationJobListResult + from ._models_py3 import DscConfiguration + from ._models_py3 import DscConfigurationAssociationProperty + from ._models_py3 import DscConfigurationCreateOrUpdateParameters + from ._models_py3 import DscConfigurationListResult + from ._models_py3 import DscConfigurationParameter + from ._models_py3 import DscConfigurationUpdateParameters + from ._models_py3 import DscMetaConfiguration + from ._models_py3 import DscNode + from ._models_py3 import DscNodeConfiguration + from ._models_py3 import DscNodeConfigurationCreateOrUpdateParameters + from ._models_py3 import DscNodeConfigurationListResult + from ._models_py3 import DscNodeExtensionHandlerAssociationProperty + from ._models_py3 import DscNodeListResult + from ._models_py3 import DscNodeReport + from ._models_py3 import DscNodeReportListResult + from ._models_py3 import DscNodeUpdateParameters + from ._models_py3 import DscReportError + from ._models_py3 import DscReportResource + from ._models_py3 import DscReportResourceNavigation + from ._models_py3 import ErrorResponse + from ._models_py3 import FieldDefinition + from ._models_py3 import HybridRunbookWorker + from ._models_py3 import HybridRunbookWorkerGroup + from ._models_py3 import HybridRunbookWorkerGroupUpdateParameters + from ._models_py3 import HybridRunbookWorkerGroupsListResult + from ._models_py3 import Job + from ._models_py3 import JobCollectionItem + from ._models_py3 import JobCreateParameters + from ._models_py3 import JobListResultV2 + from ._models_py3 import JobNavigation + from ._models_py3 import JobSchedule + from ._models_py3 import JobScheduleCreateParameters + from ._models_py3 import JobScheduleListResult + from ._models_py3 import JobScheduleProperties + from ._models_py3 import JobStream + from ._models_py3 import JobStreamListResult + from ._models_py3 import Key + from ._models_py3 import KeyListResult + from ._models_py3 import LinkedWorkspace + from ._models_py3 import LinuxProperties + from ._models_py3 import Module + from ._models_py3 import ModuleCreateOrUpdateParameters + from ._models_py3 import ModuleErrorInfo + from ._models_py3 import ModuleListResult + from ._models_py3 import ModuleUpdateParameters + from ._models_py3 import NodeCount + from ._models_py3 import NodeCountProperties + from ._models_py3 import NodeCounts + from ._models_py3 import NonAzureQueryProperties + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import ProxyResource + from ._models_py3 import PythonPackageCreateParameters + from ._models_py3 import PythonPackageUpdateParameters + from ._models_py3 import Resource + from ._models_py3 import RunAsCredentialAssociationProperty + from ._models_py3 import Runbook + from ._models_py3 import RunbookAssociationProperty + from ._models_py3 import RunbookCreateOrUpdateDraftParameters + from ._models_py3 import RunbookCreateOrUpdateDraftProperties + from ._models_py3 import RunbookCreateOrUpdateParameters + from ._models_py3 import RunbookDraft + from ._models_py3 import RunbookDraftUndoEditResult + from ._models_py3 import RunbookListResult + from ._models_py3 import RunbookParameter + from ._models_py3 import RunbookUpdateParameters + from ._models_py3 import Schedule + from ._models_py3 import ScheduleAssociationProperty + from ._models_py3 import ScheduleCreateOrUpdateParameters + from ._models_py3 import ScheduleListResult + from ._models_py3 import ScheduleUpdateParameters + from ._models_py3 import Sku + from ._models_py3 import SoftareUpdateConfigurationRunTaskProperties + from ._models_py3 import SoftareUpdateConfigurationRunTasks + from ._models_py3 import SoftwareUpdateConfiguration + from ._models_py3 import SoftwareUpdateConfigurationCollectionItem + from ._models_py3 import SoftwareUpdateConfigurationListResult + from ._models_py3 import SoftwareUpdateConfigurationMachineRun + from ._models_py3 import SoftwareUpdateConfigurationMachineRunListResult + from ._models_py3 import SoftwareUpdateConfigurationRun + from ._models_py3 import SoftwareUpdateConfigurationRunListResult + from ._models_py3 import SourceControl + from ._models_py3 import SourceControlCreateOrUpdateParameters + from ._models_py3 import SourceControlListResult + from ._models_py3 import SourceControlSecurityTokenProperties + from ._models_py3 import SourceControlSyncJob + from ._models_py3 import SourceControlSyncJobById + from ._models_py3 import SourceControlSyncJobCreateParameters + from ._models_py3 import SourceControlSyncJobListResult + from ._models_py3 import SourceControlSyncJobStream + from ._models_py3 import SourceControlSyncJobStreamById + from ._models_py3 import SourceControlSyncJobStreamsListBySyncJob + from ._models_py3 import SourceControlUpdateParameters + from ._models_py3 import Statistics + from ._models_py3 import StatisticsListResult + from ._models_py3 import TagSettingsProperties + from ._models_py3 import TestJob + from ._models_py3 import TestJobCreateParameters + from ._models_py3 import TrackedResource + from ._models_py3 import TypeField + from ._models_py3 import TypeFieldListResult + from ._models_py3 import UpdateConfigurationNavigation + from ._models_py3 import Usage + from ._models_py3 import UsageCounterName + from ._models_py3 import UsageListResult + from ._models_py3 import Variable + from ._models_py3 import VariableCreateOrUpdateParameters + from ._models_py3 import VariableListResult + from ._models_py3 import VariableUpdateParameters + from ._models_py3 import Watcher + from ._models_py3 import WatcherListResult + from ._models_py3 import WatcherUpdateParameters + from ._models_py3 import Webhook + from ._models_py3 import WebhookCreateOrUpdateParameters + from ._models_py3 import WebhookListResult + from ._models_py3 import WebhookUpdateParameters + from ._models_py3 import WindowsProperties +except (SyntaxError, ImportError): + from ._models import Activity # type: ignore + from ._models import ActivityListResult # type: ignore + from ._models import ActivityOutputType # type: ignore + from ._models import ActivityParameter # type: ignore + from ._models import ActivityParameterSet # type: ignore + from ._models import ActivityParameterValidationSet # type: ignore + from ._models import AdvancedScheduleMonthlyOccurrence # type: ignore + from ._models import AgentRegistration # type: ignore + from ._models import AgentRegistrationKeys # type: ignore + from ._models import AgentRegistrationRegenerateKeyParameter # type: ignore + from ._models import AutomationAccount # type: ignore + from ._models import AutomationAccountCreateOrUpdateParameters # type: ignore + from ._models import AutomationAccountListResult # type: ignore + from ._models import AutomationAccountUpdateParameters # type: ignore + from ._models import AzureQueryProperties # type: ignore + from ._models import Certificate # type: ignore + from ._models import CertificateCreateOrUpdateParameters # type: ignore + from ._models import CertificateListResult # type: ignore + from ._models import CertificateUpdateParameters # type: ignore + from ._models import CollectionItemUpdateConfiguration # type: ignore + from ._models import Connection # type: ignore + from ._models import ConnectionCreateOrUpdateParameters # type: ignore + from ._models import ConnectionListResult # type: ignore + from ._models import ConnectionType # type: ignore + from ._models import ConnectionTypeAssociationProperty # type: ignore + from ._models import ConnectionTypeCreateOrUpdateParameters # type: ignore + from ._models import ConnectionTypeListResult # type: ignore + from ._models import ConnectionUpdateParameters # type: ignore + from ._models import ContentHash # type: ignore + from ._models import ContentLink # type: ignore + from ._models import ContentSource # type: ignore + from ._models import Credential # type: ignore + from ._models import CredentialCreateOrUpdateParameters # type: ignore + from ._models import CredentialListResult # type: ignore + from ._models import CredentialUpdateParameters # type: ignore + from ._models import DscCompilationJob # type: ignore + from ._models import DscCompilationJobCreateParameters # type: ignore + from ._models import DscCompilationJobListResult # type: ignore + from ._models import DscConfiguration # type: ignore + from ._models import DscConfigurationAssociationProperty # type: ignore + from ._models import DscConfigurationCreateOrUpdateParameters # type: ignore + from ._models import DscConfigurationListResult # type: ignore + from ._models import DscConfigurationParameter # type: ignore + from ._models import DscConfigurationUpdateParameters # type: ignore + from ._models import DscMetaConfiguration # type: ignore + from ._models import DscNode # type: ignore + from ._models import DscNodeConfiguration # type: ignore + from ._models import DscNodeConfigurationCreateOrUpdateParameters # type: ignore + from ._models import DscNodeConfigurationListResult # type: ignore + from ._models import DscNodeExtensionHandlerAssociationProperty # type: ignore + from ._models import DscNodeListResult # type: ignore + from ._models import DscNodeReport # type: ignore + from ._models import DscNodeReportListResult # type: ignore + from ._models import DscNodeUpdateParameters # type: ignore + from ._models import DscReportError # type: ignore + from ._models import DscReportResource # type: ignore + from ._models import DscReportResourceNavigation # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import FieldDefinition # type: ignore + from ._models import HybridRunbookWorker # type: ignore + from ._models import HybridRunbookWorkerGroup # type: ignore + from ._models import HybridRunbookWorkerGroupUpdateParameters # type: ignore + from ._models import HybridRunbookWorkerGroupsListResult # type: ignore + from ._models import Job # type: ignore + from ._models import JobCollectionItem # type: ignore + from ._models import JobCreateParameters # type: ignore + from ._models import JobListResultV2 # type: ignore + from ._models import JobNavigation # type: ignore + from ._models import JobSchedule # type: ignore + from ._models import JobScheduleCreateParameters # type: ignore + from ._models import JobScheduleListResult # type: ignore + from ._models import JobScheduleProperties # type: ignore + from ._models import JobStream # type: ignore + from ._models import JobStreamListResult # type: ignore + from ._models import Key # type: ignore + from ._models import KeyListResult # type: ignore + from ._models import LinkedWorkspace # type: ignore + from ._models import LinuxProperties # type: ignore + from ._models import Module # type: ignore + from ._models import ModuleCreateOrUpdateParameters # type: ignore + from ._models import ModuleErrorInfo # type: ignore + from ._models import ModuleListResult # type: ignore + from ._models import ModuleUpdateParameters # type: ignore + from ._models import NodeCount # type: ignore + from ._models import NodeCountProperties # type: ignore + from ._models import NodeCounts # type: ignore + from ._models import NonAzureQueryProperties # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import PythonPackageCreateParameters # type: ignore + from ._models import PythonPackageUpdateParameters # type: ignore + from ._models import Resource # type: ignore + from ._models import RunAsCredentialAssociationProperty # type: ignore + from ._models import Runbook # type: ignore + from ._models import RunbookAssociationProperty # type: ignore + from ._models import RunbookCreateOrUpdateDraftParameters # type: ignore + from ._models import RunbookCreateOrUpdateDraftProperties # type: ignore + from ._models import RunbookCreateOrUpdateParameters # type: ignore + from ._models import RunbookDraft # type: ignore + from ._models import RunbookDraftUndoEditResult # type: ignore + from ._models import RunbookListResult # type: ignore + from ._models import RunbookParameter # type: ignore + from ._models import RunbookUpdateParameters # type: ignore + from ._models import Schedule # type: ignore + from ._models import ScheduleAssociationProperty # type: ignore + from ._models import ScheduleCreateOrUpdateParameters # type: ignore + from ._models import ScheduleListResult # type: ignore + from ._models import ScheduleUpdateParameters # type: ignore + from ._models import Sku # type: ignore + from ._models import SoftareUpdateConfigurationRunTaskProperties # type: ignore + from ._models import SoftareUpdateConfigurationRunTasks # type: ignore + from ._models import SoftwareUpdateConfiguration # type: ignore + from ._models import SoftwareUpdateConfigurationCollectionItem # type: ignore + from ._models import SoftwareUpdateConfigurationListResult # type: ignore + from ._models import SoftwareUpdateConfigurationMachineRun # type: ignore + from ._models import SoftwareUpdateConfigurationMachineRunListResult # type: ignore + from ._models import SoftwareUpdateConfigurationRun # type: ignore + from ._models import SoftwareUpdateConfigurationRunListResult # type: ignore + from ._models import SourceControl # type: ignore + from ._models import SourceControlCreateOrUpdateParameters # type: ignore + from ._models import SourceControlListResult # type: ignore + from ._models import SourceControlSecurityTokenProperties # type: ignore + from ._models import SourceControlSyncJob # type: ignore + from ._models import SourceControlSyncJobById # type: ignore + from ._models import SourceControlSyncJobCreateParameters # type: ignore + from ._models import SourceControlSyncJobListResult # type: ignore + from ._models import SourceControlSyncJobStream # type: ignore + from ._models import SourceControlSyncJobStreamById # type: ignore + from ._models import SourceControlSyncJobStreamsListBySyncJob # type: ignore + from ._models import SourceControlUpdateParameters # type: ignore + from ._models import Statistics # type: ignore + from ._models import StatisticsListResult # type: ignore + from ._models import TagSettingsProperties # type: ignore + from ._models import TestJob # type: ignore + from ._models import TestJobCreateParameters # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import TypeField # type: ignore + from ._models import TypeFieldListResult # type: ignore + from ._models import UpdateConfigurationNavigation # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageCounterName # type: ignore + from ._models import UsageListResult # type: ignore + from ._models import Variable # type: ignore + from ._models import VariableCreateOrUpdateParameters # type: ignore + from ._models import VariableListResult # type: ignore + from ._models import VariableUpdateParameters # type: ignore + from ._models import Watcher # type: ignore + from ._models import WatcherListResult # type: ignore + from ._models import WatcherUpdateParameters # type: ignore + from ._models import Webhook # type: ignore + from ._models import WebhookCreateOrUpdateParameters # type: ignore + from ._models import WebhookListResult # type: ignore + from ._models import WebhookUpdateParameters # type: ignore + from ._models import WindowsProperties # type: ignore + +from ._automation_client_enums import ( + AgentRegistrationKeyName, + AutomationAccountState, + AutomationKeyName, + AutomationKeyPermissions, + ContentSourceType, + CountType, + DscConfigurationState, + GroupTypeEnum, + HttpStatusCode, + JobProvisioningState, + JobStatus, + JobStreamType, + LinuxUpdateClasses, + ModuleProvisioningState, + OperatingSystemType, + ProvisioningState, + RunbookState, + RunbookTypeEnum, + ScheduleDay, + ScheduleFrequency, + SkuNameEnum, + SourceType, + StreamType, + SyncType, + TagOperators, + TokenType, + WindowsUpdateClasses, +) + +__all__ = [ + 'Activity', + 'ActivityListResult', + 'ActivityOutputType', + 'ActivityParameter', + 'ActivityParameterSet', + 'ActivityParameterValidationSet', + 'AdvancedScheduleMonthlyOccurrence', + 'AgentRegistration', + 'AgentRegistrationKeys', + 'AgentRegistrationRegenerateKeyParameter', + 'AutomationAccount', + 'AutomationAccountCreateOrUpdateParameters', + 'AutomationAccountListResult', + 'AutomationAccountUpdateParameters', + 'AzureQueryProperties', + 'Certificate', + 'CertificateCreateOrUpdateParameters', + 'CertificateListResult', + 'CertificateUpdateParameters', + 'CollectionItemUpdateConfiguration', + 'Connection', + 'ConnectionCreateOrUpdateParameters', + 'ConnectionListResult', + 'ConnectionType', + 'ConnectionTypeAssociationProperty', + 'ConnectionTypeCreateOrUpdateParameters', + 'ConnectionTypeListResult', + 'ConnectionUpdateParameters', + 'ContentHash', + 'ContentLink', + 'ContentSource', + 'Credential', + 'CredentialCreateOrUpdateParameters', + 'CredentialListResult', + 'CredentialUpdateParameters', + 'DscCompilationJob', + 'DscCompilationJobCreateParameters', + 'DscCompilationJobListResult', + 'DscConfiguration', + 'DscConfigurationAssociationProperty', + 'DscConfigurationCreateOrUpdateParameters', + 'DscConfigurationListResult', + 'DscConfigurationParameter', + 'DscConfigurationUpdateParameters', + 'DscMetaConfiguration', + 'DscNode', + 'DscNodeConfiguration', + 'DscNodeConfigurationCreateOrUpdateParameters', + 'DscNodeConfigurationListResult', + 'DscNodeExtensionHandlerAssociationProperty', + 'DscNodeListResult', + 'DscNodeReport', + 'DscNodeReportListResult', + 'DscNodeUpdateParameters', + 'DscReportError', + 'DscReportResource', + 'DscReportResourceNavigation', + 'ErrorResponse', + 'FieldDefinition', + 'HybridRunbookWorker', + 'HybridRunbookWorkerGroup', + 'HybridRunbookWorkerGroupUpdateParameters', + 'HybridRunbookWorkerGroupsListResult', + 'Job', + 'JobCollectionItem', + 'JobCreateParameters', + 'JobListResultV2', + 'JobNavigation', + 'JobSchedule', + 'JobScheduleCreateParameters', + 'JobScheduleListResult', + 'JobScheduleProperties', + 'JobStream', + 'JobStreamListResult', + 'Key', + 'KeyListResult', + 'LinkedWorkspace', + 'LinuxProperties', + 'Module', + 'ModuleCreateOrUpdateParameters', + 'ModuleErrorInfo', + 'ModuleListResult', + 'ModuleUpdateParameters', + 'NodeCount', + 'NodeCountProperties', + 'NodeCounts', + 'NonAzureQueryProperties', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'ProxyResource', + 'PythonPackageCreateParameters', + 'PythonPackageUpdateParameters', + 'Resource', + 'RunAsCredentialAssociationProperty', + 'Runbook', + 'RunbookAssociationProperty', + 'RunbookCreateOrUpdateDraftParameters', + 'RunbookCreateOrUpdateDraftProperties', + 'RunbookCreateOrUpdateParameters', + 'RunbookDraft', + 'RunbookDraftUndoEditResult', + 'RunbookListResult', + 'RunbookParameter', + 'RunbookUpdateParameters', + 'Schedule', + 'ScheduleAssociationProperty', + 'ScheduleCreateOrUpdateParameters', + 'ScheduleListResult', + 'ScheduleUpdateParameters', + 'Sku', + 'SoftareUpdateConfigurationRunTaskProperties', + 'SoftareUpdateConfigurationRunTasks', + 'SoftwareUpdateConfiguration', + 'SoftwareUpdateConfigurationCollectionItem', + 'SoftwareUpdateConfigurationListResult', + 'SoftwareUpdateConfigurationMachineRun', + 'SoftwareUpdateConfigurationMachineRunListResult', + 'SoftwareUpdateConfigurationRun', + 'SoftwareUpdateConfigurationRunListResult', + 'SourceControl', + 'SourceControlCreateOrUpdateParameters', + 'SourceControlListResult', + 'SourceControlSecurityTokenProperties', + 'SourceControlSyncJob', + 'SourceControlSyncJobById', + 'SourceControlSyncJobCreateParameters', + 'SourceControlSyncJobListResult', + 'SourceControlSyncJobStream', + 'SourceControlSyncJobStreamById', + 'SourceControlSyncJobStreamsListBySyncJob', + 'SourceControlUpdateParameters', + 'Statistics', + 'StatisticsListResult', + 'TagSettingsProperties', + 'TestJob', + 'TestJobCreateParameters', + 'TrackedResource', + 'TypeField', + 'TypeFieldListResult', + 'UpdateConfigurationNavigation', + 'Usage', + 'UsageCounterName', + 'UsageListResult', + 'Variable', + 'VariableCreateOrUpdateParameters', + 'VariableListResult', + 'VariableUpdateParameters', + 'Watcher', + 'WatcherListResult', + 'WatcherUpdateParameters', + 'Webhook', + 'WebhookCreateOrUpdateParameters', + 'WebhookListResult', + 'WebhookUpdateParameters', + 'WindowsProperties', + 'AgentRegistrationKeyName', + 'AutomationAccountState', + 'AutomationKeyName', + 'AutomationKeyPermissions', + 'ContentSourceType', + 'CountType', + 'DscConfigurationState', + 'GroupTypeEnum', + 'HttpStatusCode', + 'JobProvisioningState', + 'JobStatus', + 'JobStreamType', + 'LinuxUpdateClasses', + 'ModuleProvisioningState', + 'OperatingSystemType', + 'ProvisioningState', + 'RunbookState', + 'RunbookTypeEnum', + 'ScheduleDay', + 'ScheduleFrequency', + 'SkuNameEnum', + 'SourceType', + 'StreamType', + 'SyncType', + 'TagOperators', + 'TokenType', + 'WindowsUpdateClasses', +] diff --git a/src/automation/azext_automation/vendored_sdks/automation/models/_automation_client_enums.py b/src/automation/azext_automation/vendored_sdks/automation/models/_automation_client_enums.py new file mode 100644 index 00000000000..54c781c49a1 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/models/_automation_client_enums.py @@ -0,0 +1,300 @@ +# 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 AgentRegistrationKeyName(str, Enum): + """Gets or sets the agent registration key name - primary or secondary. + """ + + primary = "primary" + secondary = "secondary" + +class AutomationAccountState(str, Enum): + """Gets status of account. + """ + + ok = "Ok" + unavailable = "Unavailable" + suspended = "Suspended" + +class AutomationKeyName(str, Enum): + """Automation key name. + """ + + primary = "Primary" + secondary = "Secondary" + +class AutomationKeyPermissions(str, Enum): + """Automation key permissions. + """ + + read = "Read" + full = "Full" + +class ContentSourceType(str, Enum): + """Gets or sets the content source type. + """ + + embedded_content = "embeddedContent" + uri = "uri" + +class CountType(str, Enum): + + status = "status" + nodeconfiguration = "nodeconfiguration" + +class DscConfigurationState(str, Enum): + """Gets or sets the state of the configuration. + """ + + new = "New" + edit = "Edit" + published = "Published" + +class GroupTypeEnum(str, Enum): + """Type of the HybridWorkerGroup. + """ + + user = "User" + system = "System" + +class HttpStatusCode(str, Enum): + + continue_enum = "Continue" + switching_protocols = "SwitchingProtocols" + ok = "OK" + created = "Created" + accepted = "Accepted" + non_authoritative_information = "NonAuthoritativeInformation" + no_content = "NoContent" + reset_content = "ResetContent" + partial_content = "PartialContent" + multiple_choices = "MultipleChoices" + ambiguous = "Ambiguous" + moved_permanently = "MovedPermanently" + moved = "Moved" + found = "Found" + redirect = "Redirect" + see_other = "SeeOther" + redirect_method = "RedirectMethod" + not_modified = "NotModified" + use_proxy = "UseProxy" + unused = "Unused" + temporary_redirect = "TemporaryRedirect" + redirect_keep_verb = "RedirectKeepVerb" + bad_request = "BadRequest" + unauthorized = "Unauthorized" + payment_required = "PaymentRequired" + forbidden = "Forbidden" + not_found = "NotFound" + method_not_allowed = "MethodNotAllowed" + not_acceptable = "NotAcceptable" + proxy_authentication_required = "ProxyAuthenticationRequired" + request_timeout = "RequestTimeout" + conflict = "Conflict" + gone = "Gone" + length_required = "LengthRequired" + precondition_failed = "PreconditionFailed" + request_entity_too_large = "RequestEntityTooLarge" + request_uri_too_long = "RequestUriTooLong" + unsupported_media_type = "UnsupportedMediaType" + requested_range_not_satisfiable = "RequestedRangeNotSatisfiable" + expectation_failed = "ExpectationFailed" + upgrade_required = "UpgradeRequired" + internal_server_error = "InternalServerError" + not_implemented = "NotImplemented" + bad_gateway = "BadGateway" + service_unavailable = "ServiceUnavailable" + gateway_timeout = "GatewayTimeout" + http_version_not_supported = "HttpVersionNotSupported" + +class JobProvisioningState(str, Enum): + """The provisioning state of the resource. + """ + + failed = "Failed" + succeeded = "Succeeded" + suspended = "Suspended" + processing = "Processing" + +class JobStatus(str, Enum): + """Gets or sets the status of the job. + """ + + 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(str, Enum): + """Gets or sets the stream type. + """ + + progress = "Progress" + output = "Output" + warning = "Warning" + error = "Error" + debug = "Debug" + verbose = "Verbose" + any = "Any" + +class LinuxUpdateClasses(str, Enum): + """Update classifications included in the software update configuration. + """ + + unclassified = "Unclassified" + critical = "Critical" + security = "Security" + other = "Other" + +class ModuleProvisioningState(str, Enum): + """Gets or sets the provisioning state of the module. + """ + + 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 OperatingSystemType(str, Enum): + """Target operating system for the software update configuration. + """ + + windows = "Windows" + linux = "Linux" + +class ProvisioningState(str, Enum): + """The provisioning state of the job. + """ + + completed = "Completed" + failed = "Failed" + running = "Running" + +class RunbookState(str, Enum): + """Gets or sets the state of the runbook. + """ + + new = "New" + edit = "Edit" + published = "Published" + +class RunbookTypeEnum(str, Enum): + """Gets or sets the type of the runbook. + """ + + script = "Script" + graph = "Graph" + power_shell_workflow = "PowerShellWorkflow" + power_shell = "PowerShell" + graph_power_shell_workflow = "GraphPowerShellWorkflow" + graph_power_shell = "GraphPowerShell" + +class ScheduleDay(str, Enum): + """Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, + sunday. + """ + + monday = "Monday" + tuesday = "Tuesday" + wednesday = "Wednesday" + thursday = "Thursday" + friday = "Friday" + saturday = "Saturday" + sunday = "Sunday" + +class ScheduleFrequency(str, Enum): + """Gets or sets the frequency of the schedule. + """ + + one_time = "OneTime" + day = "Day" + hour = "Hour" + week = "Week" + month = "Month" + minute = "Minute" #: The minimum allowed interval for Minute schedules is 15 minutes. + +class SkuNameEnum(str, Enum): + """Gets or sets the SKU name of the account. + """ + + free = "Free" + basic = "Basic" + +class SourceType(str, Enum): + """The source type. Must be one of VsoGit, VsoTfvc, GitHub. + """ + + vso_git = "VsoGit" + vso_tfvc = "VsoTfvc" + git_hub = "GitHub" + +class StreamType(str, Enum): + """The type of the sync job stream. + """ + + error = "Error" + output = "Output" + +class SyncType(str, Enum): + """The sync type. + """ + + partial_sync = "PartialSync" + full_sync = "FullSync" + +class TagOperators(str, Enum): + """Filter VMs by Any or All specified tags. + """ + + all = "All" + any = "Any" + +class TokenType(str, Enum): + """The token type. Must be either PersonalAccessToken or Oauth. + """ + + personal_access_token = "PersonalAccessToken" + oauth = "Oauth" + +class WindowsUpdateClasses(str, Enum): + """Update classification included in the software update configuration. A comma separated string + with required values + """ + + unclassified = "Unclassified" + critical = "Critical" + security = "Security" + update_rollup = "UpdateRollup" + feature_pack = "FeaturePack" + service_pack = "ServicePack" + definition = "Definition" + tools = "Tools" + updates = "Updates" diff --git a/src/automation/azext_automation/vendored_sdks/automation/models/_models.py b/src/automation/azext_automation/vendored_sdks/automation/models/_models.py new file mode 100644 index 00000000000..9f5b60d5f78 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/models/_models.py @@ -0,0 +1,6081 @@ +# 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 azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Activity(msrest.serialization.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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'definition': {'key': 'properties.definition', 'type': 'str'}, + 'parameter_sets': {'key': 'properties.parameterSets', 'type': '[ActivityParameterSet]'}, + 'output_types': {'key': 'properties.outputTypes', 'type': '[ActivityOutputType]'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Activity, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.definition = kwargs.get('definition', None) + self.parameter_sets = kwargs.get('parameter_sets', None) + self.output_types = kwargs.get('output_types', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + + +class ActivityListResult(msrest.serialization.Model): + """The response model for the list activity operation. + + :param value: Gets or sets a list of activities. + :type value: list[~azure.mgmt.automation.models.Activity] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Activity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ActivityListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ActivityOutputType(msrest.serialization.Model): + """Definition of the activity output type. + + :param name: Gets or sets the name of the activity output type. + :type name: str + :param type: Gets or sets the type of the activity output type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ActivityOutputType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class ActivityParameter(msrest.serialization.Model): + """Definition of the activity parameter. + + :param name: Gets or sets the name of the activity parameter. + :type name: str + :param type: Gets or sets the type of the activity parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value that indicates true if the parameter is + required. If the value is false, the parameter is optional. + :type is_mandatory: bool + :param is_dynamic: Gets or sets a Boolean value that indicates true if the parameter is + dynamic. + :type is_dynamic: bool + :param position: Gets or sets the position of the activity parameter. + :type position: long + :param value_from_pipeline: Gets or sets a Boolean value that indicates true if the parameter + can take values from the incoming pipeline objects. This setting is used if the cmdlet must + access the complete input object. false indicates that the parameter cannot take values from + the complete input object. + :type value_from_pipeline: bool + :param value_from_pipeline_by_property_name: Gets or sets a Boolean value that indicates true + if the parameter can be filled from a property of the incoming pipeline object that has the + same name as this parameter. false indicates that the parameter cannot be filled from the + incoming pipeline object property with the same name. + :type value_from_pipeline_by_property_name: bool + :param value_from_remaining_arguments: Gets or sets a Boolean value that indicates true if the + cmdlet parameter accepts all the remaining command-line arguments that are associated with this + parameter in the form of an array. false if the cmdlet parameter does not accept all the + remaining argument values. + :type value_from_remaining_arguments: bool + :param description: Gets or sets the description of the activity parameter. + :type description: str + :param validation_set: Gets or sets the validation set of activity parameter. + :type validation_set: list[~azure.mgmt.automation.models.ActivityParameterValidationSet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'is_dynamic': {'key': 'isDynamic', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'long'}, + 'value_from_pipeline': {'key': 'valueFromPipeline', 'type': 'bool'}, + 'value_from_pipeline_by_property_name': {'key': 'valueFromPipelineByPropertyName', 'type': 'bool'}, + 'value_from_remaining_arguments': {'key': 'valueFromRemainingArguments', 'type': 'bool'}, + 'description': {'key': 'description', 'type': 'str'}, + 'validation_set': {'key': 'validationSet', 'type': '[ActivityParameterValidationSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(ActivityParameter, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.is_mandatory = kwargs.get('is_mandatory', None) + self.is_dynamic = kwargs.get('is_dynamic', None) + self.position = kwargs.get('position', None) + self.value_from_pipeline = kwargs.get('value_from_pipeline', None) + self.value_from_pipeline_by_property_name = kwargs.get('value_from_pipeline_by_property_name', None) + self.value_from_remaining_arguments = kwargs.get('value_from_remaining_arguments', None) + self.description = kwargs.get('description', None) + self.validation_set = kwargs.get('validation_set', None) + + +class ActivityParameterSet(msrest.serialization.Model): + """Definition of the activity parameter set. + + :param name: Gets or sets the name of the activity parameter set. + :type name: str + :param parameters: Gets or sets the parameters of the activity parameter set. + :type parameters: list[~azure.mgmt.automation.models.ActivityParameter] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ActivityParameter]'}, + } + + def __init__( + self, + **kwargs + ): + super(ActivityParameterSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.parameters = kwargs.get('parameters', None) + + +class ActivityParameterValidationSet(msrest.serialization.Model): + """Definition of the activity parameter validation set. + + :param member_value: Gets or sets the name of the activity parameter validation set member. + :type member_value: str + """ + + _attribute_map = { + 'member_value': {'key': 'memberValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ActivityParameterValidationSet, self).__init__(**kwargs) + self.member_value = kwargs.get('member_value', None) + + +class AdvancedScheduleMonthlyOccurrence(msrest.serialization.Model): + """The properties of the create advanced schedule monthly occurrence. + + :param occurrence: Occurrence of the week within the month. Must be between 1 and 5. + :type occurrence: int + :param day: Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, + saturday, sunday. Possible values include: "Monday", "Tuesday", "Wednesday", "Thursday", + "Friday", "Saturday", "Sunday". + :type day: str or ~azure.mgmt.automation.models.ScheduleDay + """ + + _attribute_map = { + 'occurrence': {'key': 'occurrence', 'type': 'int'}, + 'day': {'key': 'day', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AdvancedScheduleMonthlyOccurrence, self).__init__(**kwargs) + self.occurrence = kwargs.get('occurrence', None) + self.day = kwargs.get('day', None) + + +class AgentRegistration(msrest.serialization.Model): + """Definition of the agent registration information type. + + :param dsc_meta_configuration: Gets or sets the dsc meta configuration. + :type dsc_meta_configuration: str + :param endpoint: Gets or sets the dsc server endpoint. + :type endpoint: str + :param keys: Gets or sets the agent registration keys. + :type keys: ~azure.mgmt.automation.models.AgentRegistrationKeys + :param id: Gets or sets the id. + :type id: str + """ + + _attribute_map = { + 'dsc_meta_configuration': {'key': 'dscMetaConfiguration', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'keys': {'key': 'keys', 'type': 'AgentRegistrationKeys'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentRegistration, self).__init__(**kwargs) + self.dsc_meta_configuration = kwargs.get('dsc_meta_configuration', None) + self.endpoint = kwargs.get('endpoint', None) + self.keys = kwargs.get('keys', None) + self.id = kwargs.get('id', None) + + +class AgentRegistrationKeys(msrest.serialization.Model): + """Definition of the agent registration keys. + + :param primary: Gets or sets the primary key. + :type primary: str + :param secondary: Gets or sets the secondary key. + :type secondary: str + """ + + _attribute_map = { + 'primary': {'key': 'primary', 'type': 'str'}, + 'secondary': {'key': 'secondary', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentRegistrationKeys, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) + self.secondary = kwargs.get('secondary', None) + + +class AgentRegistrationRegenerateKeyParameter(msrest.serialization.Model): + """The parameters supplied to the regenerate keys operation. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Gets or sets the agent registration key name - primary or secondary. + Possible values include: "primary", "secondary". + :type key_name: str or ~azure.mgmt.automation.models.AgentRegistrationKeyName + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentRegistrationRegenerateKeyParameter, self).__init__(**kwargs) + self.key_name = kwargs['key_name'] + + +class Resource(msrest.serialization.Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class AutomationAccount(TrackedResource): + """Definition of the automation account type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: 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.datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', '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'}, + } + + def __init__( + self, + **kwargs + ): + super(AutomationAccount, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.sku = kwargs.get('sku', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.state = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) + + +class AutomationAccountCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update automation account operation. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + } + + def __init__( + self, + **kwargs + ): + super(AutomationAccountCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + + +class AutomationAccountListResult(msrest.serialization.Model): + """The response model for the list account operation. + + :param value: Gets or sets list of accounts. + :type value: list[~azure.mgmt.automation.models.AutomationAccount] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AutomationAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutomationAccountListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class AutomationAccountUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update automation account operation. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + } + + def __init__( + self, + **kwargs + ): + super(AutomationAccountUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + + +class AzureQueryProperties(msrest.serialization.Model): + """Azure query for the update configuration. + + :param scope: List of Subscription or Resource Group ARM Ids. + :type scope: list[str] + :param locations: List of locations to scope the query to. + :type locations: list[str] + :param tag_settings: Tag settings for the VM. + :type tag_settings: ~azure.mgmt.automation.models.TagSettingsProperties + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': '[str]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'tag_settings': {'key': 'tagSettings', 'type': 'TagSettingsProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureQueryProperties, self).__init__(**kwargs) + self.scope = kwargs.get('scope', None) + self.locations = kwargs.get('locations', None) + self.tag_settings = kwargs.get('tag_settings', None) + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class Certificate(ProxyResource): + """Definition of the certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar thumbprint: Gets the thumbprint of the certificate. + :vartype thumbprint: str + :ivar expiry_time: Gets the expiry time of the certificate. + :vartype expiry_time: ~datetime.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.datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'expiry_time': {'readonly': True}, + 'is_exportable': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Certificate, self).__init__(**kwargs) + self.thumbprint = None + self.expiry_time = None + self.is_exportable = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) + + +class CertificateCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update or replace certificate operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the certificate. + :type name: str + :param base64_value: Required. Gets or sets the base64 encoded value of the certificate. + :type base64_value: str + :param description: Gets or sets the description of the certificate. + :type description: str + :param thumbprint: Gets or sets the thumbprint of the certificate. + :type thumbprint: str + :param is_exportable: Gets or sets the is exportable flag of the certificate. + :type is_exportable: bool + """ + + _validation = { + 'name': {'required': True}, + 'base64_value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'base64_value': {'key': 'properties.base64Value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs['name'] + self.base64_value = kwargs['base64_value'] + self.description = kwargs.get('description', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.is_exportable = kwargs.get('is_exportable', None) + + +class CertificateListResult(msrest.serialization.Model): + """The response model for the list certificate operation. + + :param value: Gets or sets a list of certificates. + :type value: list[~azure.mgmt.automation.models.Certificate] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Certificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class CertificateUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update certificate operation. + + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + + +class CollectionItemUpdateConfiguration(msrest.serialization.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: ~datetime.timedelta + """ + + _attribute_map = { + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + } + + def __init__( + self, + **kwargs + ): + super(CollectionItemUpdateConfiguration, self).__init__(**kwargs) + self.azure_virtual_machines = kwargs.get('azure_virtual_machines', None) + self.duration = kwargs.get('duration', None) + + +class Connection(ProxyResource): + """Definition of the connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param connection_type: Gets or sets the connectionType of the connection. + :type connection_type: ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :ivar field_definition_values: Gets the field definition values of the connection. + :vartype field_definition_values: dict[str, str] + :ivar creation_time: Gets the creation time. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definition_values': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Connection, self).__init__(**kwargs) + self.connection_type = kwargs.get('connection_type', None) + self.field_definition_values = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) + + +class ConnectionCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update connection operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param connection_type: Required. Gets or sets the connectionType of the connection. + :type connection_type: ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :param field_definition_values: Gets or sets the field definition properties of the connection. + :type field_definition_values: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'connection_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs['name'] + self.description = kwargs.get('description', None) + self.connection_type = kwargs['connection_type'] + self.field_definition_values = kwargs.get('field_definition_values', None) + + +class ConnectionListResult(msrest.serialization.Model): + """The response model for the list connection operation. + + :param value: Gets or sets a list of connection. + :type value: list[~azure.mgmt.automation.models.Connection] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Connection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ConnectionType(msrest.serialization.Model): + """Definition of the connection type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the connection type. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param is_global: Gets or sets a Boolean value to indicate if the connection type is global. + :type is_global: bool + :ivar field_definitions: Gets the field definitions of the connection type. + :vartype field_definitions: dict[str, ~azure.mgmt.automation.models.FieldDefinition] + :ivar creation_time: Gets the creation time. + :vartype creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definitions': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionType, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.is_global = kwargs.get('is_global', None) + self.field_definitions = None + self.creation_time = None + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + + +class ConnectionTypeAssociationProperty(msrest.serialization.Model): + """The connection type property associated with the entity. + + :param name: Gets or sets the name of the connection type. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionTypeAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class ConnectionTypeCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update connection type operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection type. + :type name: str + :param is_global: Gets or sets a Boolean value to indicate if the connection type is global. + :type is_global: bool + :param field_definitions: Required. Gets or sets the field definitions of the connection type. + :type field_definitions: dict[str, ~azure.mgmt.automation.models.FieldDefinition] + """ + + _validation = { + 'name': {'required': True}, + 'field_definitions': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionTypeCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs['name'] + self.is_global = kwargs.get('is_global', None) + self.field_definitions = kwargs['field_definitions'] + + +class ConnectionTypeListResult(msrest.serialization.Model): + """The response model for the list connection type operation. + + :param value: Gets or sets a list of connection types. + :type value: list[~azure.mgmt.automation.models.ConnectionType] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConnectionType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionTypeListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ConnectionUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update connection operation. + + :param name: Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param field_definition_values: Gets or sets the field definition values of the connection. + :type field_definition_values: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.field_definition_values = kwargs.get('field_definition_values', None) + + +class ContentHash(msrest.serialization.Model): + """Definition of the runbook property type. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. Gets or sets the content hash algorithm used to hash the content. + :type algorithm: str + :param value: Required. Gets or sets expected hash value of the content. + :type value: str + """ + + _validation = { + 'algorithm': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'algorithm', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContentHash, self).__init__(**kwargs) + self.algorithm = kwargs['algorithm'] + self.value = kwargs['value'] + + +class ContentLink(msrest.serialization.Model): + """Definition of the content link. + + :param uri: Gets or sets the uri of the runbook content. + :type uri: str + :param content_hash: Gets or sets the hash. + :type content_hash: ~azure.mgmt.automation.models.ContentHash + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_hash': {'key': 'contentHash', 'type': 'ContentHash'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContentLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_hash = kwargs.get('content_hash', None) + self.version = kwargs.get('version', None) + + +class ContentSource(msrest.serialization.Model): + """Definition of the content source. + + :param hash: Gets or sets the hash. + :type hash: ~azure.mgmt.automation.models.ContentHash + :param type: Gets or sets the content source type. Possible values include: "embeddedContent", + "uri". + :type type: str or ~azure.mgmt.automation.models.ContentSourceType + :param value: Gets or sets the value of the content. This is based on the content source type. + :type value: str + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'hash': {'key': 'hash', 'type': 'ContentHash'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContentSource, self).__init__(**kwargs) + self.hash = kwargs.get('hash', None) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) + self.version = kwargs.get('version', None) + + +class Credential(ProxyResource): + """Definition of the credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar user_name: Gets the user name of the credential. + :vartype user_name: str + :ivar creation_time: Gets the creation time. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_name': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Credential, self).__init__(**kwargs) + self.user_name = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) + + +class CredentialCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update credential operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the credential. + :type name: str + :param user_name: Required. Gets or sets the user name of the credential. + :type user_name: str + :param password: Required. Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _validation = { + 'name': {'required': True}, + 'user_name': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs['name'] + self.user_name = kwargs['user_name'] + self.password = kwargs['password'] + self.description = kwargs.get('description', None) + + +class CredentialListResult(msrest.serialization.Model): + """The response model for the list credential operation. + + :param value: Gets or sets a list of credentials. + :type value: list[~azure.mgmt.automation.models.Credential] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Credential]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class CredentialUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the Update credential operation. + + :param name: Gets or sets the name of the credential. + :type name: str + :param user_name: Gets or sets the user name of the credential. + :type user_name: str + :param password: Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + self.description = kwargs.get('description', None) + + +class DscCompilationJob(ProxyResource): + """Definition of the Dsc Compilation job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param configuration: Gets or sets the configuration. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :ivar started_by: Gets the compilation job started by. + :vartype started_by: str + :ivar job_id: Gets the id of the job. + :vartype job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: ~datetime.datetime + :param provisioning_state: The current provisioning state of the job. Possible values include: + "Failed", "Succeeded", "Suspended", "Processing". + :type provisioning_state: str or ~azure.mgmt.automation.models.JobProvisioningState + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + :param status: Gets or sets the status of the job. Possible values include: "New", + "Activating", "Running", "Completed", "Failed", "Stopped", "Blocked", "Suspended", + "Disconnected", "Suspending", "Stopping", "Resuming", "Removing". + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :ivar start_time: Gets the start time of the job. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: ~datetime.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.datetime + :ivar last_status_modified_time: Gets the last status modified time of the job. + :vartype last_status_modified_time: ~datetime.datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'started_by': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'exception': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_status_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DscCompilationJob, self).__init__(**kwargs) + self.configuration = kwargs.get('configuration', None) + self.started_by = None + self.job_id = None + self.creation_time = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.run_on = kwargs.get('run_on', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.start_time = None + self.end_time = None + self.exception = None + self.last_modified_time = None + self.last_status_modified_time = None + self.parameters = kwargs.get('parameters', None) + + +class DscCompilationJobCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create compilation job operation. + + All required parameters must be populated in order to send to Azure. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param configuration: Required. Gets or sets the configuration. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + """ + + _validation = { + 'configuration': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DscCompilationJobCreateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.configuration = kwargs['configuration'] + self.parameters = kwargs.get('parameters', None) + self.increment_node_configuration_build = kwargs.get('increment_node_configuration_build', None) + + +class DscCompilationJobListResult(msrest.serialization.Model): + """The response model for the list job operation. + + :param value: Gets or sets a list of Dsc Compilation jobs. + :type value: list[~azure.mgmt.automation.models.DscCompilationJob] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscCompilationJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscCompilationJobListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class DscConfiguration(TrackedResource): + """Definition of the configuration type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :ivar provisioning_state: Gets or sets the provisioning state of the configuration. Default + value: "Succeeded". + :vartype provisioning_state: str + :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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param node_configuration_count: Gets the number of compiled node configurations. + :type node_configuration_count: int + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'node_configuration_count': {'key': 'properties.nodeConfigurationCount', 'type': 'int'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + provisioning_state = "Succeeded" + + def __init__( + self, + **kwargs + ): + super(DscConfiguration, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.job_count = kwargs.get('job_count', None) + self.parameters = kwargs.get('parameters', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.node_configuration_count = kwargs.get('node_configuration_count', None) + self.description = kwargs.get('description', None) + + +class DscConfigurationAssociationProperty(msrest.serialization.Model): + """The Dsc configuration property associated with the entity. + + :param name: Gets or sets the name of the Dsc configuration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscConfigurationAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class DscConfigurationCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, 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 source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + super(DscConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.source = kwargs['source'] + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) + + +class DscConfigurationListResult(msrest.serialization.Model): + """The response model for the list configuration operation. + + :param value: Gets or sets a list of configurations. + :type value: list[~azure.mgmt.automation.models.DscConfiguration] + :param next_link: Gets or sets the next link. + :type next_link: str + :param total_count: Gets the total number of configurations matching filter criteria. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DscConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + self.total_count = kwargs.get('total_count', None) + + +class DscConfigurationParameter(msrest.serialization.Model): + """Definition of the configuration parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the parameter is + mandatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscConfigurationParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.is_mandatory = kwargs.get('is_mandatory', None) + self.position = kwargs.get('position', None) + self.default_value = kwargs.get('default_value', None) + + +class DscConfigurationUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update configuration operation. + + :param name: Gets or sets name of the resource. + :type name: str + :param tags: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, 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 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 + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + super(DscConfigurationUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tags = kwargs.get('tags', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.source = kwargs.get('source', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) + + +class DscMetaConfiguration(msrest.serialization.Model): + """Definition of the DSC Meta Configuration. + + :param configuration_mode_frequency_mins: Gets or sets the ConfigurationModeFrequencyMins value + of the meta configuration. + :type configuration_mode_frequency_mins: int + :param reboot_node_if_needed: Gets or sets the RebootNodeIfNeeded value of the meta + configuration. + :type reboot_node_if_needed: bool + :param configuration_mode: Gets or sets the ConfigurationMode value of the meta configuration. + :type configuration_mode: str + :param action_after_reboot: Gets or sets the ActionAfterReboot value of the meta configuration. + :type action_after_reboot: str + :param certificate_id: Gets or sets the CertificateId value of the meta configuration. + :type certificate_id: str + :param refresh_frequency_mins: Gets or sets the RefreshFrequencyMins value of the meta + configuration. + :type refresh_frequency_mins: int + :param allow_module_overwrite: Gets or sets the AllowModuleOverwrite value of the meta + configuration. + :type allow_module_overwrite: bool + """ + + _attribute_map = { + 'configuration_mode_frequency_mins': {'key': 'configurationModeFrequencyMins', 'type': 'int'}, + 'reboot_node_if_needed': {'key': 'rebootNodeIfNeeded', 'type': 'bool'}, + 'configuration_mode': {'key': 'configurationMode', 'type': 'str'}, + 'action_after_reboot': {'key': 'actionAfterReboot', 'type': 'str'}, + 'certificate_id': {'key': 'certificateId', 'type': 'str'}, + 'refresh_frequency_mins': {'key': 'refreshFrequencyMins', 'type': 'int'}, + 'allow_module_overwrite': {'key': 'allowModuleOverwrite', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DscMetaConfiguration, self).__init__(**kwargs) + self.configuration_mode_frequency_mins = kwargs.get('configuration_mode_frequency_mins', None) + self.reboot_node_if_needed = kwargs.get('reboot_node_if_needed', None) + self.configuration_mode = kwargs.get('configuration_mode', None) + self.action_after_reboot = kwargs.get('action_after_reboot', None) + self.certificate_id = kwargs.get('certificate_id', None) + self.refresh_frequency_mins = kwargs.get('refresh_frequency_mins', None) + self.allow_module_overwrite = kwargs.get('allow_module_overwrite', None) + + +class DscNode(ProxyResource): + """Definition of a DscNode. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_seen: Gets or sets the last seen time of the node. + :type last_seen: ~datetime.datetime + :param registration_time: Gets or sets the registration time of the node. + :type registration_time: ~datetime.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 status: Gets or sets the status of the node. + :type status: str + :param node_id: Gets or sets the node id. + :type node_id: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param total_count: Gets the total number of records matching filter criteria. + :type total_count: int + :param extension_handler: Gets or sets the list of extensionHandler properties for a Node. + :type extension_handler: + list[~azure.mgmt.automation.models.DscNodeExtensionHandlerAssociationProperty] + :param name_properties_node_configuration_name: Gets or sets the name of the dsc node + configuration. + :type name_properties_node_configuration_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_seen': {'key': 'properties.lastSeen', 'type': 'iso-8601'}, + 'registration_time': {'key': 'properties.registrationTime', 'type': 'iso-8601'}, + 'ip': {'key': 'properties.ip', 'type': 'str'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'node_id': {'key': 'properties.nodeId', 'type': 'str'}, + 'etag': {'key': 'properties.etag', 'type': 'str'}, + 'total_count': {'key': 'properties.totalCount', 'type': 'int'}, + 'extension_handler': {'key': 'properties.extensionHandler', 'type': '[DscNodeExtensionHandlerAssociationProperty]'}, + 'name_properties_node_configuration_name': {'key': 'properties.nodeConfiguration.name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscNode, self).__init__(**kwargs) + self.last_seen = kwargs.get('last_seen', None) + self.registration_time = kwargs.get('registration_time', None) + self.ip = kwargs.get('ip', None) + self.account_id = kwargs.get('account_id', None) + self.status = kwargs.get('status', None) + self.node_id = kwargs.get('node_id', None) + self.etag = kwargs.get('etag', None) + self.total_count = kwargs.get('total_count', None) + self.extension_handler = kwargs.get('extension_handler', None) + self.name_properties_node_configuration_name = kwargs.get('name_properties_node_configuration_name', None) + + +class DscNodeConfiguration(ProxyResource): + """Definition of the dsc node configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param creation_time: Gets or sets creation time. + :type creation_time: ~datetime.datetime + :param configuration: Gets or sets the configuration of the node. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param source: Source of node configuration. + :type source: str + :param node_count: Number of nodes with this node configuration assigned. + :type node_count: long + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'long'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DscNodeConfiguration, self).__init__(**kwargs) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.creation_time = kwargs.get('creation_time', None) + self.configuration = kwargs.get('configuration', None) + self.source = kwargs.get('source', None) + self.node_count = kwargs.get('node_count', None) + self.increment_node_configuration_build = kwargs.get('increment_node_configuration_build', None) + + +class DscNodeConfigurationCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update node configuration operation. + + :param name: Name of the node configuration. + :type name: str + :param tags: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param configuration: Gets or sets the configuration of the node. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DscNodeConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tags = kwargs.get('tags', None) + self.source = kwargs.get('source', None) + self.configuration = kwargs.get('configuration', None) + self.increment_node_configuration_build = kwargs.get('increment_node_configuration_build', None) + + +class DscNodeConfigurationListResult(msrest.serialization.Model): + """The response model for the list job operation. + + :param value: Gets or sets a list of Dsc node configurations. + :type value: list[~azure.mgmt.automation.models.DscNodeConfiguration] + :param next_link: Gets or sets the next link. + :type next_link: str + :param total_count: Gets or sets the total rows in query. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscNodeConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DscNodeConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + self.total_count = kwargs.get('total_count', None) + + +class DscNodeExtensionHandlerAssociationProperty(msrest.serialization.Model): + """The dsc extensionHandler property associated with the node. + + :param name: Gets or sets the name of the extension handler. + :type name: str + :param version: Gets or sets the version of the extension handler. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscNodeExtensionHandlerAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + + +class DscNodeListResult(msrest.serialization.Model): + """The response model for the list dsc nodes operation. + + :param value: Gets or sets a list of dsc nodes. + :type value: list[~azure.mgmt.automation.models.DscNode] + :param next_link: Gets or sets the next link. + :type next_link: str + :param total_count: Gets the total number of nodes matching filter criteria. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscNode]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DscNodeListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + self.total_count = kwargs.get('total_count', None) + + +class DscNodeReport(msrest.serialization.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.datetime + :param last_modified_time: Gets or sets the lastModifiedTime of the node report. + :type last_modified_time: ~datetime.datetime + :param start_time: Gets or sets the start time of the node report. + :type start_time: ~datetime.datetime + :param type: Gets or sets the type of the node report. + :type type: str + :param report_id: Gets or sets the id of the node report. + :type report_id: str + :param status: Gets or sets the status of the node report. + :type status: str + :param refresh_mode: Gets or sets the refreshMode of the node report. + :type refresh_mode: str + :param reboot_requested: Gets or sets the rebootRequested of the node report. + :type reboot_requested: str + :param report_format_version: Gets or sets the reportFormatVersion of the node report. + :type report_format_version: str + :param configuration_version: Gets or sets the configurationVersion of the node report. + :type configuration_version: str + :param id: Gets or sets the id. + :type id: str + :param errors: Gets or sets the errors for the node report. + :type errors: list[~azure.mgmt.automation.models.DscReportError] + :param resources: Gets or sets the resource for the node report. + :type resources: list[~azure.mgmt.automation.models.DscReportResource] + :param meta_configuration: Gets or sets the metaConfiguration of the node at the time of the + report. + :type meta_configuration: ~azure.mgmt.automation.models.DscMetaConfiguration + :param host_name: Gets or sets the hostname of the node that sent the report. + :type host_name: str + :param i_pv4_addresses: Gets or sets the IPv4 address of the node that sent the report. + :type i_pv4_addresses: list[str] + :param i_pv6_addresses: Gets or sets the IPv6 address of the node that sent the report. + :type i_pv6_addresses: list[str] + :param number_of_resources: Gets or sets the number of resource in the node report. + :type number_of_resources: int + :param raw_errors: Gets or sets the unparsed errors for the node report. + :type raw_errors: str + """ + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'report_id': {'key': 'reportId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'refresh_mode': {'key': 'refreshMode', 'type': 'str'}, + 'reboot_requested': {'key': 'rebootRequested', 'type': 'str'}, + 'report_format_version': {'key': 'reportFormatVersion', 'type': 'str'}, + 'configuration_version': {'key': 'configurationVersion', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[DscReportError]'}, + 'resources': {'key': 'resources', 'type': '[DscReportResource]'}, + 'meta_configuration': {'key': 'metaConfiguration', 'type': 'DscMetaConfiguration'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'i_pv4_addresses': {'key': 'iPV4Addresses', 'type': '[str]'}, + 'i_pv6_addresses': {'key': 'iPV6Addresses', 'type': '[str]'}, + 'number_of_resources': {'key': 'numberOfResources', 'type': 'int'}, + 'raw_errors': {'key': 'rawErrors', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscNodeReport, self).__init__(**kwargs) + self.end_time = kwargs.get('end_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.start_time = kwargs.get('start_time', None) + self.type = kwargs.get('type', None) + self.report_id = kwargs.get('report_id', None) + self.status = kwargs.get('status', None) + self.refresh_mode = kwargs.get('refresh_mode', None) + self.reboot_requested = kwargs.get('reboot_requested', None) + self.report_format_version = kwargs.get('report_format_version', None) + self.configuration_version = kwargs.get('configuration_version', None) + self.id = kwargs.get('id', None) + self.errors = kwargs.get('errors', None) + self.resources = kwargs.get('resources', None) + self.meta_configuration = kwargs.get('meta_configuration', None) + self.host_name = kwargs.get('host_name', None) + self.i_pv4_addresses = kwargs.get('i_pv4_addresses', None) + self.i_pv6_addresses = kwargs.get('i_pv6_addresses', None) + self.number_of_resources = kwargs.get('number_of_resources', None) + self.raw_errors = kwargs.get('raw_errors', None) + + +class DscNodeReportListResult(msrest.serialization.Model): + """The response model for the list dsc nodes operation. + + :param value: Gets or sets a list of dsc node reports. + :type value: list[~azure.mgmt.automation.models.DscNodeReport] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscNodeReport]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscNodeReportListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class DscNodeUpdateParameters(msrest.serialization.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 name: Gets or sets the name of the dsc node configuration. + :type name: str + """ + + _attribute_map = { + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'name': {'key': 'properties.nodeConfiguration.name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscNodeUpdateParameters, self).__init__(**kwargs) + self.node_id = kwargs.get('node_id', None) + self.name = kwargs.get('name', None) + + +class DscReportError(msrest.serialization.Model): + """Definition of the dsc node report error type. + + :param error_source: Gets or sets the source of the error. + :type error_source: str + :param resource_id: Gets or sets the resource ID which generated the error. + :type resource_id: str + :param error_code: Gets or sets the error code. + :type error_code: str + :param error_message: Gets or sets the error message. + :type error_message: str + :param locale: Gets or sets the locale of the error. + :type locale: str + :param error_details: Gets or sets the error details. + :type error_details: str + """ + + _attribute_map = { + 'error_source': {'key': 'errorSource', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'locale': {'key': 'locale', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscReportError, self).__init__(**kwargs) + self.error_source = kwargs.get('error_source', None) + self.resource_id = kwargs.get('resource_id', None) + self.error_code = kwargs.get('error_code', None) + self.error_message = kwargs.get('error_message', None) + self.locale = kwargs.get('locale', None) + self.error_details = kwargs.get('error_details', None) + + +class DscReportResource(msrest.serialization.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.datetime + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'source_info': {'key': 'sourceInfo', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[DscReportResourceNavigation]'}, + 'module_name': {'key': 'moduleName', 'type': 'str'}, + 'module_version': {'key': 'moduleVersion', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'float'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(DscReportResource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.source_info = kwargs.get('source_info', None) + self.depends_on = kwargs.get('depends_on', None) + self.module_name = kwargs.get('module_name', None) + self.module_version = kwargs.get('module_version', None) + self.resource_name = kwargs.get('resource_name', None) + self.error = kwargs.get('error', None) + self.status = kwargs.get('status', None) + self.duration_in_seconds = kwargs.get('duration_in_seconds', None) + self.start_date = kwargs.get('start_date', None) + + +class DscReportResourceNavigation(msrest.serialization.Model): + """Navigation for DSC Report Resource. + + :param resource_id: Gets or sets the ID of the resource to navigate to. + :type resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DscReportResourceNavigation, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + + +class ErrorResponse(msrest.serialization.Model): + """Error response of an operation failure. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class FieldDefinition(msrest.serialization.Model): + """Definition of the connection fields. + + All required parameters must be populated in order to send to Azure. + + :param is_encrypted: Gets or sets the isEncrypted flag of the connection field definition. + :type is_encrypted: bool + :param is_optional: Gets or sets the isOptional flag of the connection field definition. + :type is_optional: bool + :param type: Required. Gets or sets the type of the connection field definition. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_encrypted': {'key': 'isEncrypted', 'type': 'bool'}, + 'is_optional': {'key': 'isOptional', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FieldDefinition, self).__init__(**kwargs) + self.is_encrypted = kwargs.get('is_encrypted', None) + self.is_optional = kwargs.get('is_optional', None) + self.type = kwargs['type'] + + +class HybridRunbookWorker(msrest.serialization.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.datetime + :param last_seen_date_time: Last Heartbeat from the Worker. + :type last_seen_date_time: ~datetime.datetime + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ip': {'key': 'ip', 'type': 'str'}, + 'registration_time': {'key': 'registrationTime', 'type': 'iso-8601'}, + 'last_seen_date_time': {'key': 'lastSeenDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridRunbookWorker, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.ip = kwargs.get('ip', None) + self.registration_time = kwargs.get('registration_time', None) + self.last_seen_date_time = kwargs.get('last_seen_date_time', None) + + +class HybridRunbookWorkerGroup(msrest.serialization.Model): + """Definition of hybrid runbook worker group. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the name of the group. + :type name: str + :param hybrid_runbook_workers: Gets or sets the list of hybrid runbook workers. + :type hybrid_runbook_workers: list[~azure.mgmt.automation.models.HybridRunbookWorker] + :param credential: Sets the credential of a worker group. + :type credential: ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + :param group_type: Type of the HybridWorkerGroup. Possible values include: "User", "System". + :type group_type: str or ~azure.mgmt.automation.models.GroupTypeEnum + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'hybrid_runbook_workers': {'key': 'hybridRunbookWorkers', 'type': '[HybridRunbookWorker]'}, + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + 'group_type': {'key': 'groupType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridRunbookWorkerGroup, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.hybrid_runbook_workers = kwargs.get('hybrid_runbook_workers', None) + self.credential = kwargs.get('credential', None) + self.group_type = kwargs.get('group_type', None) + + +class HybridRunbookWorkerGroupsListResult(msrest.serialization.Model): + """The response model for the list hybrid runbook worker groups. + + :param value: Gets or sets a list of hybrid runbook worker groups. + :type value: list[~azure.mgmt.automation.models.HybridRunbookWorkerGroup] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridRunbookWorkerGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridRunbookWorkerGroupsListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class HybridRunbookWorkerGroupUpdateParameters(msrest.serialization.Model): + """Parameters supplied to the update operation. + + :param credential: Sets the credential of a worker group. + :type credential: ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + """ + + _attribute_map = { + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridRunbookWorkerGroupUpdateParameters, self).__init__(**kwargs) + self.credential = kwargs.get('credential', None) + + +class Job(ProxyResource): + """Definition of the job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param started_by: Gets or sets the job started by. + :type started_by: str + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + :param job_id: Gets or sets the id of the job. + :type job_id: str + :param creation_time: Gets or sets the creation time of the job. + :type creation_time: ~datetime.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.datetime + :param end_time: Gets or sets the end time of the job. + :type end_time: ~datetime.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.datetime + :param last_status_modified_time: Gets or sets the last status modified time of the job. + :type last_status_modified_time: ~datetime.datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param provisioning_state: The current provisioning state of the job. Possible values include: + "Failed", "Succeeded", "Suspended", "Processing". + :type provisioning_state: str or ~azure.mgmt.automation.models.JobProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Job, self).__init__(**kwargs) + self.runbook = kwargs.get('runbook', None) + self.started_by = kwargs.get('started_by', None) + self.run_on = kwargs.get('run_on', None) + self.job_id = kwargs.get('job_id', None) + self.creation_time = kwargs.get('creation_time', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.exception = kwargs.get('exception', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.last_status_modified_time = kwargs.get('last_status_modified_time', None) + self.parameters = kwargs.get('parameters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class JobCollectionItem(ProxyResource): + """Job collection item properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar runbook: The runbook association. + :vartype runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :ivar job_id: The id of the job. + :vartype job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: ~datetime.datetime + :ivar status: The status of the job. Possible values include: "New", "Activating", "Running", + "Completed", "Failed", "Stopped", "Blocked", "Suspended", "Disconnected", "Suspending", + "Stopping", "Resuming", "Removing". + :vartype status: str or ~azure.mgmt.automation.models.JobStatus + :ivar start_time: The start time of the job. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the job. + :vartype end_time: ~datetime.datetime + :ivar last_modified_time: The last modified time of the job. + :vartype last_modified_time: ~datetime.datetime + :ivar provisioning_state: The provisioning state of a resource. + :vartype provisioning_state: str + :param run_on: Specifies the runOn group name where the job was executed. + :type run_on: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'runbook': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobCollectionItem, self).__init__(**kwargs) + self.runbook = None + self.job_id = None + self.creation_time = None + self.status = None + self.start_time = None + self.end_time = None + self.last_modified_time = None + self.provisioning_state = None + self.run_on = kwargs.get('run_on', None) + + +class JobCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create job operation. + + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + """ + + _attribute_map = { + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobCreateParameters, self).__init__(**kwargs) + self.runbook = kwargs.get('runbook', None) + self.parameters = kwargs.get('parameters', None) + self.run_on = kwargs.get('run_on', None) + + +class JobListResultV2(msrest.serialization.Model): + """The response model for the list job operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of jobs. + :type value: list[~azure.mgmt.automation.models.JobCollectionItem] + :ivar next_link: The link to the next page. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobCollectionItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobListResultV2, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class JobNavigation(msrest.serialization.Model): + """Software update configuration machine run job navigation properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Id of the job associated with the software update configuration run. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobNavigation, self).__init__(**kwargs) + self.id = None + + +class JobSchedule(msrest.serialization.Model): + """Definition of the job schedule. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the variable. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: ~datetime.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.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. + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: ~datetime.datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible values include: + "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param creation_time: Gets or sets the creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :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] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'week_days': {'key': 'properties.advancedSchedule.weekDays', 'type': '[str]'}, + 'month_days': {'key': 'properties.advancedSchedule.monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'properties.advancedSchedule.monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__( + self, + **kwargs + ): + super(JobSchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.start_time = kwargs.get('start_time', None) + self.start_time_offset_minutes = None + self.expiry_time = kwargs.get('expiry_time', None) + self.expiry_time_offset_minutes = kwargs.get('expiry_time_offset_minutes', None) + self.is_enabled = kwargs.get('is_enabled', False) + self.next_run = kwargs.get('next_run', None) + self.next_run_offset_minutes = kwargs.get('next_run_offset_minutes', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs.get('frequency', None) + self.time_zone = kwargs.get('time_zone', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + self.week_days = kwargs.get('week_days', None) + self.month_days = kwargs.get('month_days', None) + self.monthly_occurrences = kwargs.get('monthly_occurrences', None) + + +class JobScheduleCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create job schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Required. Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job should run on. + :type run_on: str + :param parameters: Gets or sets a list of job properties. + :type parameters: dict[str, str] + """ + + _validation = { + 'schedule': {'required': True}, + 'runbook': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(JobScheduleCreateParameters, self).__init__(**kwargs) + self.schedule = kwargs['schedule'] + self.runbook = kwargs['runbook'] + self.run_on = kwargs.get('run_on', None) + self.parameters = kwargs.get('parameters', None) + + +class JobScheduleListResult(msrest.serialization.Model): + """The response model for the list job schedule operation. + + :param value: Gets or sets a list of job schedules. + :type value: list[~azure.mgmt.automation.models.JobSchedule] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobSchedule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobScheduleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class JobScheduleProperties(msrest.serialization.Model): + """Definition of job schedule parameters. + + :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 = { + 'job_schedule_id': {'key': 'jobScheduleId', 'type': 'str'}, + 'schedule': {'key': 'schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(JobScheduleProperties, self).__init__(**kwargs) + self.job_schedule_id = kwargs.get('job_schedule_id', None) + self.schedule = kwargs.get('schedule', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + self.parameters = kwargs.get('parameters', None) + + +class JobStream(msrest.serialization.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.datetime + :param stream_type: Gets or sets the stream type. Possible values include: "Progress", + "Output", "Warning", "Error", "Debug", "Verbose", "Any". + :type stream_type: str or ~azure.mgmt.automation.models.JobStreamType + :param stream_text: Gets or sets the stream text. + :type stream_text: str + :param summary: Gets or sets the summary. + :type summary: str + :param value: Gets or sets the values of the job stream. + :type value: dict[str, object] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'job_stream_id': {'key': 'properties.jobStreamId', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + 'stream_text': {'key': 'properties.streamText', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(JobStream, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.job_stream_id = kwargs.get('job_stream_id', None) + self.time = kwargs.get('time', None) + self.stream_type = kwargs.get('stream_type', None) + self.stream_text = kwargs.get('stream_text', None) + self.summary = kwargs.get('summary', None) + self.value = kwargs.get('value', None) + + +class JobStreamListResult(msrest.serialization.Model): + """The response model for the list job stream operation. + + :param value: A list of job streams. + :type value: list[~azure.mgmt.automation.models.JobStream] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobStream]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobStreamListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Key(msrest.serialization.Model): + """Automation key which is used to register a DSC Node. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key_name: Automation key name. Possible values include: "Primary", "Secondary". + :vartype key_name: str or ~azure.mgmt.automation.models.AutomationKeyName + :ivar permissions: Automation key permissions. Possible values include: "Read", "Full". + :vartype permissions: str or ~azure.mgmt.automation.models.AutomationKeyPermissions + :ivar value: Value of the Automation Key used for registration. + :vartype value: str + """ + + _validation = { + 'key_name': {'readonly': True}, + 'permissions': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'KeyName', 'type': 'str'}, + 'permissions': {'key': 'Permissions', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Key, self).__init__(**kwargs) + self.key_name = None + self.permissions = None + self.value = None + + +class KeyListResult(msrest.serialization.Model): + """KeyListResult. + + :param keys: Lists the automation keys. + :type keys: list[~azure.mgmt.automation.models.Key] + """ + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[Key]'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyListResult, self).__init__(**kwargs) + self.keys = kwargs.get('keys', None) + + +class LinkedWorkspace(msrest.serialization.Model): + """Definition of the linked workspace. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets the id of the linked workspace. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LinkedWorkspace, self).__init__(**kwargs) + self.id = None + + +class LinuxProperties(msrest.serialization.Model): + """Linux specific update configuration. + + :param included_package_classifications: Update classifications included in the software update + configuration. Possible values include: "Unclassified", "Critical", "Security", "Other". + :type included_package_classifications: str or ~azure.mgmt.automation.models.LinuxUpdateClasses + :param excluded_package_name_masks: packages excluded from the software update configuration. + :type excluded_package_name_masks: list[str] + :param included_package_name_masks: packages included from the software update configuration. + :type included_package_name_masks: list[str] + :param reboot_setting: Reboot setting for the software update configuration. + :type reboot_setting: str + """ + + _attribute_map = { + 'included_package_classifications': {'key': 'includedPackageClassifications', 'type': 'str'}, + 'excluded_package_name_masks': {'key': 'excludedPackageNameMasks', 'type': '[str]'}, + 'included_package_name_masks': {'key': 'includedPackageNameMasks', 'type': '[str]'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LinuxProperties, self).__init__(**kwargs) + self.included_package_classifications = kwargs.get('included_package_classifications', None) + self.excluded_package_name_masks = kwargs.get('excluded_package_name_masks', None) + self.included_package_name_masks = kwargs.get('included_package_name_masks', None) + self.reboot_setting = kwargs.get('reboot_setting', None) + + +class Module(TrackedResource): + """Definition of the module type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: 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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :param is_composite: Gets or sets type of module, if its composite or not. + :type is_composite: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', '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': 'str'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'error': {'key': 'properties.error', 'type': 'ModuleErrorInfo'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_composite': {'key': 'properties.isComposite', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Module, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.is_global = kwargs.get('is_global', None) + self.version = kwargs.get('version', None) + self.size_in_bytes = kwargs.get('size_in_bytes', None) + self.activity_count = kwargs.get('activity_count', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.content_link = kwargs.get('content_link', None) + self.error = kwargs.get('error', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + self.is_composite = kwargs.get('is_composite', None) + + +class ModuleCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + **kwargs + ): + super(ModuleCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.content_link = kwargs['content_link'] + + +class ModuleErrorInfo(msrest.serialization.Model): + """Definition of the module error info type. + + :param code: Gets or sets the error code. + :type code: str + :param message: Gets or sets the error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ModuleErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ModuleListResult(msrest.serialization.Model): + """The response model for the list module operation. + + :param value: Gets or sets a list of modules. + :type value: list[~azure.mgmt.automation.models.Module] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Module]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ModuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ModuleUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update module operation. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + **kwargs + ): + super(ModuleUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.content_link = kwargs.get('content_link', None) + + +class NodeCount(msrest.serialization.Model): + """Number of nodes based on the Filter. + + :param name: Gets the name of a count type. + :type name: str + :param properties: + :type properties: ~azure.mgmt.automation.models.NodeCountProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'NodeCountProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeCount, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + + +class NodeCountProperties(msrest.serialization.Model): + """NodeCountProperties. + + :param count: Gets the count for the name. + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeCountProperties, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + + +class NodeCounts(msrest.serialization.Model): + """Gets the count of nodes by count type. + + :param value: Gets an array of counts. + :type value: list[~azure.mgmt.automation.models.NodeCount] + :param total_count: Gets the total number of records matching countType criteria. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NodeCount]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeCounts, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.total_count = kwargs.get('total_count', None) + + +class NonAzureQueryProperties(msrest.serialization.Model): + """Non Azure query for the update configuration. + + :param function_alias: Log Analytics Saved Search name. + :type function_alias: str + :param workspace_id: Workspace Id for Log Analytics in which the saved Search is resided. + :type workspace_id: str + """ + + _attribute_map = { + 'function_alias': {'key': 'functionAlias', 'type': 'str'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NonAzureQueryProperties, self).__init__(**kwargs) + self.function_alias = kwargs.get('function_alias', None) + self.workspace_id = kwargs.get('workspace_id', None) + + +class Operation(msrest.serialization.Model): + """Automation REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: Provider, Resource and Operation values. + :type display: ~azure.mgmt.automation.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """Provider, Resource and Operation values. + + :param provider: Service provider: Microsoft.Automation. + :type provider: str + :param resource: Resource on which the operation is performed: Runbooks, Jobs etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + + +class OperationListResult(msrest.serialization.Model): + """The response model for the list of Automation operations. + + :param value: List of Automation operations supported by the Automation resource provider. + :type value: list[~azure.mgmt.automation.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PythonPackageCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :param tags: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + **kwargs + ): + super(PythonPackageCreateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.content_link = kwargs['content_link'] + + +class PythonPackageUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update module operation. + + :param tags: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(PythonPackageUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class RunAsCredentialAssociationProperty(msrest.serialization.Model): + """Definition of RunAs credential to use for hybrid worker. + + :param name: Gets or sets the name of the credential. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunAsCredentialAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class Runbook(TrackedResource): + """Definition of the runbook type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: 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 + :ivar provisioning_state: Gets or sets the provisioning state of the runbook. Default value: + "Succeeded". + :vartype provisioning_state: str + :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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', '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': 'str'}, + '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'}, + } + + provisioning_state = "Succeeded" + + def __init__( + self, + **kwargs + ): + super(Runbook, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.runbook_type = kwargs.get('runbook_type', None) + self.publish_content_link = kwargs.get('publish_content_link', None) + self.state = kwargs.get('state', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + self.job_count = kwargs.get('job_count', None) + self.parameters = kwargs.get('parameters', None) + self.output_types = kwargs.get('output_types', None) + self.draft = kwargs.get('draft', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + + +class RunbookAssociationProperty(msrest.serialization.Model): + """The runbook property associated with the entity. + + :param name: Gets or sets the name of the runbook. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunbookAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class RunbookCreateOrUpdateDraftParameters(msrest.serialization.Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param runbook_content: Required. Content of the Runbook. + :type runbook_content: str + """ + + _validation = { + 'runbook_content': {'required': True}, + } + + _attribute_map = { + 'runbook_content': {'key': 'runbookContent', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunbookCreateOrUpdateDraftParameters, self).__init__(**kwargs) + self.runbook_content = kwargs['runbook_content'] + + +class RunbookCreateOrUpdateDraftProperties(msrest.serialization.Model): + """The parameters supplied to the create or update draft runbook properties. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. Possible values include: + "Script", "Graph", "PowerShellWorkflow", "PowerShell", "GraphPowerShellWorkflow", + "GraphPowerShell". + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Required. Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options of the runbook. + :type log_activity_trace: int + """ + + _validation = { + 'runbook_type': {'required': True}, + 'draft': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'runbookType', 'type': 'str'}, + 'draft': {'key': 'draft', 'type': 'RunbookDraft'}, + 'description': {'key': 'description', 'type': 'str'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RunbookCreateOrUpdateDraftProperties, self).__init__(**kwargs) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.runbook_type = kwargs['runbook_type'] + self.draft = kwargs['draft'] + self.description = kwargs.get('description', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + + +class RunbookCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, 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 runbook_type: Required. Gets or sets the type of the runbook. Possible values include: + "Script", "Graph", "PowerShellWorkflow", "PowerShell", "GraphPowerShellWorkflow", + "GraphPowerShell". + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param publish_content_link: Gets or sets the published runbook content link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options of the runbook. + :type log_activity_trace: int + """ + + _validation = { + 'runbook_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + super(RunbookCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.runbook_type = kwargs['runbook_type'] + self.draft = kwargs.get('draft', None) + self.publish_content_link = kwargs.get('publish_content_link', None) + self.description = kwargs.get('description', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + + +class RunbookDraft(msrest.serialization.Model): + """RunbookDraft. + + :param in_edit: Gets or sets whether runbook is in edit mode. + :type in_edit: bool + :param draft_content_link: Gets or sets the draft runbook content link. + :type draft_content_link: ~azure.mgmt.automation.models.ContentLink + :param creation_time: Gets or sets the creation time of the runbook draft. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time of the runbook draft. + :type last_modified_time: ~datetime.datetime + :param parameters: Gets or sets the runbook draft parameters. + :type parameters: dict[str, ~azure.mgmt.automation.models.RunbookParameter] + :param output_types: Gets or sets the runbook output types. + :type output_types: list[str] + """ + + _attribute_map = { + 'in_edit': {'key': 'inEdit', 'type': 'bool'}, + 'draft_content_link': {'key': 'draftContentLink', 'type': 'ContentLink'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{RunbookParameter}'}, + 'output_types': {'key': 'outputTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(RunbookDraft, self).__init__(**kwargs) + self.in_edit = kwargs.get('in_edit', None) + self.draft_content_link = kwargs.get('draft_content_link', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.parameters = kwargs.get('parameters', None) + self.output_types = kwargs.get('output_types', None) + + +class RunbookDraftUndoEditResult(msrest.serialization.Model): + """The response model for the undo edit runbook operation. + + :param status_code: Possible values include: "Continue", "SwitchingProtocols", "OK", + "Created", "Accepted", "NonAuthoritativeInformation", "NoContent", "ResetContent", + "PartialContent", "MultipleChoices", "Ambiguous", "MovedPermanently", "Moved", "Found", + "Redirect", "SeeOther", "RedirectMethod", "NotModified", "UseProxy", "Unused", + "TemporaryRedirect", "RedirectKeepVerb", "BadRequest", "Unauthorized", "PaymentRequired", + "Forbidden", "NotFound", "MethodNotAllowed", "NotAcceptable", "ProxyAuthenticationRequired", + "RequestTimeout", "Conflict", "Gone", "LengthRequired", "PreconditionFailed", + "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", + "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", + "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", + "HttpVersionNotSupported". + :type status_code: str or ~azure.mgmt.automation.models.HttpStatusCode + :param request_id: + :type request_id: str + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunbookDraftUndoEditResult, self).__init__(**kwargs) + self.status_code = kwargs.get('status_code', None) + self.request_id = kwargs.get('request_id', None) + + +class RunbookListResult(msrest.serialization.Model): + """The response model for the list runbook operation. + + :param value: Gets or sets a list of runbooks. + :type value: list[~azure.mgmt.automation.models.Runbook] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Runbook]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunbookListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class RunbookParameter(msrest.serialization.Model): + """Definition of the runbook parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the parameter is + mandatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunbookParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.is_mandatory = kwargs.get('is_mandatory', None) + self.position = kwargs.get('position', None) + self.default_value = kwargs.get('default_value', None) + + +class RunbookUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update runbook operation. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :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 + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + super(RunbookUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.description = kwargs.get('description', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + + +class Schedule(ProxyResource): + """Definition of the schedule. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: ~datetime.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.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. + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: ~datetime.datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible values include: + "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param creation_time: Gets or sets the creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :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] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'week_days': {'key': 'properties.advancedSchedule.weekDays', 'type': '[str]'}, + 'month_days': {'key': 'properties.advancedSchedule.monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'properties.advancedSchedule.monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__( + self, + **kwargs + ): + super(Schedule, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.start_time_offset_minutes = None + self.expiry_time = kwargs.get('expiry_time', None) + self.expiry_time_offset_minutes = kwargs.get('expiry_time_offset_minutes', None) + self.is_enabled = kwargs.get('is_enabled', False) + self.next_run = kwargs.get('next_run', None) + self.next_run_offset_minutes = kwargs.get('next_run_offset_minutes', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs.get('frequency', None) + self.time_zone = kwargs.get('time_zone', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + self.week_days = kwargs.get('week_days', None) + self.month_days = kwargs.get('month_days', None) + self.monthly_occurrences = kwargs.get('monthly_occurrences', None) + + +class ScheduleAssociationProperty(msrest.serialization.Model): + """The schedule property associated with the entity. + + :param name: Gets or sets the name of the Schedule. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduleAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class ScheduleCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the Schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param start_time: Required. Gets or sets the start time of the schedule. + :type start_time: ~datetime.datetime + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: ~datetime.datetime + :param interval: Gets or sets the interval of the schedule. + :type interval: object + :param frequency: Required. Gets or sets the frequency of the schedule. Possible values + include: "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param 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] + """ + + _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'}, + 'week_days': {'key': 'properties.advancedSchedule.weekDays', 'type': '[str]'}, + 'month_days': {'key': 'properties.advancedSchedule.monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'properties.advancedSchedule.monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduleCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs['name'] + self.description = kwargs.get('description', None) + self.start_time = kwargs['start_time'] + self.expiry_time = kwargs.get('expiry_time', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs['frequency'] + self.time_zone = kwargs.get('time_zone', None) + self.week_days = kwargs.get('week_days', None) + self.month_days = kwargs.get('month_days', None) + self.monthly_occurrences = kwargs.get('monthly_occurrences', None) + + +class ScheduleListResult(msrest.serialization.Model): + """The response model for the list schedule operation. + + :param value: Gets or sets a list of schedules. + :type value: list[~azure.mgmt.automation.models.Schedule] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Schedule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ScheduleUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update schedule operation. + + :param name: Gets or sets the name of the Schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param is_enabled: Gets or sets a value indicating whether this schedule is enabled. + :type is_enabled: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduleUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.is_enabled = kwargs.get('is_enabled', None) + + +class Sku(msrest.serialization.Model): + """The account SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the SKU name of the account. Possible values include: + "Free", "Basic". + :type name: str or ~azure.mgmt.automation.models.SkuNameEnum + :param family: Gets or sets the SKU family. + :type family: str + :param capacity: Gets or sets the SKU capacity. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + + +class SoftareUpdateConfigurationRunTaskProperties(msrest.serialization.Model): + """Task properties of the software update configuration. + + :param status: The status of the task. + :type status: str + :param source: The name of the source of the task. + :type source: str + :param job_id: The job id of the task. + :type job_id: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftareUpdateConfigurationRunTaskProperties, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.source = kwargs.get('source', None) + self.job_id = kwargs.get('job_id', None) + + +class SoftareUpdateConfigurationRunTasks(msrest.serialization.Model): + """Software update configuration run tasks model. + + :param pre_task: Pre task properties. + :type pre_task: ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTaskProperties + :param post_task: Post task properties. + :type post_task: ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTaskProperties + """ + + _attribute_map = { + 'pre_task': {'key': 'preTask', 'type': 'SoftareUpdateConfigurationRunTaskProperties'}, + 'post_task': {'key': 'postTask', 'type': 'SoftareUpdateConfigurationRunTaskProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftareUpdateConfigurationRunTasks, self).__init__(**kwargs) + self.pre_task = kwargs.get('pre_task', None) + self.post_task = kwargs.get('post_task', None) + + +class SoftwareUpdateConfiguration(msrest.serialization.Model): + """Software update configuration properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: Provisioning state for the software update configuration, which only + appears in the response. + :vartype provisioning_state: str + :param error: Details of provisioning error. + :type error: ~azure.mgmt.automation.models.ErrorResponse + :ivar creation_time_properties_creation_time: Creation time of the resource, which only appears + in the response. + :vartype creation_time_properties_creation_time: ~datetime.datetime + :ivar created_by: CreatedBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time_properties_last_modified_time: Last time resource was modified, which + only appears in the response. + :vartype last_modified_time_properties_last_modified_time: ~datetime.datetime + :ivar last_modified_by: LastModifiedBy property, which only appears in the response. + :vartype last_modified_by: str + :param parameters_properties_tasks_post_task_parameters: Gets or sets the parameters of the + task. + :type parameters_properties_tasks_post_task_parameters: dict[str, str] + :param source_properties_tasks_post_task_source: Gets or sets the name of the runbook. + :type source_properties_tasks_post_task_source: str + :param parameters_properties_tasks_pre_task_parameters: Gets or sets the parameters of the + task. + :type parameters_properties_tasks_pre_task_parameters: dict[str, str] + :param source_properties_tasks_pre_task_source: Gets or sets the name of the runbook. + :type source_properties_tasks_pre_task_source: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: ~datetime.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.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. + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: ~datetime.datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible values include: + "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param creation_time_properties_schedule_info_creation_time: Gets or sets the creation time. + :type creation_time_properties_schedule_info_creation_time: ~datetime.datetime + :param last_modified_time_properties_schedule_info_last_modified_time: Gets or sets the last + modified time. + :type last_modified_time_properties_schedule_info_last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :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] + :param operating_system: Required. operating system of target machines. Possible values + include: "Windows", "Linux". + :type operating_system: str or ~azure.mgmt.automation.models.OperatingSystemType + :param windows: Windows specific update configuration. + :type windows: ~azure.mgmt.automation.models.WindowsProperties + :param linux: Linux specific update configuration. + :type linux: ~azure.mgmt.automation.models.LinuxProperties + :param duration: Maximum time allowed for the software update configuration run. Duration needs + to be specified using the format PT[n]H[n]M[n]S as per ISO8601. + :type duration: ~datetime.timedelta + :param azure_virtual_machines: List of azure resource Ids for azure virtual machines targeted + by the software update configuration. + :type azure_virtual_machines: list[str] + :param non_azure_computer_names: List of names of non-azure machines targeted by the software + update configuration. + :type non_azure_computer_names: list[str] + :param azure_queries: List of Azure queries in the software update configuration. + :type azure_queries: list[~azure.mgmt.automation.models.AzureQueryProperties] + :param non_azure_queries: List of non Azure queries in the software update configuration. + :type non_azure_queries: list[~azure.mgmt.automation.models.NonAzureQueryProperties] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'creation_time_properties_creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time_properties_last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + 'creation_time_properties_creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time_properties_last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'parameters_properties_tasks_post_task_parameters': {'key': 'properties.tasks.postTask.parameters', 'type': '{str}'}, + 'source_properties_tasks_post_task_source': {'key': 'properties.tasks.postTask.source', 'type': 'str'}, + 'parameters_properties_tasks_pre_task_parameters': {'key': 'properties.tasks.preTask.parameters', 'type': '{str}'}, + 'source_properties_tasks_pre_task_source': {'key': 'properties.tasks.preTask.source', 'type': 'str'}, + 'start_time': {'key': 'properties.scheduleInfo.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.scheduleInfo.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.scheduleInfo.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.scheduleInfo.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.scheduleInfo.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.scheduleInfo.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.scheduleInfo.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.scheduleInfo.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.scheduleInfo.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.scheduleInfo.timeZone', 'type': 'str'}, + 'creation_time_properties_schedule_info_creation_time': {'key': 'properties.scheduleInfo.creationTime', 'type': 'iso-8601'}, + 'last_modified_time_properties_schedule_info_last_modified_time': {'key': 'properties.scheduleInfo.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.scheduleInfo.description', 'type': 'str'}, + 'week_days': {'key': 'properties.scheduleInfo.advancedSchedule.weekDays', 'type': '[str]'}, + 'month_days': {'key': 'properties.scheduleInfo.advancedSchedule.monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'properties.scheduleInfo.advancedSchedule.monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + 'operating_system': {'key': 'properties.updateConfiguration.operatingSystem', 'type': 'str'}, + 'windows': {'key': 'properties.updateConfiguration.windows', 'type': 'WindowsProperties'}, + 'linux': {'key': 'properties.updateConfiguration.linux', 'type': 'LinuxProperties'}, + 'duration': {'key': 'properties.updateConfiguration.duration', 'type': 'duration'}, + 'azure_virtual_machines': {'key': 'properties.updateConfiguration.azureVirtualMachines', 'type': '[str]'}, + 'non_azure_computer_names': {'key': 'properties.updateConfiguration.nonAzureComputerNames', 'type': '[str]'}, + 'azure_queries': {'key': 'properties.updateConfiguration.targets.azureQueries', 'type': '[AzureQueryProperties]'}, + 'non_azure_queries': {'key': 'properties.updateConfiguration.targets.nonAzureQueries', 'type': '[NonAzureQueryProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftwareUpdateConfiguration, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.provisioning_state = None + self.error = kwargs.get('error', None) + self.creation_time_properties_creation_time = None + self.created_by = None + self.last_modified_time_properties_last_modified_time = None + self.last_modified_by = None + self.parameters_properties_tasks_post_task_parameters = kwargs.get('parameters_properties_tasks_post_task_parameters', None) + self.source_properties_tasks_post_task_source = kwargs.get('source_properties_tasks_post_task_source', None) + self.parameters_properties_tasks_pre_task_parameters = kwargs.get('parameters_properties_tasks_pre_task_parameters', None) + self.source_properties_tasks_pre_task_source = kwargs.get('source_properties_tasks_pre_task_source', None) + self.start_time = kwargs.get('start_time', None) + self.start_time_offset_minutes = None + self.expiry_time = kwargs.get('expiry_time', None) + self.expiry_time_offset_minutes = kwargs.get('expiry_time_offset_minutes', None) + self.is_enabled = kwargs.get('is_enabled', False) + self.next_run = kwargs.get('next_run', None) + self.next_run_offset_minutes = kwargs.get('next_run_offset_minutes', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs.get('frequency', None) + self.time_zone = kwargs.get('time_zone', None) + self.creation_time_properties_schedule_info_creation_time = kwargs.get('creation_time_properties_schedule_info_creation_time', None) + self.last_modified_time_properties_schedule_info_last_modified_time = kwargs.get('last_modified_time_properties_schedule_info_last_modified_time', None) + self.description = kwargs.get('description', None) + self.week_days = kwargs.get('week_days', None) + self.month_days = kwargs.get('month_days', None) + self.monthly_occurrences = kwargs.get('monthly_occurrences', None) + self.operating_system = kwargs['operating_system'] + self.windows = kwargs.get('windows', None) + self.linux = kwargs.get('linux', None) + self.duration = kwargs.get('duration', None) + self.azure_virtual_machines = kwargs.get('azure_virtual_machines', None) + self.non_azure_computer_names = kwargs.get('non_azure_computer_names', None) + self.azure_queries = kwargs.get('azure_queries', None) + self.non_azure_queries = kwargs.get('non_azure_queries', None) + + +class SoftwareUpdateConfigurationCollectionItem(msrest.serialization.Model): + """Software update configuration collection item properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the software update configuration. + :vartype name: str + :ivar id: Resource Id of the software update configuration. + :vartype id: str + :param update_configuration: Update specific properties of the software update configuration. + :type update_configuration: ~azure.mgmt.automation.models.CollectionItemUpdateConfiguration + :param frequency: execution frequency of the schedule associated with the software update + configuration. Possible values include: "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param start_time: the start time of the update. + :type start_time: ~datetime.datetime + :ivar creation_time: Creation time of the software update configuration, which only appears in + the response. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Last time software update configuration was modified, which only + appears in the response. + :vartype last_modified_time: ~datetime.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.datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'update_configuration': {'key': 'properties.updateConfiguration', 'type': 'CollectionItemUpdateConfiguration'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftwareUpdateConfigurationCollectionItem, self).__init__(**kwargs) + self.name = None + self.id = None + self.update_configuration = kwargs.get('update_configuration', None) + self.frequency = kwargs.get('frequency', None) + self.start_time = kwargs.get('start_time', None) + self.creation_time = None + self.last_modified_time = None + self.provisioning_state = None + self.next_run = kwargs.get('next_run', None) + + +class SoftwareUpdateConfigurationListResult(msrest.serialization.Model): + """result of listing all software update configuration. + + :param value: outer object returned when listing all software update configurations. + :type value: list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationCollectionItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationCollectionItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftwareUpdateConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class SoftwareUpdateConfigurationMachineRun(msrest.serialization.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.datetime + :ivar end_time: End time of the software update configuration machine run. + :vartype end_time: ~datetime.datetime + :ivar configured_duration: configured duration for the software update configuration run. + :vartype configured_duration: str + :param job: Job associated with the software update configuration machine run. + :type job: ~azure.mgmt.automation.models.JobNavigation + :ivar creation_time: Creation time of the resource, which only appears in the response. + :vartype creation_time: ~datetime.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.datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the response. + :vartype last_modified_by: str + :param error: Details of provisioning error. + :type error: ~azure.mgmt.automation.models.ErrorResponse + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target_computer': {'readonly': True}, + 'target_computer_type': {'readonly': True}, + 'status': {'readonly': True}, + 'os_type': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'source_computer_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'target_computer': {'key': 'properties.targetComputer', 'type': 'str'}, + 'target_computer_type': {'key': 'properties.targetComputerType', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'source_computer_id': {'key': 'properties.sourceComputerId', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'job': {'key': 'properties.job', 'type': 'JobNavigation'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftwareUpdateConfigurationMachineRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.target_computer = None + self.target_computer_type = None + self.software_update_configuration = kwargs.get('software_update_configuration', None) + self.status = None + self.os_type = None + self.correlation_id = None + self.source_computer_id = None + self.start_time = None + self.end_time = None + self.configured_duration = None + self.job = kwargs.get('job', None) + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.error = kwargs.get('error', None) + + +class SoftwareUpdateConfigurationMachineRunListResult(msrest.serialization.Model): + """result of listing all software update configuration machine runs. + + :param value: outer object returned when listing all software update configuration machine + runs. + :type value: list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationMachineRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftwareUpdateConfigurationMachineRunListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SoftwareUpdateConfigurationRun(msrest.serialization.Model): + """Software update configuration Run properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the software update configuration run. + :vartype name: str + :ivar id: Resource Id of the software update configuration run. + :vartype id: str + :param software_update_configuration: software update configuration triggered this run. + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration run. + :vartype status: str + :ivar configured_duration: Configured duration for the software update configuration run. + :vartype configured_duration: str + :ivar os_type: Operating system target of the software update configuration triggered this run. + :vartype os_type: str + :ivar start_time: Start time of the software update configuration run. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of the software update configuration run. + :vartype end_time: ~datetime.datetime + :ivar computer_count: Number of computers in the software update configuration run. + :vartype computer_count: int + :ivar failed_count: Number of computers with failed status. + :vartype failed_count: int + :ivar creation_time: Creation time of the resource, which only appears in the response. + :vartype creation_time: ~datetime.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.datetime + :ivar last_modified_by: LastModifiedBy property, which only appears in the response. + :vartype last_modified_by: str + :param tasks: Software update configuration tasks triggered in this run. + :type tasks: ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTasks + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'status': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'os_type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'computer_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'computer_count': {'key': 'properties.computerCount', 'type': 'int'}, + 'failed_count': {'key': 'properties.failedCount', 'type': 'int'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'tasks': {'key': 'properties.tasks', 'type': 'SoftareUpdateConfigurationRunTasks'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftwareUpdateConfigurationRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.software_update_configuration = kwargs.get('software_update_configuration', None) + self.status = None + self.configured_duration = None + self.os_type = None + self.start_time = None + self.end_time = None + self.computer_count = None + self.failed_count = None + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.tasks = kwargs.get('tasks', None) + + +class SoftwareUpdateConfigurationRunListResult(msrest.serialization.Model): + """result of listing all software update configuration runs. + + :param value: outer object returned when listing all software update configuration runs. + :type value: list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftwareUpdateConfigurationRunListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SourceControl(ProxyResource): + """Definition of the source control. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as empty string for + VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, GitHub. Possible values + include: "VsoGit", "VsoTfvc", "GitHub". + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param description: The description. + :type description: str + :param creation_time: The creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: The last modified time. + :type last_modified_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControl, self).__init__(**kwargs) + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.folder_path = kwargs.get('folder_path', None) + self.auto_sync = kwargs.get('auto_sync', None) + self.publish_runbook = kwargs.get('publish_runbook', None) + self.source_type = kwargs.get('source_type', None) + self.description = kwargs.get('description', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + + +class SourceControlCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update source control operation. + + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as empty string for + VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. Path must be relative. + :type folder_path: str + :param auto_sync: The auto async of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. + Possible values include: "VsoGit", "VsoTfvc", "GitHub". + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param security_token: The authorization token for the repo of the source control. + :type security_token: ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + """ + + _validation = { + 'repo_url': {'max_length': 2000, 'min_length': 0}, + 'branch': {'max_length': 255, 'min_length': 0}, + 'folder_path': {'max_length': 255, 'min_length': 0}, + 'description': {'max_length': 512, 'min_length': 0}, + } + + _attribute_map = { + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'SourceControlSecurityTokenProperties'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlCreateOrUpdateParameters, self).__init__(**kwargs) + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.folder_path = kwargs.get('folder_path', None) + self.auto_sync = kwargs.get('auto_sync', None) + self.publish_runbook = kwargs.get('publish_runbook', None) + self.source_type = kwargs.get('source_type', None) + self.security_token = kwargs.get('security_token', None) + self.description = kwargs.get('description', None) + + +class SourceControlListResult(msrest.serialization.Model): + """The response model for the list source controls operation. + + :param value: The list of source controls. + :type value: list[~azure.mgmt.automation.models.SourceControl] + :param next_link: The next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControl]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SourceControlSecurityTokenProperties(msrest.serialization.Model): + """SourceControlSecurityTokenProperties. + + :param access_token: The access token. + :type access_token: str + :param refresh_token: The refresh token. + :type refresh_token: str + :param token_type: The token type. Must be either PersonalAccessToken or Oauth. Possible values + include: "PersonalAccessToken", "Oauth". + :type token_type: str or ~azure.mgmt.automation.models.TokenType + """ + + _validation = { + 'access_token': {'max_length': 1024, 'min_length': 0}, + 'refresh_token': {'max_length': 1024, 'min_length': 0}, + } + + _attribute_map = { + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlSecurityTokenProperties, self).__init__(**kwargs) + self.access_token = kwargs.get('access_token', None) + self.refresh_token = kwargs.get('refresh_token', None) + self.token_type = kwargs.get('token_type', None) + + +class SourceControlSyncJob(msrest.serialization.Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: ~datetime.datetime + :param provisioning_state: The provisioning state of the job. Possible values include: + "Completed", "Failed", "Running". + :type provisioning_state: str or ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: The start time of the job. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the job. + :vartype end_time: ~datetime.datetime + :param sync_type: The sync type. Possible values include: "PartialSync", "FullSync". + :type sync_type: str or ~azure.mgmt.automation.models.SyncType + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'sync_type': {'key': 'properties.syncType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlSyncJob, self).__init__(**kwargs) + self.name = None + self.type = None + self.id = None + self.source_control_sync_job_id = kwargs.get('source_control_sync_job_id', None) + self.creation_time = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.start_time = None + self.end_time = None + self.sync_type = kwargs.get('sync_type', None) + + +class SourceControlSyncJobById(msrest.serialization.Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The id of the job. + :type id: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: ~datetime.datetime + :param provisioning_state: The provisioning state of the job. Possible values include: + "Completed", "Failed", "Running". + :type provisioning_state: str or ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: The start time of the job. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the job. + :vartype end_time: ~datetime.datetime + :param sync_type: The sync type. Possible values include: "PartialSync", "FullSync". + :type sync_type: str or ~azure.mgmt.automation.models.SyncType + :param exception: The exceptions that occurred while running the sync job. + :type exception: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'sync_type': {'key': 'properties.syncType', 'type': 'str'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlSyncJobById, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.source_control_sync_job_id = kwargs.get('source_control_sync_job_id', None) + self.creation_time = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.start_time = None + self.end_time = None + self.sync_type = kwargs.get('sync_type', None) + self.exception = kwargs.get('exception', None) + + +class SourceControlSyncJobCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create source control sync job operation. + + All required parameters must be populated in order to send to Azure. + + :param commit_id: Required. The commit id of the source control sync job. If not syncing to a + commitId, enter an empty string. + :type commit_id: str + """ + + _validation = { + 'commit_id': {'required': True}, + } + + _attribute_map = { + 'commit_id': {'key': 'properties.commitId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlSyncJobCreateParameters, self).__init__(**kwargs) + self.commit_id = kwargs['commit_id'] + + +class SourceControlSyncJobListResult(msrest.serialization.Model): + """The response model for the list source control sync jobs operation. + + :param value: The list of source control sync jobs. + :type value: list[~azure.mgmt.automation.models.SourceControlSyncJob] + :param next_link: The next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlSyncJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlSyncJobListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SourceControlSyncJobStream(msrest.serialization.Model): + """Definition of the source control sync job stream. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_stream_id: The sync job stream id. + :type source_control_sync_job_stream_id: str + :param summary: The summary of the sync job stream. + :type summary: str + :ivar time: The time of the sync job stream. + :vartype time: ~datetime.datetime + :param stream_type: The type of the sync job stream. Possible values include: "Error", + "Output". + :type stream_type: str or ~azure.mgmt.automation.models.StreamType + """ + + _validation = { + 'id': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_stream_id': {'key': 'properties.sourceControlSyncJobStreamId', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlSyncJobStream, self).__init__(**kwargs) + self.id = None + self.source_control_sync_job_stream_id = kwargs.get('source_control_sync_job_stream_id', None) + self.summary = kwargs.get('summary', None) + self.time = None + self.stream_type = kwargs.get('stream_type', None) + + +class SourceControlSyncJobStreamById(msrest.serialization.Model): + """Definition of the source control sync job stream by id. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_stream_id: The sync job stream id. + :type source_control_sync_job_stream_id: str + :param summary: The summary of the sync job stream. + :type summary: str + :ivar time: The time of the sync job stream. + :vartype time: ~datetime.datetime + :param stream_type: The type of the sync job stream. Possible values include: "Error", + "Output". + :type stream_type: str or ~azure.mgmt.automation.models.StreamType + :param stream_text: The text of the sync job stream. + :type stream_text: str + :param value: The values of the job stream. + :type value: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_stream_id': {'key': 'properties.sourceControlSyncJobStreamId', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + 'stream_text': {'key': 'properties.streamText', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlSyncJobStreamById, self).__init__(**kwargs) + self.id = None + self.source_control_sync_job_stream_id = kwargs.get('source_control_sync_job_stream_id', None) + self.summary = kwargs.get('summary', None) + self.time = None + self.stream_type = kwargs.get('stream_type', None) + self.stream_text = kwargs.get('stream_text', None) + self.value = kwargs.get('value', None) + + +class SourceControlSyncJobStreamsListBySyncJob(msrest.serialization.Model): + """The response model for the list source control sync job streams operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of source control sync job streams. + :type value: list[~azure.mgmt.automation.models.SourceControlSyncJobStream] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlSyncJobStream]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlSyncJobStreamsListBySyncJob, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class SourceControlUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update source control operation. + + :param branch: The repo branch of the source control. + :type branch: str + :param folder_path: The folder path of the source control. Path must be relative. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param security_token: The authorization token for the repo of the source control. + :type security_token: ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + """ + + _attribute_map = { + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'SourceControlSecurityTokenProperties'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlUpdateParameters, self).__init__(**kwargs) + self.branch = kwargs.get('branch', None) + self.folder_path = kwargs.get('folder_path', None) + self.auto_sync = kwargs.get('auto_sync', None) + self.publish_runbook = kwargs.get('publish_runbook', None) + self.security_token = kwargs.get('security_token', None) + self.description = kwargs.get('description', None) + + +class Statistics(msrest.serialization.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.datetime + :ivar end_time: Gets the endTime of the statistic. + :vartype end_time: ~datetime.datetime + :ivar id: Gets the id. + :vartype id: str + """ + + _validation = { + 'counter_property': {'readonly': True}, + 'counter_value': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'counter_property': {'key': 'counterProperty', 'type': 'str'}, + 'counter_value': {'key': 'counterValue', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Statistics, self).__init__(**kwargs) + self.counter_property = None + self.counter_value = None + self.start_time = None + self.end_time = None + self.id = None + + +class StatisticsListResult(msrest.serialization.Model): + """The response model for the list statistics operation. + + :param value: Gets or sets a list of statistics. + :type value: list[~azure.mgmt.automation.models.Statistics] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Statistics]'}, + } + + def __init__( + self, + **kwargs + ): + super(StatisticsListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class TagSettingsProperties(msrest.serialization.Model): + """Tag filter information for the VM. + + :param tags: A set of tags. Dictionary of tags with its list of values. + :type tags: dict[str, list[str]] + :param filter_operator: Filter VMs by Any or All specified tags. Possible values include: + "All", "Any". + :type filter_operator: str or ~azure.mgmt.automation.models.TagOperators + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{[str]}'}, + 'filter_operator': {'key': 'filterOperator', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TagSettingsProperties, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.filter_operator = kwargs.get('filter_operator', None) + + +class TestJob(msrest.serialization.Model): + """Definition of the test job. + + :param creation_time: Gets or sets the creation time of the test job. + :type creation_time: ~datetime.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.datetime + :param end_time: Gets or sets the end time of the test job. + :type end_time: ~datetime.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.datetime + :param last_status_modified_time: Gets or sets the last status modified time of the test job. + :type last_status_modified_time: ~datetime.datetime + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param log_activity_trace: The activity-level tracing options of the runbook. + :type log_activity_trace: int + """ + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_details': {'key': 'statusDetails', 'type': 'str'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'exception', 'type': 'str'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(TestJob, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.run_on = kwargs.get('run_on', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.exception = kwargs.get('exception', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.last_status_modified_time = kwargs.get('last_status_modified_time', None) + self.parameters = kwargs.get('parameters', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + + +class TestJobCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create test job operation. + + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TestJobCreateParameters, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + self.run_on = kwargs.get('run_on', None) + + +class TypeField(msrest.serialization.Model): + """Information about a field of a type. + + :param name: Gets or sets the name of the field. + :type name: str + :param type: Gets or sets the type of the field. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TypeField, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class TypeFieldListResult(msrest.serialization.Model): + """The response model for the list fields operation. + + :param value: Gets or sets a list of fields. + :type value: list[~azure.mgmt.automation.models.TypeField] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TypeField]'}, + } + + def __init__( + self, + **kwargs + ): + super(TypeFieldListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class UpdateConfigurationNavigation(msrest.serialization.Model): + """Software update configuration Run Navigation model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the software update configuration triggered the software update + configuration run. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateConfigurationNavigation, self).__init__(**kwargs) + self.name = None + + +class Usage(msrest.serialization.Model): + """Definition of Usage. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the usage counter name. + :type name: ~azure.mgmt.automation.models.UsageCounterName + :param unit: Gets or sets the usage unit name. + :type unit: str + :param current_value: Gets or sets the current usage value. + :type current_value: float + :param limit: Gets or sets max limit. -1 for unlimited. + :type limit: long + :param throttle_status: Gets or sets the throttle status. + :type throttle_status: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'UsageCounterName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'throttle_status': {'key': 'throttleStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.throttle_status = kwargs.get('throttle_status', None) + + +class UsageCounterName(msrest.serialization.Model): + """Definition of usage counter name. + + :param value: Gets or sets the usage counter name. + :type value: str + :param localized_value: Gets or sets the localized usage counter name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageCounterName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) + + +class UsageListResult(msrest.serialization.Model): + """The response model for the get usage operation. + + :param value: Gets or sets usage. + :type value: list[~azure.mgmt.automation.models.Usage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Variable(ProxyResource): + """Definition of the variable. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param value: Gets or sets the value of the variable. + :type value: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Variable, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.is_encrypted = kwargs.get('is_encrypted', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + + +class VariableCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update variable operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VariableCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs['name'] + self.value = kwargs.get('value', None) + self.description = kwargs.get('description', None) + self.is_encrypted = kwargs.get('is_encrypted', None) + + +class VariableListResult(msrest.serialization.Model): + """The response model for the list variables operation. + + :param value: Gets or sets a list of variables. + :type value: list[~azure.mgmt.automation.models.Variable] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Variable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VariableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class VariableUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update variable operation. + + :param name: Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VariableUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.description = kwargs.get('description', None) + + +class Watcher(TrackedResource): + """Definition of the watcher type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which the watcher is + invoked. + :type execution_frequency_in_seconds: long + :param script_name: Gets or sets the name of the script the watcher is attached to, i.e. the + name of an existing runbook. + :type script_name: str + :param script_parameters: Gets or sets the parameters of the script. + :type script_parameters: dict[str, str] + :param script_run_on: Gets or sets the name of the hybrid worker group the watcher will run on. + :type script_run_on: str + :ivar status: Gets the current status of the watcher. + :vartype status: str + :ivar creation_time: Gets or sets the creation time. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets or sets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :ivar last_modified_by: Details of the user who last modified the watcher. + :vartype last_modified_by: str + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'execution_frequency_in_seconds': {'key': 'properties.executionFrequencyInSeconds', 'type': 'long'}, + 'script_name': {'key': 'properties.scriptName', 'type': 'str'}, + 'script_parameters': {'key': 'properties.scriptParameters', 'type': '{str}'}, + 'script_run_on': {'key': 'properties.scriptRunOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Watcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.execution_frequency_in_seconds = kwargs.get('execution_frequency_in_seconds', None) + self.script_name = kwargs.get('script_name', None) + self.script_parameters = kwargs.get('script_parameters', None) + self.script_run_on = kwargs.get('script_run_on', None) + self.status = None + self.creation_time = None + self.last_modified_time = None + self.last_modified_by = None + self.description = kwargs.get('description', None) + + +class WatcherListResult(msrest.serialization.Model): + """The response model for the list watcher operation. + + :param value: Gets or sets a list of watchers. + :type value: list[~azure.mgmt.automation.models.Watcher] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Watcher]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WatcherListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WatcherUpdateParameters(msrest.serialization.Model): + """WatcherUpdateParameters. + + :param name: Gets or sets the name of the resource. + :type name: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which the watcher is + invoked. + :type execution_frequency_in_seconds: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'execution_frequency_in_seconds': {'key': 'properties.executionFrequencyInSeconds', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(WatcherUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.execution_frequency_in_seconds = kwargs.get('execution_frequency_in_seconds', None) + + +class Webhook(ProxyResource): + """Definition of the webhook type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param is_enabled: Gets or sets the value of the enabled flag of the webhook. + :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.datetime + :param last_invoked_time: Gets or sets the last invoked time. + :type last_invoked_time: ~datetime.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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param last_modified_by: Details of the user who last modified the Webhook. + :type last_modified_by: str + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'last_invoked_time': {'key': 'properties.lastInvokedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Webhook, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', False) + self.uri = kwargs.get('uri', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.last_invoked_time = kwargs.get('last_invoked_time', None) + self.parameters = kwargs.get('parameters', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.description = kwargs.get('description', None) + + +class WebhookCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update webhook operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param uri: Gets or sets the uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: ~datetime.datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the webhook job will run on. + :type run_on: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebhookCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs['name'] + self.is_enabled = kwargs.get('is_enabled', None) + self.uri = kwargs.get('uri', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.parameters = kwargs.get('parameters', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + + +class WebhookListResult(msrest.serialization.Model): + """The response model for the list webhook operation. + + :param value: Gets or sets a list of webhooks. + :type value: list[~azure.mgmt.automation.models.Webhook] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Webhook]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebhookListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WebhookUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update webhook operation. + + :param name: Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param run_on: Gets or sets the name of the hybrid worker group the webhook job will run on. + :type run_on: str + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param description: Gets or sets the description of the webhook. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.run_on = kwargs.get('run_on', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) + + +class WindowsProperties(msrest.serialization.Model): + """Windows specific update configuration. + + :param included_update_classifications: Update classification included in the software update + configuration. A comma separated string with required values. Possible values include: + "Unclassified", "Critical", "Security", "UpdateRollup", "FeaturePack", "ServicePack", + "Definition", "Tools", "Updates". + :type included_update_classifications: str or + ~azure.mgmt.automation.models.WindowsUpdateClasses + :param excluded_kb_numbers: KB numbers excluded from the software update configuration. + :type excluded_kb_numbers: list[str] + :param included_kb_numbers: KB numbers included from the software update configuration. + :type included_kb_numbers: list[str] + :param reboot_setting: Reboot setting for the software update configuration. + :type reboot_setting: str + """ + + _attribute_map = { + 'included_update_classifications': {'key': 'includedUpdateClassifications', 'type': 'str'}, + 'excluded_kb_numbers': {'key': 'excludedKbNumbers', 'type': '[str]'}, + 'included_kb_numbers': {'key': 'includedKbNumbers', 'type': '[str]'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WindowsProperties, self).__init__(**kwargs) + self.included_update_classifications = kwargs.get('included_update_classifications', None) + self.excluded_kb_numbers = kwargs.get('excluded_kb_numbers', None) + self.included_kb_numbers = kwargs.get('included_kb_numbers', None) + self.reboot_setting = kwargs.get('reboot_setting', None) diff --git a/src/automation/azext_automation/vendored_sdks/automation/models/_models_py3.py b/src/automation/azext_automation/vendored_sdks/automation/models/_models_py3.py new file mode 100644 index 00000000000..9428004480b --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/models/_models_py3.py @@ -0,0 +1,6851 @@ +# 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 datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Activity(msrest.serialization.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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.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: Optional[str] = None, + definition: Optional[str] = None, + parameter_sets: Optional[List["ActivityParameterSet"]] = None, + output_types: Optional[List["ActivityOutputType"]] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + **kwargs + ): + super(Activity, self).__init__(**kwargs) + self.id = id + self.name = None + self.definition = definition + self.parameter_sets = parameter_sets + self.output_types = output_types + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + + +class ActivityListResult(msrest.serialization.Model): + """The response model for the list activity operation. + + :param value: Gets or sets a list of activities. + :type value: list[~azure.mgmt.automation.models.Activity] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Activity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Activity"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ActivityListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ActivityOutputType(msrest.serialization.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: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + super(ActivityOutputType, self).__init__(**kwargs) + self.name = name + self.type = type + + +class ActivityParameter(msrest.serialization.Model): + """Definition of the activity parameter. + + :param name: Gets or sets the name of the activity parameter. + :type name: str + :param type: Gets or sets the type of the activity parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value that indicates true if the parameter is + required. If the value is false, the parameter is optional. + :type is_mandatory: bool + :param is_dynamic: Gets or sets a Boolean value that indicates true if the parameter is + dynamic. + :type is_dynamic: bool + :param position: Gets or sets the position of the activity parameter. + :type position: long + :param value_from_pipeline: Gets or sets a Boolean value that indicates true if the parameter + can take values from the incoming pipeline objects. This setting is used if the cmdlet must + access the complete input object. false indicates that the parameter cannot take values from + the complete input object. + :type value_from_pipeline: bool + :param value_from_pipeline_by_property_name: Gets or sets a Boolean value that indicates true + if the parameter can be filled from a property of the incoming pipeline object that has the + same name as this parameter. false indicates that the parameter cannot be filled from the + incoming pipeline object property with the same name. + :type value_from_pipeline_by_property_name: bool + :param value_from_remaining_arguments: Gets or sets a Boolean value that indicates true if the + cmdlet parameter accepts all the remaining command-line arguments that are associated with this + parameter in the form of an array. false if the cmdlet parameter does not accept all the + remaining argument values. + :type value_from_remaining_arguments: bool + :param description: Gets or sets the description of the activity parameter. + :type description: str + :param validation_set: Gets or sets the validation set of activity parameter. + :type validation_set: list[~azure.mgmt.automation.models.ActivityParameterValidationSet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'is_dynamic': {'key': 'isDynamic', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'long'}, + 'value_from_pipeline': {'key': 'valueFromPipeline', 'type': 'bool'}, + 'value_from_pipeline_by_property_name': {'key': 'valueFromPipelineByPropertyName', 'type': 'bool'}, + 'value_from_remaining_arguments': {'key': 'valueFromRemainingArguments', 'type': 'bool'}, + 'description': {'key': 'description', 'type': 'str'}, + 'validation_set': {'key': 'validationSet', 'type': '[ActivityParameterValidationSet]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + is_mandatory: Optional[bool] = None, + is_dynamic: Optional[bool] = None, + position: Optional[int] = None, + value_from_pipeline: Optional[bool] = None, + value_from_pipeline_by_property_name: Optional[bool] = None, + value_from_remaining_arguments: Optional[bool] = None, + description: Optional[str] = None, + validation_set: Optional[List["ActivityParameterValidationSet"]] = None, + **kwargs + ): + super(ActivityParameter, self).__init__(**kwargs) + self.name = name + self.type = type + self.is_mandatory = is_mandatory + self.is_dynamic = is_dynamic + self.position = position + self.value_from_pipeline = value_from_pipeline + self.value_from_pipeline_by_property_name = value_from_pipeline_by_property_name + self.value_from_remaining_arguments = value_from_remaining_arguments + self.description = description + self.validation_set = validation_set + + +class ActivityParameterSet(msrest.serialization.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: Optional[str] = None, + parameters: Optional[List["ActivityParameter"]] = None, + **kwargs + ): + super(ActivityParameterSet, self).__init__(**kwargs) + self.name = name + self.parameters = parameters + + +class ActivityParameterValidationSet(msrest.serialization.Model): + """Definition of the activity parameter validation set. + + :param member_value: Gets or sets the name of the activity parameter validation set member. + :type member_value: str + """ + + _attribute_map = { + 'member_value': {'key': 'memberValue', 'type': 'str'}, + } + + def __init__( + self, + *, + member_value: Optional[str] = None, + **kwargs + ): + super(ActivityParameterValidationSet, self).__init__(**kwargs) + self.member_value = member_value + + +class AdvancedScheduleMonthlyOccurrence(msrest.serialization.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: Optional[int] = None, + day: Optional[Union[str, "ScheduleDay"]] = None, + **kwargs + ): + super(AdvancedScheduleMonthlyOccurrence, self).__init__(**kwargs) + self.occurrence = occurrence + self.day = day + + +class AgentRegistration(msrest.serialization.Model): + """Definition of the agent registration information type. + + :param dsc_meta_configuration: Gets or sets the dsc meta configuration. + :type dsc_meta_configuration: str + :param endpoint: Gets or sets the dsc server endpoint. + :type endpoint: str + :param keys: Gets or sets the agent registration keys. + :type keys: ~azure.mgmt.automation.models.AgentRegistrationKeys + :param id: Gets or sets the id. + :type id: str + """ + + _attribute_map = { + 'dsc_meta_configuration': {'key': 'dscMetaConfiguration', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'keys': {'key': 'keys', 'type': 'AgentRegistrationKeys'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + dsc_meta_configuration: Optional[str] = None, + endpoint: Optional[str] = None, + keys: Optional["AgentRegistrationKeys"] = None, + id: Optional[str] = None, + **kwargs + ): + super(AgentRegistration, self).__init__(**kwargs) + self.dsc_meta_configuration = dsc_meta_configuration + self.endpoint = endpoint + self.keys = keys + self.id = id + + +class AgentRegistrationKeys(msrest.serialization.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: Optional[str] = None, + secondary: Optional[str] = None, + **kwargs + ): + super(AgentRegistrationKeys, self).__init__(**kwargs) + self.primary = primary + self.secondary = secondary + + +class AgentRegistrationRegenerateKeyParameter(msrest.serialization.Model): + """The parameters supplied to the regenerate keys operation. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Gets or sets the agent registration key name - primary or secondary. + Possible values include: "primary", "secondary". + :type key_name: str or ~azure.mgmt.automation.models.AgentRegistrationKeyName + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + *, + key_name: Union[str, "AgentRegistrationKeyName"], + **kwargs + ): + super(AgentRegistrationRegenerateKeyParameter, self).__init__(**kwargs) + self.key_name = key_name + + +class Resource(msrest.serialization.Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class AutomationAccount(TrackedResource): + """Definition of the automation account type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: 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.datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', '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'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + etag: Optional[str] = None, + sku: Optional["Sku"] = None, + last_modified_by: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(AutomationAccount, self).__init__(tags=tags, location=location, **kwargs) + self.etag = etag + 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 + + +class AutomationAccountCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update automation account operation. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + **kwargs + ): + super(AutomationAccountCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.location = location + self.tags = tags + self.sku = sku + + +class AutomationAccountListResult(msrest.serialization.Model): + """The response model for the list account operation. + + :param value: Gets or sets list of accounts. + :type value: list[~azure.mgmt.automation.models.AutomationAccount] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AutomationAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AutomationAccount"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AutomationAccountListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AutomationAccountUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update automation account operation. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + **kwargs + ): + super(AutomationAccountUpdateParameters, self).__init__(**kwargs) + self.name = name + self.location = location + self.tags = tags + self.sku = sku + + +class AzureQueryProperties(msrest.serialization.Model): + """Azure query for the update configuration. + + :param scope: List of Subscription or Resource Group ARM Ids. + :type scope: list[str] + :param locations: List of locations to scope the query to. + :type locations: list[str] + :param tag_settings: Tag settings for the VM. + :type tag_settings: ~azure.mgmt.automation.models.TagSettingsProperties + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': '[str]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'tag_settings': {'key': 'tagSettings', 'type': 'TagSettingsProperties'}, + } + + def __init__( + self, + *, + scope: Optional[List[str]] = None, + locations: Optional[List[str]] = None, + tag_settings: Optional["TagSettingsProperties"] = None, + **kwargs + ): + super(AzureQueryProperties, self).__init__(**kwargs) + self.scope = scope + self.locations = locations + self.tag_settings = tag_settings + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class Certificate(ProxyResource): + """Definition of the certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar thumbprint: Gets the thumbprint of the certificate. + :vartype thumbprint: str + :ivar expiry_time: Gets the expiry time of the certificate. + :vartype expiry_time: ~datetime.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.datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'expiry_time': {'readonly': True}, + 'is_exportable': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + **kwargs + ): + super(Certificate, self).__init__(**kwargs) + self.thumbprint = None + self.expiry_time = None + self.is_exportable = None + self.creation_time = None + self.last_modified_time = None + self.description = description + + +class CertificateCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update or replace certificate operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the certificate. + :type name: str + :param base64_value: Required. Gets or sets the base64 encoded value of the certificate. + :type base64_value: str + :param description: Gets or sets the description of the certificate. + :type description: str + :param thumbprint: Gets or sets the thumbprint of the certificate. + :type thumbprint: str + :param is_exportable: Gets or sets the is exportable flag of the certificate. + :type is_exportable: bool + """ + + _validation = { + 'name': {'required': True}, + 'base64_value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'base64_value': {'key': 'properties.base64Value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + base64_value: str, + description: Optional[str] = None, + thumbprint: Optional[str] = None, + is_exportable: Optional[bool] = None, + **kwargs + ): + super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.base64_value = base64_value + self.description = description + self.thumbprint = thumbprint + self.is_exportable = is_exportable + + +class CertificateListResult(msrest.serialization.Model): + """The response model for the list certificate operation. + + :param value: Gets or sets a list of certificates. + :type value: list[~azure.mgmt.automation.models.Certificate] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Certificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Certificate"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(CertificateListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CertificateUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update certificate operation. + + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + + +class CollectionItemUpdateConfiguration(msrest.serialization.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: ~datetime.timedelta + """ + + _attribute_map = { + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + } + + def __init__( + self, + *, + azure_virtual_machines: Optional[List[str]] = None, + duration: Optional[datetime.timedelta] = None, + **kwargs + ): + super(CollectionItemUpdateConfiguration, self).__init__(**kwargs) + self.azure_virtual_machines = azure_virtual_machines + self.duration = duration + + +class Connection(ProxyResource): + """Definition of the connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param connection_type: Gets or sets the connectionType of the connection. + :type connection_type: ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :ivar field_definition_values: Gets the field definition values of the connection. + :vartype field_definition_values: dict[str, str] + :ivar creation_time: Gets the creation time. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definition_values': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + connection_type: Optional["ConnectionTypeAssociationProperty"] = None, + description: Optional[str] = None, + **kwargs + ): + super(Connection, self).__init__(**kwargs) + self.connection_type = connection_type + self.field_definition_values = None + self.creation_time = None + self.last_modified_time = None + self.description = description + + +class ConnectionCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update connection operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param connection_type: Required. Gets or sets the connectionType of the connection. + :type connection_type: ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :param field_definition_values: Gets or sets the field definition properties of the connection. + :type field_definition_values: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'connection_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__( + self, + *, + name: str, + connection_type: "ConnectionTypeAssociationProperty", + description: Optional[str] = None, + field_definition_values: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ConnectionCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.connection_type = connection_type + self.field_definition_values = field_definition_values + + +class ConnectionListResult(msrest.serialization.Model): + """The response model for the list connection operation. + + :param value: Gets or sets a list of connection. + :type value: list[~azure.mgmt.automation.models.Connection] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Connection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Connection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ConnectionType(msrest.serialization.Model): + """Definition of the connection type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the connection type. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param is_global: Gets or sets a Boolean value to indicate if the connection type is global. + :type is_global: bool + :ivar field_definitions: Gets the field definitions of the connection type. + :vartype field_definitions: dict[str, ~azure.mgmt.automation.models.FieldDefinition] + :ivar creation_time: Gets the creation time. + :vartype creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definitions': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + is_global: Optional[bool] = None, + last_modified_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + **kwargs + ): + super(ConnectionType, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.is_global = is_global + self.field_definitions = None + self.creation_time = None + self.last_modified_time = last_modified_time + self.description = description + + +class ConnectionTypeAssociationProperty(msrest.serialization.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: Optional[str] = None, + **kwargs + ): + super(ConnectionTypeAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class ConnectionTypeCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update connection type operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection type. + :type name: str + :param is_global: Gets or sets a Boolean value to indicate if the connection type is global. + :type is_global: bool + :param field_definitions: Required. Gets or sets the field definitions of the connection type. + :type field_definitions: dict[str, ~azure.mgmt.automation.models.FieldDefinition] + """ + + _validation = { + 'name': {'required': True}, + 'field_definitions': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + } + + def __init__( + self, + *, + name: str, + field_definitions: Dict[str, "FieldDefinition"], + is_global: Optional[bool] = None, + **kwargs + ): + super(ConnectionTypeCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.is_global = is_global + self.field_definitions = field_definitions + + +class ConnectionTypeListResult(msrest.serialization.Model): + """The response model for the list connection type operation. + + :param value: Gets or sets a list of connection types. + :type value: list[~azure.mgmt.automation.models.ConnectionType] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConnectionType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ConnectionType"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ConnectionTypeListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ConnectionUpdateParameters(msrest.serialization.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: Optional[str] = None, + description: Optional[str] = None, + field_definition_values: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ConnectionUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.field_definition_values = field_definition_values + + +class ContentHash(msrest.serialization.Model): + """Definition of the runbook property type. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. Gets or sets the content hash algorithm used to hash the content. + :type algorithm: str + :param value: Required. Gets or sets expected hash value of the content. + :type value: str + """ + + _validation = { + 'algorithm': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'algorithm', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + algorithm: str, + value: str, + **kwargs + ): + super(ContentHash, self).__init__(**kwargs) + self.algorithm = algorithm + self.value = value + + +class ContentLink(msrest.serialization.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: Optional[str] = None, + content_hash: Optional["ContentHash"] = None, + version: Optional[str] = None, + **kwargs + ): + super(ContentLink, self).__init__(**kwargs) + self.uri = uri + self.content_hash = content_hash + self.version = version + + +class ContentSource(msrest.serialization.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: Optional["ContentHash"] = None, + type: Optional[Union[str, "ContentSourceType"]] = None, + value: Optional[str] = None, + version: Optional[str] = None, + **kwargs + ): + super(ContentSource, self).__init__(**kwargs) + self.hash = hash + self.type = type + self.value = value + self.version = version + + +class Credential(ProxyResource): + """Definition of the credential. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar user_name: Gets the user name of the credential. + :vartype user_name: str + :ivar creation_time: Gets the creation time. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_name': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + **kwargs + ): + super(Credential, self).__init__(**kwargs) + self.user_name = None + self.creation_time = None + self.last_modified_time = None + self.description = description + + +class CredentialCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update credential operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the credential. + :type name: str + :param user_name: Required. Gets or sets the user name of the credential. + :type user_name: str + :param password: Required. Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _validation = { + 'name': {'required': True}, + 'user_name': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + user_name: str, + password: str, + description: Optional[str] = None, + **kwargs + ): + super(CredentialCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.user_name = user_name + self.password = password + self.description = description + + +class CredentialListResult(msrest.serialization.Model): + """The response model for the list credential operation. + + :param value: Gets or sets a list of credentials. + :type value: list[~azure.mgmt.automation.models.Credential] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Credential]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Credential"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(CredentialListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CredentialUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the Update credential operation. + + :param name: Gets or sets the name of the credential. + :type name: str + :param user_name: Gets or sets the user name of the credential. + :type user_name: str + :param password: Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + user_name: Optional[str] = None, + password: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(CredentialUpdateParameters, self).__init__(**kwargs) + self.name = name + self.user_name = user_name + self.password = password + self.description = description + + +class DscCompilationJob(ProxyResource): + """Definition of the Dsc Compilation job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param configuration: Gets or sets the configuration. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :ivar started_by: Gets the compilation job started by. + :vartype started_by: str + :ivar job_id: Gets the id of the job. + :vartype job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: ~datetime.datetime + :param provisioning_state: The current provisioning state of the job. Possible values include: + "Failed", "Succeeded", "Suspended", "Processing". + :type provisioning_state: str or ~azure.mgmt.automation.models.JobProvisioningState + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + :param status: Gets or sets the status of the job. Possible values include: "New", + "Activating", "Running", "Completed", "Failed", "Stopped", "Blocked", "Suspended", + "Disconnected", "Suspending", "Stopping", "Resuming", "Removing". + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :ivar start_time: Gets the start time of the job. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: ~datetime.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.datetime + :ivar last_status_modified_time: Gets the last status modified time of the job. + :vartype last_status_modified_time: ~datetime.datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'started_by': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'exception': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_status_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__( + self, + *, + configuration: Optional["DscConfigurationAssociationProperty"] = None, + provisioning_state: Optional[Union[str, "JobProvisioningState"]] = None, + run_on: Optional[str] = None, + status: Optional[Union[str, "JobStatus"]] = None, + status_details: Optional[str] = None, + parameters: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DscCompilationJob, self).__init__(**kwargs) + self.configuration = configuration + self.started_by = None + self.job_id = None + self.creation_time = None + self.provisioning_state = provisioning_state + self.run_on = run_on + self.status = status + self.status_details = status_details + self.start_time = None + self.end_time = None + self.exception = None + self.last_modified_time = None + self.last_status_modified_time = None + self.parameters = parameters + + +class DscCompilationJobCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create compilation job operation. + + All required parameters must be populated in order to send to Azure. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param configuration: Required. Gets or sets the configuration. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + """ + + _validation = { + 'configuration': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__( + self, + *, + configuration: "DscConfigurationAssociationProperty", + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + parameters: Optional[Dict[str, str]] = None, + increment_node_configuration_build: Optional[bool] = None, + **kwargs + ): + super(DscCompilationJobCreateParameters, self).__init__(**kwargs) + self.name = name + self.location = location + self.tags = tags + self.configuration = configuration + self.parameters = parameters + self.increment_node_configuration_build = increment_node_configuration_build + + +class DscCompilationJobListResult(msrest.serialization.Model): + """The response model for the list job operation. + + :param value: Gets or sets a list of Dsc Compilation jobs. + :type value: list[~azure.mgmt.automation.models.DscCompilationJob] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscCompilationJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["DscCompilationJob"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(DscCompilationJobListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DscConfiguration(TrackedResource): + """Definition of the configuration type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :ivar provisioning_state: Gets or sets the provisioning state of the configuration. Default + value: "Succeeded". + :vartype provisioning_state: str + :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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param node_configuration_count: Gets the number of compiled node configurations. + :type node_configuration_count: int + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'node_configuration_count': {'key': 'properties.nodeConfigurationCount', 'type': 'int'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + provisioning_state = "Succeeded" + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + etag: Optional[str] = None, + job_count: Optional[int] = None, + parameters: Optional[Dict[str, "DscConfigurationParameter"]] = None, + source: Optional["ContentSource"] = None, + state: Optional[Union[str, "DscConfigurationState"]] = None, + log_verbose: Optional[bool] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + node_configuration_count: Optional[int] = None, + description: Optional[str] = None, + **kwargs + ): + super(DscConfiguration, self).__init__(tags=tags, location=location, **kwargs) + self.etag = etag + self.job_count = job_count + self.parameters = parameters + self.source = source + self.state = state + self.log_verbose = log_verbose + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.node_configuration_count = node_configuration_count + self.description = description + + +class DscConfigurationAssociationProperty(msrest.serialization.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: Optional[str] = None, + **kwargs + ): + super(DscConfigurationAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class DscConfigurationCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, 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 source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + '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'}, + } + + def __init__( + self, + *, + source: "ContentSource", + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + parameters: Optional[Dict[str, "DscConfigurationParameter"]] = None, + description: Optional[str] = None, + **kwargs + ): + super(DscConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.location = location + self.tags = tags + self.log_verbose = log_verbose + self.log_progress = log_progress + self.source = source + self.parameters = parameters + self.description = description + + +class DscConfigurationListResult(msrest.serialization.Model): + """The response model for the list configuration operation. + + :param value: Gets or sets a list of configurations. + :type value: list[~azure.mgmt.automation.models.DscConfiguration] + :param next_link: Gets or sets the next link. + :type next_link: str + :param total_count: Gets the total number of configurations matching filter criteria. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__( + self, + *, + value: Optional[List["DscConfiguration"]] = None, + next_link: Optional[str] = None, + total_count: Optional[int] = None, + **kwargs + ): + super(DscConfigurationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + self.total_count = total_count + + +class DscConfigurationParameter(msrest.serialization.Model): + """Definition of the configuration parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the parameter is + mandatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + is_mandatory: Optional[bool] = None, + position: Optional[int] = None, + default_value: Optional[str] = None, + **kwargs + ): + super(DscConfigurationParameter, self).__init__(**kwargs) + self.type = type + self.is_mandatory = is_mandatory + self.position = position + self.default_value = default_value + + +class DscConfigurationUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update configuration operation. + + :param name: Gets or sets name of the resource. + :type name: str + :param tags: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, 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 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 + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + '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'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + source: Optional["ContentSource"] = None, + parameters: Optional[Dict[str, "DscConfigurationParameter"]] = None, + description: Optional[str] = None, + **kwargs + ): + super(DscConfigurationUpdateParameters, self).__init__(**kwargs) + self.name = name + self.tags = tags + self.log_verbose = log_verbose + self.log_progress = log_progress + self.source = source + self.parameters = parameters + self.description = description + + +class DscMetaConfiguration(msrest.serialization.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: Optional[int] = None, + reboot_node_if_needed: Optional[bool] = None, + configuration_mode: Optional[str] = None, + action_after_reboot: Optional[str] = None, + certificate_id: Optional[str] = None, + refresh_frequency_mins: Optional[int] = None, + allow_module_overwrite: Optional[bool] = None, + **kwargs + ): + super(DscMetaConfiguration, self).__init__(**kwargs) + self.configuration_mode_frequency_mins = configuration_mode_frequency_mins + self.reboot_node_if_needed = reboot_node_if_needed + self.configuration_mode = configuration_mode + self.action_after_reboot = action_after_reboot + self.certificate_id = certificate_id + self.refresh_frequency_mins = refresh_frequency_mins + self.allow_module_overwrite = allow_module_overwrite + + +class DscNode(ProxyResource): + """Definition of a DscNode. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_seen: Gets or sets the last seen time of the node. + :type last_seen: ~datetime.datetime + :param registration_time: Gets or sets the registration time of the node. + :type registration_time: ~datetime.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 status: Gets or sets the status of the node. + :type status: str + :param node_id: Gets or sets the node id. + :type node_id: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param total_count: Gets the total number of records matching filter criteria. + :type total_count: int + :param extension_handler: Gets or sets the list of extensionHandler properties for a Node. + :type extension_handler: + list[~azure.mgmt.automation.models.DscNodeExtensionHandlerAssociationProperty] + :param name_properties_node_configuration_name: Gets or sets the name of the dsc node + configuration. + :type name_properties_node_configuration_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_seen': {'key': 'properties.lastSeen', 'type': 'iso-8601'}, + 'registration_time': {'key': 'properties.registrationTime', 'type': 'iso-8601'}, + 'ip': {'key': 'properties.ip', 'type': 'str'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'node_id': {'key': 'properties.nodeId', 'type': 'str'}, + 'etag': {'key': 'properties.etag', 'type': 'str'}, + 'total_count': {'key': 'properties.totalCount', 'type': 'int'}, + 'extension_handler': {'key': 'properties.extensionHandler', 'type': '[DscNodeExtensionHandlerAssociationProperty]'}, + 'name_properties_node_configuration_name': {'key': 'properties.nodeConfiguration.name', 'type': 'str'}, + } + + def __init__( + self, + *, + last_seen: Optional[datetime.datetime] = None, + registration_time: Optional[datetime.datetime] = None, + ip: Optional[str] = None, + account_id: Optional[str] = None, + status: Optional[str] = None, + node_id: Optional[str] = None, + etag: Optional[str] = None, + total_count: Optional[int] = None, + extension_handler: Optional[List["DscNodeExtensionHandlerAssociationProperty"]] = None, + name_properties_node_configuration_name: Optional[str] = None, + **kwargs + ): + super(DscNode, self).__init__(**kwargs) + self.last_seen = last_seen + self.registration_time = registration_time + self.ip = ip + self.account_id = account_id + self.status = status + self.node_id = node_id + self.etag = etag + self.total_count = total_count + self.extension_handler = extension_handler + self.name_properties_node_configuration_name = name_properties_node_configuration_name + + +class DscNodeConfiguration(ProxyResource): + """Definition of the dsc node configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param creation_time: Gets or sets creation time. + :type creation_time: ~datetime.datetime + :param configuration: Gets or sets the configuration of the node. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param source: Source of node configuration. + :type source: str + :param node_count: Number of nodes with this node configuration assigned. + :type node_count: long + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'long'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__( + self, + *, + last_modified_time: Optional[datetime.datetime] = None, + creation_time: Optional[datetime.datetime] = None, + configuration: Optional["DscConfigurationAssociationProperty"] = None, + source: Optional[str] = None, + node_count: Optional[int] = None, + increment_node_configuration_build: Optional[bool] = None, + **kwargs + ): + super(DscNodeConfiguration, self).__init__(**kwargs) + self.last_modified_time = last_modified_time + self.creation_time = creation_time + self.configuration = configuration + self.source = source + self.node_count = node_count + self.increment_node_configuration_build = increment_node_configuration_build + + +class DscNodeConfigurationCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update node configuration operation. + + :param name: Name of the node configuration. + :type name: str + :param tags: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param configuration: Gets or sets the configuration of the node. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + source: Optional["ContentSource"] = None, + configuration: Optional["DscConfigurationAssociationProperty"] = None, + increment_node_configuration_build: Optional[bool] = None, + **kwargs + ): + super(DscNodeConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.tags = tags + self.source = source + self.configuration = configuration + self.increment_node_configuration_build = increment_node_configuration_build + + +class DscNodeConfigurationListResult(msrest.serialization.Model): + """The response model for the list job operation. + + :param value: Gets or sets a list of Dsc node configurations. + :type value: list[~azure.mgmt.automation.models.DscNodeConfiguration] + :param next_link: Gets or sets the next link. + :type next_link: str + :param total_count: Gets or sets the total rows in query. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscNodeConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__( + self, + *, + value: Optional[List["DscNodeConfiguration"]] = None, + next_link: Optional[str] = None, + total_count: Optional[int] = None, + **kwargs + ): + super(DscNodeConfigurationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + self.total_count = total_count + + +class DscNodeExtensionHandlerAssociationProperty(msrest.serialization.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: Optional[str] = None, + version: Optional[str] = None, + **kwargs + ): + super(DscNodeExtensionHandlerAssociationProperty, self).__init__(**kwargs) + self.name = name + self.version = version + + +class DscNodeListResult(msrest.serialization.Model): + """The response model for the list dsc nodes operation. + + :param value: Gets or sets a list of dsc nodes. + :type value: list[~azure.mgmt.automation.models.DscNode] + :param next_link: Gets or sets the next link. + :type next_link: str + :param total_count: Gets the total number of nodes matching filter criteria. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscNode]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__( + self, + *, + value: Optional[List["DscNode"]] = None, + next_link: Optional[str] = None, + total_count: Optional[int] = None, + **kwargs + ): + super(DscNodeListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + self.total_count = total_count + + +class DscNodeReport(msrest.serialization.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.datetime + :param last_modified_time: Gets or sets the lastModifiedTime of the node report. + :type last_modified_time: ~datetime.datetime + :param start_time: Gets or sets the start time of the node report. + :type start_time: ~datetime.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: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + start_time: Optional[datetime.datetime] = None, + type: Optional[str] = None, + report_id: Optional[str] = None, + status: Optional[str] = None, + refresh_mode: Optional[str] = None, + reboot_requested: Optional[str] = None, + report_format_version: Optional[str] = None, + configuration_version: Optional[str] = None, + id: Optional[str] = None, + errors: Optional[List["DscReportError"]] = None, + resources: Optional[List["DscReportResource"]] = None, + meta_configuration: Optional["DscMetaConfiguration"] = None, + host_name: Optional[str] = None, + i_pv4_addresses: Optional[List[str]] = None, + i_pv6_addresses: Optional[List[str]] = None, + number_of_resources: Optional[int] = None, + raw_errors: Optional[str] = None, + **kwargs + ): + super(DscNodeReport, self).__init__(**kwargs) + self.end_time = end_time + self.last_modified_time = last_modified_time + self.start_time = start_time + self.type = type + self.report_id = report_id + self.status = status + self.refresh_mode = refresh_mode + self.reboot_requested = reboot_requested + self.report_format_version = report_format_version + self.configuration_version = configuration_version + self.id = id + self.errors = errors + self.resources = resources + self.meta_configuration = meta_configuration + self.host_name = host_name + self.i_pv4_addresses = i_pv4_addresses + self.i_pv6_addresses = i_pv6_addresses + self.number_of_resources = number_of_resources + self.raw_errors = raw_errors + + +class DscNodeReportListResult(msrest.serialization.Model): + """The response model for the list dsc nodes operation. + + :param value: Gets or sets a list of dsc node reports. + :type value: list[~azure.mgmt.automation.models.DscNodeReport] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DscNodeReport]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["DscNodeReport"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(DscNodeReportListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DscNodeUpdateParameters(msrest.serialization.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 name: Gets or sets the name of the dsc node configuration. + :type name: str + """ + + _attribute_map = { + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'name': {'key': 'properties.nodeConfiguration.name', 'type': 'str'}, + } + + def __init__( + self, + *, + node_id: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(DscNodeUpdateParameters, self).__init__(**kwargs) + self.node_id = node_id + self.name = name + + +class DscReportError(msrest.serialization.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: Optional[str] = None, + resource_id: Optional[str] = None, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + locale: Optional[str] = None, + error_details: Optional[str] = None, + **kwargs + ): + super(DscReportError, self).__init__(**kwargs) + self.error_source = error_source + self.resource_id = resource_id + self.error_code = error_code + self.error_message = error_message + self.locale = locale + self.error_details = error_details + + +class DscReportResource(msrest.serialization.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.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: Optional[str] = None, + source_info: Optional[str] = None, + depends_on: Optional[List["DscReportResourceNavigation"]] = None, + module_name: Optional[str] = None, + module_version: Optional[str] = None, + resource_name: Optional[str] = None, + error: Optional[str] = None, + status: Optional[str] = None, + duration_in_seconds: Optional[float] = None, + start_date: Optional[datetime.datetime] = None, + **kwargs + ): + super(DscReportResource, self).__init__(**kwargs) + self.resource_id = resource_id + self.source_info = source_info + self.depends_on = depends_on + self.module_name = module_name + self.module_version = module_version + self.resource_name = resource_name + self.error = error + self.status = status + self.duration_in_seconds = duration_in_seconds + self.start_date = start_date + + +class DscReportResourceNavigation(msrest.serialization.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: Optional[str] = None, + **kwargs + ): + super(DscReportResourceNavigation, self).__init__(**kwargs) + self.resource_id = resource_id + + +class ErrorResponse(msrest.serialization.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: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class FieldDefinition(msrest.serialization.Model): + """Definition of the connection fields. + + All required parameters must be populated in order to send to Azure. + + :param is_encrypted: Gets or sets the isEncrypted flag of the connection field definition. + :type is_encrypted: bool + :param is_optional: Gets or sets the isOptional flag of the connection field definition. + :type is_optional: bool + :param type: Required. Gets or sets the type of the connection field definition. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_encrypted': {'key': 'isEncrypted', 'type': 'bool'}, + 'is_optional': {'key': 'isOptional', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: str, + is_encrypted: Optional[bool] = None, + is_optional: Optional[bool] = None, + **kwargs + ): + super(FieldDefinition, self).__init__(**kwargs) + self.is_encrypted = is_encrypted + self.is_optional = is_optional + self.type = type + + +class HybridRunbookWorker(msrest.serialization.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.datetime + :param last_seen_date_time: Last Heartbeat from the Worker. + :type last_seen_date_time: ~datetime.datetime + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ip': {'key': 'ip', 'type': 'str'}, + 'registration_time': {'key': 'registrationTime', 'type': 'iso-8601'}, + 'last_seen_date_time': {'key': 'lastSeenDateTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + ip: Optional[str] = None, + registration_time: Optional[datetime.datetime] = None, + last_seen_date_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(HybridRunbookWorker, self).__init__(**kwargs) + self.name = name + self.ip = ip + self.registration_time = registration_time + self.last_seen_date_time = last_seen_date_time + + +class HybridRunbookWorkerGroup(msrest.serialization.Model): + """Definition of hybrid runbook worker group. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the name of the group. + :type name: str + :param hybrid_runbook_workers: Gets or sets the list of hybrid runbook workers. + :type hybrid_runbook_workers: list[~azure.mgmt.automation.models.HybridRunbookWorker] + :param credential: Sets the credential of a worker group. + :type credential: ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + :param group_type: Type of the HybridWorkerGroup. Possible values include: "User", "System". + :type group_type: str or ~azure.mgmt.automation.models.GroupTypeEnum + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'hybrid_runbook_workers': {'key': 'hybridRunbookWorkers', 'type': '[HybridRunbookWorker]'}, + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + 'group_type': {'key': 'groupType', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + hybrid_runbook_workers: Optional[List["HybridRunbookWorker"]] = None, + credential: Optional["RunAsCredentialAssociationProperty"] = None, + group_type: Optional[Union[str, "GroupTypeEnum"]] = None, + **kwargs + ): + super(HybridRunbookWorkerGroup, self).__init__(**kwargs) + self.id = id + self.name = name + self.hybrid_runbook_workers = hybrid_runbook_workers + self.credential = credential + self.group_type = group_type + + +class HybridRunbookWorkerGroupsListResult(msrest.serialization.Model): + """The response model for the list hybrid runbook worker groups. + + :param value: Gets or sets a list of hybrid runbook worker groups. + :type value: list[~azure.mgmt.automation.models.HybridRunbookWorkerGroup] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridRunbookWorkerGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["HybridRunbookWorkerGroup"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(HybridRunbookWorkerGroupsListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class HybridRunbookWorkerGroupUpdateParameters(msrest.serialization.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: Optional["RunAsCredentialAssociationProperty"] = None, + **kwargs + ): + super(HybridRunbookWorkerGroupUpdateParameters, self).__init__(**kwargs) + self.credential = credential + + +class Job(ProxyResource): + """Definition of the job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param started_by: Gets or sets the job started by. + :type started_by: str + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + :param job_id: Gets or sets the id of the job. + :type job_id: str + :param creation_time: Gets or sets the creation time of the job. + :type creation_time: ~datetime.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.datetime + :param end_time: Gets or sets the end time of the job. + :type end_time: ~datetime.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.datetime + :param last_status_modified_time: Gets or sets the last status modified time of the job. + :type last_status_modified_time: ~datetime.datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param provisioning_state: The current provisioning state of the job. Possible values include: + "Failed", "Succeeded", "Suspended", "Processing". + :type provisioning_state: str or ~azure.mgmt.automation.models.JobProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + runbook: Optional["RunbookAssociationProperty"] = None, + started_by: Optional[str] = None, + run_on: Optional[str] = None, + job_id: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + status: Optional[Union[str, "JobStatus"]] = None, + status_details: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + exception: Optional[str] = None, + last_modified_time: Optional[datetime.datetime] = None, + last_status_modified_time: Optional[datetime.datetime] = None, + parameters: Optional[Dict[str, str]] = None, + provisioning_state: Optional[Union[str, "JobProvisioningState"]] = None, + **kwargs + ): + super(Job, self).__init__(**kwargs) + self.runbook = runbook + self.started_by = started_by + self.run_on = run_on + self.job_id = job_id + self.creation_time = creation_time + self.status = status + self.status_details = status_details + self.start_time = start_time + self.end_time = end_time + self.exception = exception + self.last_modified_time = last_modified_time + self.last_status_modified_time = last_status_modified_time + self.parameters = parameters + self.provisioning_state = provisioning_state + + +class JobCollectionItem(ProxyResource): + """Job collection item properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar runbook: The runbook association. + :vartype runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :ivar job_id: The id of the job. + :vartype job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: ~datetime.datetime + :ivar status: The status of the job. Possible values include: "New", "Activating", "Running", + "Completed", "Failed", "Stopped", "Blocked", "Suspended", "Disconnected", "Suspending", + "Stopping", "Resuming", "Removing". + :vartype status: str or ~azure.mgmt.automation.models.JobStatus + :ivar start_time: The start time of the job. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the job. + :vartype end_time: ~datetime.datetime + :ivar last_modified_time: The last modified time of the job. + :vartype last_modified_time: ~datetime.datetime + :ivar provisioning_state: The provisioning state of a resource. + :vartype provisioning_state: str + :param run_on: Specifies the runOn group name where the job was executed. + :type run_on: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'runbook': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__( + self, + *, + run_on: Optional[str] = None, + **kwargs + ): + super(JobCollectionItem, self).__init__(**kwargs) + self.runbook = None + self.job_id = None + self.creation_time = None + self.status = None + self.start_time = None + self.end_time = None + self.last_modified_time = None + self.provisioning_state = None + self.run_on = run_on + + +class JobCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create job operation. + + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + """ + + _attribute_map = { + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__( + self, + *, + runbook: Optional["RunbookAssociationProperty"] = None, + parameters: Optional[Dict[str, str]] = None, + run_on: Optional[str] = None, + **kwargs + ): + super(JobCreateParameters, self).__init__(**kwargs) + self.runbook = runbook + self.parameters = parameters + self.run_on = run_on + + +class JobListResultV2(msrest.serialization.Model): + """The response model for the list job operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of jobs. + :type value: list[~azure.mgmt.automation.models.JobCollectionItem] + :ivar next_link: The link to the next page. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobCollectionItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["JobCollectionItem"]] = None, + **kwargs + ): + super(JobListResultV2, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class JobNavigation(msrest.serialization.Model): + """Software update configuration machine run job navigation properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Id of the job associated with the software update configuration run. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobNavigation, self).__init__(**kwargs) + self.id = None + + +class JobSchedule(msrest.serialization.Model): + """Definition of the job schedule. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the variable. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: ~datetime.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.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. + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: ~datetime.datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible values include: + "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param creation_time: Gets or sets the creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :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] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'week_days': {'key': 'properties.advancedSchedule.weekDays', 'type': '[str]'}, + 'month_days': {'key': 'properties.advancedSchedule.monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'properties.advancedSchedule.monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + expiry_time: Optional[datetime.datetime] = None, + expiry_time_offset_minutes: Optional[float] = None, + is_enabled: Optional[bool] = False, + next_run: Optional[datetime.datetime] = None, + next_run_offset_minutes: Optional[float] = None, + interval: Optional[int] = None, + frequency: Optional[Union[str, "ScheduleFrequency"]] = None, + time_zone: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + week_days: Optional[List[str]] = None, + month_days: Optional[List[int]] = None, + monthly_occurrences: Optional[List["AdvancedScheduleMonthlyOccurrence"]] = None, + **kwargs + ): + super(JobSchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + 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.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + self.week_days = week_days + self.month_days = month_days + self.monthly_occurrences = monthly_occurrences + + +class JobScheduleCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create job schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Required. Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job should run on. + :type run_on: str + :param parameters: Gets or sets a list of job properties. + :type parameters: dict[str, str] + """ + + _validation = { + 'schedule': {'required': True}, + 'runbook': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__( + self, + *, + schedule: "ScheduleAssociationProperty", + runbook: "RunbookAssociationProperty", + run_on: Optional[str] = None, + parameters: Optional[Dict[str, str]] = None, + **kwargs + ): + super(JobScheduleCreateParameters, self).__init__(**kwargs) + self.schedule = schedule + self.runbook = runbook + self.run_on = run_on + self.parameters = parameters + + +class JobScheduleListResult(msrest.serialization.Model): + """The response model for the list job schedule operation. + + :param value: Gets or sets a list of job schedules. + :type value: list[~azure.mgmt.automation.models.JobSchedule] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobSchedule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["JobSchedule"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(JobScheduleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class JobScheduleProperties(msrest.serialization.Model): + """Definition of job schedule parameters. + + :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 = { + 'job_schedule_id': {'key': 'jobScheduleId', 'type': 'str'}, + 'schedule': {'key': 'schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + } + + def __init__( + self, + *, + job_schedule_id: Optional[str] = None, + schedule: Optional["ScheduleAssociationProperty"] = None, + runbook: Optional["RunbookAssociationProperty"] = None, + run_on: Optional[str] = None, + parameters: Optional[Dict[str, str]] = None, + **kwargs + ): + super(JobScheduleProperties, self).__init__(**kwargs) + self.job_schedule_id = job_schedule_id + self.schedule = schedule + self.runbook = runbook + self.run_on = run_on + self.parameters = parameters + + +class JobStream(msrest.serialization.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.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: Optional[str] = None, + job_stream_id: Optional[str] = None, + time: Optional[datetime.datetime] = None, + stream_type: Optional[Union[str, "JobStreamType"]] = None, + stream_text: Optional[str] = None, + summary: Optional[str] = None, + value: Optional[Dict[str, object]] = None, + **kwargs + ): + super(JobStream, self).__init__(**kwargs) + self.id = id + self.job_stream_id = job_stream_id + self.time = time + self.stream_type = stream_type + self.stream_text = stream_text + self.summary = summary + self.value = value + + +class JobStreamListResult(msrest.serialization.Model): + """The response model for the list job stream operation. + + :param value: A list of job streams. + :type value: list[~azure.mgmt.automation.models.JobStream] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobStream]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["JobStream"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(JobStreamListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Key(msrest.serialization.Model): + """Automation key which is used to register a DSC Node. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key_name: Automation key name. Possible values include: "Primary", "Secondary". + :vartype key_name: str or ~azure.mgmt.automation.models.AutomationKeyName + :ivar permissions: Automation key permissions. Possible values include: "Read", "Full". + :vartype permissions: str or ~azure.mgmt.automation.models.AutomationKeyPermissions + :ivar value: Value of the Automation Key used for registration. + :vartype value: str + """ + + _validation = { + 'key_name': {'readonly': True}, + 'permissions': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'KeyName', 'type': 'str'}, + 'permissions': {'key': 'Permissions', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Key, self).__init__(**kwargs) + self.key_name = None + self.permissions = None + self.value = None + + +class KeyListResult(msrest.serialization.Model): + """KeyListResult. + + :param keys: Lists the automation keys. + :type keys: list[~azure.mgmt.automation.models.Key] + """ + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[Key]'}, + } + + def __init__( + self, + *, + keys: Optional[List["Key"]] = None, + **kwargs + ): + super(KeyListResult, self).__init__(**kwargs) + self.keys = keys + + +class LinkedWorkspace(msrest.serialization.Model): + """Definition of the linked workspace. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Gets the id of the linked workspace. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LinkedWorkspace, self).__init__(**kwargs) + self.id = None + + +class LinuxProperties(msrest.serialization.Model): + """Linux specific update configuration. + + :param included_package_classifications: Update classifications included in the software update + configuration. Possible values include: "Unclassified", "Critical", "Security", "Other". + :type included_package_classifications: str or ~azure.mgmt.automation.models.LinuxUpdateClasses + :param excluded_package_name_masks: packages excluded from the software update configuration. + :type excluded_package_name_masks: list[str] + :param included_package_name_masks: packages included from the software update configuration. + :type included_package_name_masks: list[str] + :param reboot_setting: Reboot setting for the software update configuration. + :type reboot_setting: str + """ + + _attribute_map = { + 'included_package_classifications': {'key': 'includedPackageClassifications', 'type': 'str'}, + 'excluded_package_name_masks': {'key': 'excludedPackageNameMasks', 'type': '[str]'}, + 'included_package_name_masks': {'key': 'includedPackageNameMasks', 'type': '[str]'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + } + + def __init__( + self, + *, + included_package_classifications: Optional[Union[str, "LinuxUpdateClasses"]] = None, + excluded_package_name_masks: Optional[List[str]] = None, + included_package_name_masks: Optional[List[str]] = None, + reboot_setting: Optional[str] = None, + **kwargs + ): + super(LinuxProperties, self).__init__(**kwargs) + self.included_package_classifications = included_package_classifications + self.excluded_package_name_masks = excluded_package_name_masks + self.included_package_name_masks = included_package_name_masks + self.reboot_setting = reboot_setting + + +class Module(TrackedResource): + """Definition of the module type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: 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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :param is_composite: Gets or sets type of module, if its composite or not. + :type is_composite: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', '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': 'str'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'error': {'key': 'properties.error', 'type': 'ModuleErrorInfo'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_composite': {'key': 'properties.isComposite', 'type': 'bool'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + etag: Optional[str] = None, + is_global: Optional[bool] = None, + version: Optional[str] = None, + size_in_bytes: Optional[int] = None, + activity_count: Optional[int] = None, + provisioning_state: Optional[Union[str, "ModuleProvisioningState"]] = None, + content_link: Optional["ContentLink"] = None, + error: Optional["ModuleErrorInfo"] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + is_composite: Optional[bool] = None, + **kwargs + ): + super(Module, self).__init__(tags=tags, location=location, **kwargs) + self.etag = etag + self.is_global = is_global + self.version = version + self.size_in_bytes = size_in_bytes + self.activity_count = activity_count + self.provisioning_state = provisioning_state + self.content_link = content_link + self.error = error + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + self.is_composite = is_composite + + +class ModuleCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + *, + content_link: "ContentLink", + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ModuleCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.location = location + self.tags = tags + self.content_link = content_link + + +class ModuleErrorInfo(msrest.serialization.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: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ModuleErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ModuleListResult(msrest.serialization.Model): + """The response model for the list module operation. + + :param value: Gets or sets a list of modules. + :type value: list[~azure.mgmt.automation.models.Module] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Module]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Module"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ModuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ModuleUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update module operation. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + content_link: Optional["ContentLink"] = None, + **kwargs + ): + super(ModuleUpdateParameters, self).__init__(**kwargs) + self.name = name + self.location = location + self.tags = tags + self.content_link = content_link + + +class NodeCount(msrest.serialization.Model): + """Number of nodes based on the Filter. + + :param name: Gets the name of a count type. + :type name: str + :param properties: + :type properties: ~azure.mgmt.automation.models.NodeCountProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'NodeCountProperties'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + properties: Optional["NodeCountProperties"] = None, + **kwargs + ): + super(NodeCount, self).__init__(**kwargs) + self.name = name + self.properties = properties + + +class NodeCountProperties(msrest.serialization.Model): + """NodeCountProperties. + + :param count: Gets the count for the name. + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + **kwargs + ): + super(NodeCountProperties, self).__init__(**kwargs) + self.count = count + + +class NodeCounts(msrest.serialization.Model): + """Gets the count of nodes by count type. + + :param value: Gets an array of counts. + :type value: list[~azure.mgmt.automation.models.NodeCount] + :param total_count: Gets the total number of records matching countType criteria. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NodeCount]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__( + self, + *, + value: Optional[List["NodeCount"]] = None, + total_count: Optional[int] = None, + **kwargs + ): + super(NodeCounts, self).__init__(**kwargs) + self.value = value + self.total_count = total_count + + +class NonAzureQueryProperties(msrest.serialization.Model): + """Non Azure query for the update configuration. + + :param function_alias: Log Analytics Saved Search name. + :type function_alias: str + :param workspace_id: Workspace Id for Log Analytics in which the saved Search is resided. + :type workspace_id: str + """ + + _attribute_map = { + 'function_alias': {'key': 'functionAlias', 'type': 'str'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + } + + def __init__( + self, + *, + function_alias: Optional[str] = None, + workspace_id: Optional[str] = None, + **kwargs + ): + super(NonAzureQueryProperties, self).__init__(**kwargs) + self.function_alias = function_alias + self.workspace_id = workspace_id + + +class Operation(msrest.serialization.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: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDisplay(msrest.serialization.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: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + + +class OperationListResult(msrest.serialization.Model): + """The response model for the list of Automation operations. + + :param value: List of Automation operations supported by the Automation resource provider. + :type value: list[~azure.mgmt.automation.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + + +class PythonPackageCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :param tags: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + *, + content_link: "ContentLink", + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(PythonPackageCreateParameters, self).__init__(**kwargs) + self.tags = tags + self.content_link = content_link + + +class PythonPackageUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update module operation. + + :param tags: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(PythonPackageUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class RunAsCredentialAssociationProperty(msrest.serialization.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: Optional[str] = None, + **kwargs + ): + super(RunAsCredentialAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class Runbook(TrackedResource): + """Definition of the runbook type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: 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 + :ivar provisioning_state: Gets or sets the provisioning state of the runbook. Default value: + "Succeeded". + :vartype provisioning_state: str + :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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', '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': 'str'}, + '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'}, + } + + provisioning_state = "Succeeded" + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + etag: Optional[str] = None, + runbook_type: Optional[Union[str, "RunbookTypeEnum"]] = None, + publish_content_link: Optional["ContentLink"] = None, + state: Optional[Union[str, "RunbookState"]] = None, + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + log_activity_trace: Optional[int] = None, + job_count: Optional[int] = None, + parameters: Optional[Dict[str, "RunbookParameter"]] = None, + output_types: Optional[List[str]] = None, + draft: Optional["RunbookDraft"] = None, + last_modified_by: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + **kwargs + ): + super(Runbook, self).__init__(tags=tags, location=location, **kwargs) + self.etag = etag + 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.last_modified_by = last_modified_by + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + + +class RunbookAssociationProperty(msrest.serialization.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: Optional[str] = None, + **kwargs + ): + super(RunbookAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class RunbookCreateOrUpdateDraftParameters(msrest.serialization.Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param runbook_content: Required. Content of the Runbook. + :type runbook_content: str + """ + + _validation = { + 'runbook_content': {'required': True}, + } + + _attribute_map = { + 'runbook_content': {'key': 'runbookContent', 'type': 'str'}, + } + + def __init__( + self, + *, + runbook_content: str, + **kwargs + ): + super(RunbookCreateOrUpdateDraftParameters, self).__init__(**kwargs) + self.runbook_content = runbook_content + + +class RunbookCreateOrUpdateDraftProperties(msrest.serialization.Model): + """The parameters supplied to the create or update draft runbook properties. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. Possible values include: + "Script", "Graph", "PowerShellWorkflow", "PowerShell", "GraphPowerShellWorkflow", + "GraphPowerShell". + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Required. Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options of the runbook. + :type log_activity_trace: int + """ + + _validation = { + 'runbook_type': {'required': True}, + 'draft': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'runbookType', 'type': 'str'}, + 'draft': {'key': 'draft', 'type': 'RunbookDraft'}, + 'description': {'key': 'description', 'type': 'str'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__( + self, + *, + runbook_type: Union[str, "RunbookTypeEnum"], + draft: "RunbookDraft", + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + description: Optional[str] = None, + log_activity_trace: Optional[int] = None, + **kwargs + ): + super(RunbookCreateOrUpdateDraftProperties, self).__init__(**kwargs) + self.log_verbose = log_verbose + self.log_progress = log_progress + self.runbook_type = runbook_type + self.draft = draft + self.description = description + self.log_activity_trace = log_activity_trace + + +class RunbookCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, 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 runbook_type: Required. Gets or sets the type of the runbook. Possible values include: + "Script", "Graph", "PowerShellWorkflow", "PowerShell", "GraphPowerShellWorkflow", + "GraphPowerShell". + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param publish_content_link: Gets or sets the published runbook content link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options of the runbook. + :type log_activity_trace: int + """ + + _validation = { + 'runbook_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + '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'}, + } + + def __init__( + self, + *, + runbook_type: Union[str, "RunbookTypeEnum"], + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + draft: Optional["RunbookDraft"] = None, + publish_content_link: Optional["ContentLink"] = None, + description: Optional[str] = None, + log_activity_trace: Optional[int] = None, + **kwargs + ): + super(RunbookCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.location = location + self.tags = tags + 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 + + +class RunbookDraft(msrest.serialization.Model): + """RunbookDraft. + + :param in_edit: Gets or sets whether runbook is in edit mode. + :type in_edit: bool + :param draft_content_link: Gets or sets the draft runbook content link. + :type draft_content_link: ~azure.mgmt.automation.models.ContentLink + :param creation_time: Gets or sets the creation time of the runbook draft. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time of the runbook draft. + :type last_modified_time: ~datetime.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: Optional[bool] = None, + draft_content_link: Optional["ContentLink"] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + parameters: Optional[Dict[str, "RunbookParameter"]] = None, + output_types: Optional[List[str]] = None, + **kwargs + ): + super(RunbookDraft, self).__init__(**kwargs) + self.in_edit = in_edit + self.draft_content_link = draft_content_link + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.parameters = parameters + self.output_types = output_types + + +class RunbookDraftUndoEditResult(msrest.serialization.Model): + """The response model for the undo edit runbook operation. + + :param status_code: Possible values include: "Continue", "SwitchingProtocols", "OK", + "Created", "Accepted", "NonAuthoritativeInformation", "NoContent", "ResetContent", + "PartialContent", "MultipleChoices", "Ambiguous", "MovedPermanently", "Moved", "Found", + "Redirect", "SeeOther", "RedirectMethod", "NotModified", "UseProxy", "Unused", + "TemporaryRedirect", "RedirectKeepVerb", "BadRequest", "Unauthorized", "PaymentRequired", + "Forbidden", "NotFound", "MethodNotAllowed", "NotAcceptable", "ProxyAuthenticationRequired", + "RequestTimeout", "Conflict", "Gone", "LengthRequired", "PreconditionFailed", + "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", + "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", + "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", + "HttpVersionNotSupported". + :type status_code: str or ~azure.mgmt.automation.models.HttpStatusCode + :param request_id: + :type request_id: str + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + } + + def __init__( + self, + *, + status_code: Optional[Union[str, "HttpStatusCode"]] = None, + request_id: Optional[str] = None, + **kwargs + ): + super(RunbookDraftUndoEditResult, self).__init__(**kwargs) + self.status_code = status_code + self.request_id = request_id + + +class RunbookListResult(msrest.serialization.Model): + """The response model for the list runbook operation. + + :param value: Gets or sets a list of runbooks. + :type value: list[~azure.mgmt.automation.models.Runbook] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Runbook]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Runbook"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RunbookListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RunbookParameter(msrest.serialization.Model): + """Definition of the runbook parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the parameter is + mandatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + is_mandatory: Optional[bool] = None, + position: Optional[int] = None, + default_value: Optional[str] = None, + **kwargs + ): + super(RunbookParameter, self).__init__(**kwargs) + self.type = type + self.is_mandatory = is_mandatory + self.position = position + self.default_value = default_value + + +class RunbookUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update runbook operation. + + :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: A set of tags. Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :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 + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + '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'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + log_verbose: Optional[bool] = None, + log_progress: Optional[bool] = None, + log_activity_trace: Optional[int] = None, + **kwargs + ): + super(RunbookUpdateParameters, self).__init__(**kwargs) + self.name = name + self.location = location + self.tags = tags + self.description = description + self.log_verbose = log_verbose + self.log_progress = log_progress + self.log_activity_trace = log_activity_trace + + +class Schedule(ProxyResource): + """Definition of the schedule. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: ~datetime.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.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. + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: ~datetime.datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible values include: + "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param creation_time: Gets or sets the creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :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] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'week_days': {'key': 'properties.advancedSchedule.weekDays', 'type': '[str]'}, + 'month_days': {'key': 'properties.advancedSchedule.monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'properties.advancedSchedule.monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + expiry_time: Optional[datetime.datetime] = None, + expiry_time_offset_minutes: Optional[float] = None, + is_enabled: Optional[bool] = False, + next_run: Optional[datetime.datetime] = None, + next_run_offset_minutes: Optional[float] = None, + interval: Optional[int] = None, + frequency: Optional[Union[str, "ScheduleFrequency"]] = None, + time_zone: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + week_days: Optional[List[str]] = None, + month_days: Optional[List[int]] = None, + monthly_occurrences: Optional[List["AdvancedScheduleMonthlyOccurrence"]] = None, + **kwargs + ): + super(Schedule, self).__init__(**kwargs) + self.start_time = start_time + self.start_time_offset_minutes = None + self.expiry_time = expiry_time + self.expiry_time_offset_minutes = expiry_time_offset_minutes + self.is_enabled = is_enabled + self.next_run = next_run + self.next_run_offset_minutes = next_run_offset_minutes + self.interval = interval + self.frequency = frequency + self.time_zone = time_zone + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + self.week_days = week_days + self.month_days = month_days + self.monthly_occurrences = monthly_occurrences + + +class ScheduleAssociationProperty(msrest.serialization.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: Optional[str] = None, + **kwargs + ): + super(ScheduleAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class ScheduleCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the Schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param start_time: Required. Gets or sets the start time of the schedule. + :type start_time: ~datetime.datetime + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: ~datetime.datetime + :param interval: Gets or sets the interval of the schedule. + :type interval: object + :param frequency: Required. Gets or sets the frequency of the schedule. Possible values + include: "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param 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] + """ + + _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'}, + 'week_days': {'key': 'properties.advancedSchedule.weekDays', 'type': '[str]'}, + 'month_days': {'key': 'properties.advancedSchedule.monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'properties.advancedSchedule.monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__( + self, + *, + name: str, + start_time: datetime.datetime, + frequency: Union[str, "ScheduleFrequency"], + description: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + interval: Optional[object] = None, + time_zone: Optional[str] = None, + week_days: Optional[List[str]] = None, + month_days: Optional[List[int]] = None, + monthly_occurrences: Optional[List["AdvancedScheduleMonthlyOccurrence"]] = None, + **kwargs + ): + super(ScheduleCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.start_time = start_time + self.expiry_time = expiry_time + self.interval = interval + self.frequency = frequency + self.time_zone = time_zone + self.week_days = week_days + self.month_days = month_days + self.monthly_occurrences = monthly_occurrences + + +class ScheduleListResult(msrest.serialization.Model): + """The response model for the list schedule operation. + + :param value: Gets or sets a list of schedules. + :type value: list[~azure.mgmt.automation.models.Schedule] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Schedule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Schedule"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ScheduleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ScheduleUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update schedule operation. + + :param name: Gets or sets the name of the Schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param is_enabled: Gets or sets a value indicating whether this schedule is enabled. + :type is_enabled: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + is_enabled: Optional[bool] = None, + **kwargs + ): + super(ScheduleUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.is_enabled = is_enabled + + +class Sku(msrest.serialization.Model): + """The account SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the SKU name of the account. Possible values include: + "Free", "Basic". + :type name: str or ~azure.mgmt.automation.models.SkuNameEnum + :param family: Gets or sets the SKU family. + :type family: str + :param capacity: Gets or sets the SKU capacity. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Union[str, "SkuNameEnum"], + family: Optional[str] = None, + capacity: Optional[int] = None, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.family = family + self.capacity = capacity + + +class SoftareUpdateConfigurationRunTaskProperties(msrest.serialization.Model): + """Task properties of the software update configuration. + + :param status: The status of the task. + :type status: str + :param source: The name of the source of the task. + :type source: str + :param job_id: The job id of the task. + :type job_id: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + source: Optional[str] = None, + job_id: Optional[str] = None, + **kwargs + ): + super(SoftareUpdateConfigurationRunTaskProperties, self).__init__(**kwargs) + self.status = status + self.source = source + self.job_id = job_id + + +class SoftareUpdateConfigurationRunTasks(msrest.serialization.Model): + """Software update configuration run tasks model. + + :param pre_task: Pre task properties. + :type pre_task: ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTaskProperties + :param post_task: Post task properties. + :type post_task: ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTaskProperties + """ + + _attribute_map = { + 'pre_task': {'key': 'preTask', 'type': 'SoftareUpdateConfigurationRunTaskProperties'}, + 'post_task': {'key': 'postTask', 'type': 'SoftareUpdateConfigurationRunTaskProperties'}, + } + + def __init__( + self, + *, + pre_task: Optional["SoftareUpdateConfigurationRunTaskProperties"] = None, + post_task: Optional["SoftareUpdateConfigurationRunTaskProperties"] = None, + **kwargs + ): + super(SoftareUpdateConfigurationRunTasks, self).__init__(**kwargs) + self.pre_task = pre_task + self.post_task = post_task + + +class SoftwareUpdateConfiguration(msrest.serialization.Model): + """Software update configuration properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: Provisioning state for the software update configuration, which only + appears in the response. + :vartype provisioning_state: str + :param error: Details of provisioning error. + :type error: ~azure.mgmt.automation.models.ErrorResponse + :ivar creation_time_properties_creation_time: Creation time of the resource, which only appears + in the response. + :vartype creation_time_properties_creation_time: ~datetime.datetime + :ivar created_by: CreatedBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time_properties_last_modified_time: Last time resource was modified, which + only appears in the response. + :vartype last_modified_time_properties_last_modified_time: ~datetime.datetime + :ivar last_modified_by: LastModifiedBy property, which only appears in the response. + :vartype last_modified_by: str + :param parameters_properties_tasks_post_task_parameters: Gets or sets the parameters of the + task. + :type parameters_properties_tasks_post_task_parameters: dict[str, str] + :param source_properties_tasks_post_task_source: Gets or sets the name of the runbook. + :type source_properties_tasks_post_task_source: str + :param parameters_properties_tasks_pre_task_parameters: Gets or sets the parameters of the + task. + :type parameters_properties_tasks_pre_task_parameters: dict[str, str] + :param source_properties_tasks_pre_task_source: Gets or sets the name of the runbook. + :type source_properties_tasks_pre_task_source: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: ~datetime.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.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. + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: ~datetime.datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible values include: + "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param creation_time_properties_schedule_info_creation_time: Gets or sets the creation time. + :type creation_time_properties_schedule_info_creation_time: ~datetime.datetime + :param last_modified_time_properties_schedule_info_last_modified_time: Gets or sets the last + modified time. + :type last_modified_time_properties_schedule_info_last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :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] + :param operating_system: Required. operating system of target machines. Possible values + include: "Windows", "Linux". + :type operating_system: str or ~azure.mgmt.automation.models.OperatingSystemType + :param windows: Windows specific update configuration. + :type windows: ~azure.mgmt.automation.models.WindowsProperties + :param linux: Linux specific update configuration. + :type linux: ~azure.mgmt.automation.models.LinuxProperties + :param duration: Maximum time allowed for the software update configuration run. Duration needs + to be specified using the format PT[n]H[n]M[n]S as per ISO8601. + :type duration: ~datetime.timedelta + :param azure_virtual_machines: List of azure resource Ids for azure virtual machines targeted + by the software update configuration. + :type azure_virtual_machines: list[str] + :param non_azure_computer_names: List of names of non-azure machines targeted by the software + update configuration. + :type non_azure_computer_names: list[str] + :param azure_queries: List of Azure queries in the software update configuration. + :type azure_queries: list[~azure.mgmt.automation.models.AzureQueryProperties] + :param non_azure_queries: List of non Azure queries in the software update configuration. + :type non_azure_queries: list[~azure.mgmt.automation.models.NonAzureQueryProperties] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'creation_time_properties_creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time_properties_last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + 'creation_time_properties_creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time_properties_last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'parameters_properties_tasks_post_task_parameters': {'key': 'properties.tasks.postTask.parameters', 'type': '{str}'}, + 'source_properties_tasks_post_task_source': {'key': 'properties.tasks.postTask.source', 'type': 'str'}, + 'parameters_properties_tasks_pre_task_parameters': {'key': 'properties.tasks.preTask.parameters', 'type': '{str}'}, + 'source_properties_tasks_pre_task_source': {'key': 'properties.tasks.preTask.source', 'type': 'str'}, + 'start_time': {'key': 'properties.scheduleInfo.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.scheduleInfo.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.scheduleInfo.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.scheduleInfo.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.scheduleInfo.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.scheduleInfo.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.scheduleInfo.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.scheduleInfo.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.scheduleInfo.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.scheduleInfo.timeZone', 'type': 'str'}, + 'creation_time_properties_schedule_info_creation_time': {'key': 'properties.scheduleInfo.creationTime', 'type': 'iso-8601'}, + 'last_modified_time_properties_schedule_info_last_modified_time': {'key': 'properties.scheduleInfo.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.scheduleInfo.description', 'type': 'str'}, + 'week_days': {'key': 'properties.scheduleInfo.advancedSchedule.weekDays', 'type': '[str]'}, + 'month_days': {'key': 'properties.scheduleInfo.advancedSchedule.monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'properties.scheduleInfo.advancedSchedule.monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + 'operating_system': {'key': 'properties.updateConfiguration.operatingSystem', 'type': 'str'}, + 'windows': {'key': 'properties.updateConfiguration.windows', 'type': 'WindowsProperties'}, + 'linux': {'key': 'properties.updateConfiguration.linux', 'type': 'LinuxProperties'}, + 'duration': {'key': 'properties.updateConfiguration.duration', 'type': 'duration'}, + 'azure_virtual_machines': {'key': 'properties.updateConfiguration.azureVirtualMachines', 'type': '[str]'}, + 'non_azure_computer_names': {'key': 'properties.updateConfiguration.nonAzureComputerNames', 'type': '[str]'}, + 'azure_queries': {'key': 'properties.updateConfiguration.targets.azureQueries', 'type': '[AzureQueryProperties]'}, + 'non_azure_queries': {'key': 'properties.updateConfiguration.targets.nonAzureQueries', 'type': '[NonAzureQueryProperties]'}, + } + + def __init__( + self, + *, + operating_system: Union[str, "OperatingSystemType"], + error: Optional["ErrorResponse"] = None, + parameters_properties_tasks_post_task_parameters: Optional[Dict[str, str]] = None, + source_properties_tasks_post_task_source: Optional[str] = None, + parameters_properties_tasks_pre_task_parameters: Optional[Dict[str, str]] = None, + source_properties_tasks_pre_task_source: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + expiry_time: Optional[datetime.datetime] = None, + expiry_time_offset_minutes: Optional[float] = None, + is_enabled: Optional[bool] = False, + next_run: Optional[datetime.datetime] = None, + next_run_offset_minutes: Optional[float] = None, + interval: Optional[int] = None, + frequency: Optional[Union[str, "ScheduleFrequency"]] = None, + time_zone: Optional[str] = None, + creation_time_properties_schedule_info_creation_time: Optional[datetime.datetime] = None, + last_modified_time_properties_schedule_info_last_modified_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + week_days: Optional[List[str]] = None, + month_days: Optional[List[int]] = None, + monthly_occurrences: Optional[List["AdvancedScheduleMonthlyOccurrence"]] = None, + windows: Optional["WindowsProperties"] = None, + linux: Optional["LinuxProperties"] = None, + duration: Optional[datetime.timedelta] = None, + azure_virtual_machines: Optional[List[str]] = None, + non_azure_computer_names: Optional[List[str]] = None, + azure_queries: Optional[List["AzureQueryProperties"]] = None, + non_azure_queries: Optional[List["NonAzureQueryProperties"]] = None, + **kwargs + ): + super(SoftwareUpdateConfiguration, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.provisioning_state = None + self.error = error + self.creation_time_properties_creation_time = None + self.created_by = None + self.last_modified_time_properties_last_modified_time = None + self.last_modified_by = None + self.parameters_properties_tasks_post_task_parameters = parameters_properties_tasks_post_task_parameters + self.source_properties_tasks_post_task_source = source_properties_tasks_post_task_source + self.parameters_properties_tasks_pre_task_parameters = parameters_properties_tasks_pre_task_parameters + self.source_properties_tasks_pre_task_source = source_properties_tasks_pre_task_source + 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.creation_time_properties_schedule_info_creation_time = creation_time_properties_schedule_info_creation_time + self.last_modified_time_properties_schedule_info_last_modified_time = last_modified_time_properties_schedule_info_last_modified_time + self.description = description + self.week_days = week_days + self.month_days = month_days + self.monthly_occurrences = monthly_occurrences + self.operating_system = operating_system + self.windows = windows + self.linux = linux + self.duration = duration + self.azure_virtual_machines = azure_virtual_machines + self.non_azure_computer_names = non_azure_computer_names + self.azure_queries = azure_queries + self.non_azure_queries = non_azure_queries + + +class SoftwareUpdateConfigurationCollectionItem(msrest.serialization.Model): + """Software update configuration collection item properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the software update configuration. + :vartype name: str + :ivar id: Resource Id of the software update configuration. + :vartype id: str + :param update_configuration: Update specific properties of the software update configuration. + :type update_configuration: ~azure.mgmt.automation.models.CollectionItemUpdateConfiguration + :param frequency: execution frequency of the schedule associated with the software update + configuration. Possible values include: "OneTime", "Day", "Hour", "Week", "Month", "Minute". + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param start_time: the start time of the update. + :type start_time: ~datetime.datetime + :ivar creation_time: Creation time of the software update configuration, which only appears in + the response. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Last time software update configuration was modified, which only + appears in the response. + :vartype last_modified_time: ~datetime.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.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: Optional["CollectionItemUpdateConfiguration"] = None, + frequency: Optional[Union[str, "ScheduleFrequency"]] = None, + start_time: Optional[datetime.datetime] = None, + next_run: Optional[datetime.datetime] = None, + **kwargs + ): + super(SoftwareUpdateConfigurationCollectionItem, self).__init__(**kwargs) + self.name = None + self.id = None + self.update_configuration = update_configuration + self.frequency = frequency + self.start_time = start_time + self.creation_time = None + self.last_modified_time = None + self.provisioning_state = None + self.next_run = next_run + + +class SoftwareUpdateConfigurationListResult(msrest.serialization.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: Optional[List["SoftwareUpdateConfigurationCollectionItem"]] = None, + **kwargs + ): + super(SoftwareUpdateConfigurationListResult, self).__init__(**kwargs) + self.value = value + + +class SoftwareUpdateConfigurationMachineRun(msrest.serialization.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.datetime + :ivar end_time: End time of the software update configuration machine run. + :vartype end_time: ~datetime.datetime + :ivar configured_duration: configured duration for the software update configuration run. + :vartype configured_duration: str + :param job: Job associated with the software update configuration machine run. + :type job: ~azure.mgmt.automation.models.JobNavigation + :ivar creation_time: Creation time of the resource, which only appears in the response. + :vartype creation_time: ~datetime.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.datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the response. + :vartype last_modified_by: str + :param error: Details of provisioning error. + :type error: ~azure.mgmt.automation.models.ErrorResponse + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target_computer': {'readonly': True}, + 'target_computer_type': {'readonly': True}, + 'status': {'readonly': True}, + 'os_type': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'source_computer_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'target_computer': {'key': 'properties.targetComputer', 'type': 'str'}, + 'target_computer_type': {'key': 'properties.targetComputerType', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'source_computer_id': {'key': 'properties.sourceComputerId', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'job': {'key': 'properties.job', 'type': 'JobNavigation'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + *, + software_update_configuration: Optional["UpdateConfigurationNavigation"] = None, + job: Optional["JobNavigation"] = None, + error: Optional["ErrorResponse"] = None, + **kwargs + ): + super(SoftwareUpdateConfigurationMachineRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.target_computer = None + self.target_computer_type = None + self.software_update_configuration = software_update_configuration + self.status = None + self.os_type = None + self.correlation_id = None + self.source_computer_id = None + self.start_time = None + self.end_time = None + self.configured_duration = None + self.job = job + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.error = error + + +class SoftwareUpdateConfigurationMachineRunListResult(msrest.serialization.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: Optional[List["SoftwareUpdateConfigurationMachineRun"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SoftwareUpdateConfigurationMachineRunListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SoftwareUpdateConfigurationRun(msrest.serialization.Model): + """Software update configuration Run properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the software update configuration run. + :vartype name: str + :ivar id: Resource Id of the software update configuration run. + :vartype id: str + :param software_update_configuration: software update configuration triggered this run. + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration run. + :vartype status: str + :ivar configured_duration: Configured duration for the software update configuration run. + :vartype configured_duration: str + :ivar os_type: Operating system target of the software update configuration triggered this run. + :vartype os_type: str + :ivar start_time: Start time of the software update configuration run. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of the software update configuration run. + :vartype end_time: ~datetime.datetime + :ivar computer_count: Number of computers in the software update configuration run. + :vartype computer_count: int + :ivar failed_count: Number of computers with failed status. + :vartype failed_count: int + :ivar creation_time: Creation time of the resource, which only appears in the response. + :vartype creation_time: ~datetime.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.datetime + :ivar last_modified_by: LastModifiedBy property, which only appears in the response. + :vartype last_modified_by: str + :param tasks: Software update configuration tasks triggered in this run. + :type tasks: ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTasks + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'status': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'os_type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'computer_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'computer_count': {'key': 'properties.computerCount', 'type': 'int'}, + 'failed_count': {'key': 'properties.failedCount', 'type': 'int'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'tasks': {'key': 'properties.tasks', 'type': 'SoftareUpdateConfigurationRunTasks'}, + } + + def __init__( + self, + *, + software_update_configuration: Optional["UpdateConfigurationNavigation"] = None, + tasks: Optional["SoftareUpdateConfigurationRunTasks"] = None, + **kwargs + ): + super(SoftwareUpdateConfigurationRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.software_update_configuration = software_update_configuration + self.status = None + self.configured_duration = None + self.os_type = None + self.start_time = None + self.end_time = None + self.computer_count = None + self.failed_count = None + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.tasks = tasks + + +class SoftwareUpdateConfigurationRunListResult(msrest.serialization.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: Optional[List["SoftwareUpdateConfigurationRun"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SoftwareUpdateConfigurationRunListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SourceControl(ProxyResource): + """Definition of the source control. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as empty string for + VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, GitHub. Possible values + include: "VsoGit", "VsoTfvc", "GitHub". + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param description: The description. + :type description: str + :param creation_time: The creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: The last modified time. + :type last_modified_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + repo_url: Optional[str] = None, + branch: Optional[str] = None, + folder_path: Optional[str] = None, + auto_sync: Optional[bool] = None, + publish_runbook: Optional[bool] = None, + source_type: Optional[Union[str, "SourceType"]] = None, + description: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(SourceControl, self).__init__(**kwargs) + self.repo_url = repo_url + self.branch = branch + self.folder_path = folder_path + self.auto_sync = auto_sync + self.publish_runbook = publish_runbook + self.source_type = source_type + self.description = description + self.creation_time = creation_time + self.last_modified_time = last_modified_time + + +class SourceControlCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update source control operation. + + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as empty string for + VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. Path must be relative. + :type folder_path: str + :param auto_sync: The auto async of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. + Possible values include: "VsoGit", "VsoTfvc", "GitHub". + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param security_token: The authorization token for the repo of the source control. + :type security_token: ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + """ + + _validation = { + 'repo_url': {'max_length': 2000, 'min_length': 0}, + 'branch': {'max_length': 255, 'min_length': 0}, + 'folder_path': {'max_length': 255, 'min_length': 0}, + 'description': {'max_length': 512, 'min_length': 0}, + } + + _attribute_map = { + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'SourceControlSecurityTokenProperties'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + repo_url: Optional[str] = None, + branch: Optional[str] = None, + folder_path: Optional[str] = None, + auto_sync: Optional[bool] = None, + publish_runbook: Optional[bool] = None, + source_type: Optional[Union[str, "SourceType"]] = None, + security_token: Optional["SourceControlSecurityTokenProperties"] = None, + description: Optional[str] = None, + **kwargs + ): + super(SourceControlCreateOrUpdateParameters, self).__init__(**kwargs) + self.repo_url = repo_url + self.branch = branch + self.folder_path = folder_path + self.auto_sync = auto_sync + self.publish_runbook = publish_runbook + self.source_type = source_type + self.security_token = security_token + self.description = description + + +class SourceControlListResult(msrest.serialization.Model): + """The response model for the list source controls operation. + + :param value: The list of source controls. + :type value: list[~azure.mgmt.automation.models.SourceControl] + :param next_link: The next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControl]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SourceControl"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SourceControlListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SourceControlSecurityTokenProperties(msrest.serialization.Model): + """SourceControlSecurityTokenProperties. + + :param access_token: The access token. + :type access_token: str + :param refresh_token: The refresh token. + :type refresh_token: str + :param token_type: The token type. Must be either PersonalAccessToken or Oauth. Possible values + include: "PersonalAccessToken", "Oauth". + :type token_type: str or ~azure.mgmt.automation.models.TokenType + """ + + _validation = { + 'access_token': {'max_length': 1024, 'min_length': 0}, + 'refresh_token': {'max_length': 1024, 'min_length': 0}, + } + + _attribute_map = { + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + } + + def __init__( + self, + *, + access_token: Optional[str] = None, + refresh_token: Optional[str] = None, + token_type: Optional[Union[str, "TokenType"]] = None, + **kwargs + ): + super(SourceControlSecurityTokenProperties, self).__init__(**kwargs) + self.access_token = access_token + self.refresh_token = refresh_token + self.token_type = token_type + + +class SourceControlSyncJob(msrest.serialization.Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: ~datetime.datetime + :param provisioning_state: The provisioning state of the job. Possible values include: + "Completed", "Failed", "Running". + :type provisioning_state: str or ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: The start time of the job. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the job. + :vartype end_time: ~datetime.datetime + :param sync_type: The sync type. Possible values include: "PartialSync", "FullSync". + :type sync_type: str or ~azure.mgmt.automation.models.SyncType + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'sync_type': {'key': 'properties.syncType', 'type': 'str'}, + } + + def __init__( + self, + *, + source_control_sync_job_id: Optional[str] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + sync_type: Optional[Union[str, "SyncType"]] = None, + **kwargs + ): + super(SourceControlSyncJob, self).__init__(**kwargs) + self.name = None + self.type = None + self.id = None + self.source_control_sync_job_id = source_control_sync_job_id + self.creation_time = None + self.provisioning_state = provisioning_state + self.start_time = None + self.end_time = None + self.sync_type = sync_type + + +class SourceControlSyncJobById(msrest.serialization.Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The id of the job. + :type id: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: ~datetime.datetime + :param provisioning_state: The provisioning state of the job. Possible values include: + "Completed", "Failed", "Running". + :type provisioning_state: str or ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: The start time of the job. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the job. + :vartype end_time: ~datetime.datetime + :param sync_type: The sync type. Possible values include: "PartialSync", "FullSync". + :type sync_type: str or ~azure.mgmt.automation.models.SyncType + :param exception: The exceptions that occurred while running the sync job. + :type exception: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'sync_type': {'key': 'properties.syncType', 'type': 'str'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + source_control_sync_job_id: Optional[str] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + sync_type: Optional[Union[str, "SyncType"]] = None, + exception: Optional[str] = None, + **kwargs + ): + super(SourceControlSyncJobById, self).__init__(**kwargs) + self.id = id + self.source_control_sync_job_id = source_control_sync_job_id + self.creation_time = None + self.provisioning_state = provisioning_state + self.start_time = None + self.end_time = None + self.sync_type = sync_type + self.exception = exception + + +class SourceControlSyncJobCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create source control sync job operation. + + All required parameters must be populated in order to send to Azure. + + :param commit_id: Required. The commit id of the source control sync job. If not syncing to a + commitId, enter an empty string. + :type commit_id: str + """ + + _validation = { + 'commit_id': {'required': True}, + } + + _attribute_map = { + 'commit_id': {'key': 'properties.commitId', 'type': 'str'}, + } + + def __init__( + self, + *, + commit_id: str, + **kwargs + ): + super(SourceControlSyncJobCreateParameters, self).__init__(**kwargs) + self.commit_id = commit_id + + +class SourceControlSyncJobListResult(msrest.serialization.Model): + """The response model for the list source control sync jobs operation. + + :param value: The list of source control sync jobs. + :type value: list[~azure.mgmt.automation.models.SourceControlSyncJob] + :param next_link: The next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlSyncJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SourceControlSyncJob"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SourceControlSyncJobListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SourceControlSyncJobStream(msrest.serialization.Model): + """Definition of the source control sync job stream. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_stream_id: The sync job stream id. + :type source_control_sync_job_stream_id: str + :param summary: The summary of the sync job stream. + :type summary: str + :ivar time: The time of the sync job stream. + :vartype time: ~datetime.datetime + :param stream_type: The type of the sync job stream. Possible values include: "Error", + "Output". + :type stream_type: str or ~azure.mgmt.automation.models.StreamType + """ + + _validation = { + 'id': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_stream_id': {'key': 'properties.sourceControlSyncJobStreamId', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + } + + def __init__( + self, + *, + source_control_sync_job_stream_id: Optional[str] = None, + summary: Optional[str] = None, + stream_type: Optional[Union[str, "StreamType"]] = None, + **kwargs + ): + super(SourceControlSyncJobStream, self).__init__(**kwargs) + self.id = None + self.source_control_sync_job_stream_id = source_control_sync_job_stream_id + self.summary = summary + self.time = None + self.stream_type = stream_type + + +class SourceControlSyncJobStreamById(msrest.serialization.Model): + """Definition of the source control sync job stream by id. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_stream_id: The sync job stream id. + :type source_control_sync_job_stream_id: str + :param summary: The summary of the sync job stream. + :type summary: str + :ivar time: The time of the sync job stream. + :vartype time: ~datetime.datetime + :param stream_type: The type of the sync job stream. Possible values include: "Error", + "Output". + :type stream_type: str or ~azure.mgmt.automation.models.StreamType + :param stream_text: The text of the sync job stream. + :type stream_text: str + :param value: The values of the job stream. + :type value: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_stream_id': {'key': 'properties.sourceControlSyncJobStreamId', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + 'stream_text': {'key': 'properties.streamText', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '{object}'}, + } + + def __init__( + self, + *, + source_control_sync_job_stream_id: Optional[str] = None, + summary: Optional[str] = None, + stream_type: Optional[Union[str, "StreamType"]] = None, + stream_text: Optional[str] = None, + value: Optional[Dict[str, object]] = None, + **kwargs + ): + super(SourceControlSyncJobStreamById, self).__init__(**kwargs) + self.id = None + self.source_control_sync_job_stream_id = source_control_sync_job_stream_id + self.summary = summary + self.time = None + self.stream_type = stream_type + self.stream_text = stream_text + self.value = value + + +class SourceControlSyncJobStreamsListBySyncJob(msrest.serialization.Model): + """The response model for the list source control sync job streams operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of source control sync job streams. + :type value: list[~azure.mgmt.automation.models.SourceControlSyncJobStream] + :ivar next_link: The next link. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlSyncJobStream]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SourceControlSyncJobStream"]] = None, + **kwargs + ): + super(SourceControlSyncJobStreamsListBySyncJob, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SourceControlUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update source control operation. + + :param branch: The repo branch of the source control. + :type branch: str + :param folder_path: The folder path of the source control. Path must be relative. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param security_token: The authorization token for the repo of the source control. + :type security_token: ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + """ + + _attribute_map = { + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'SourceControlSecurityTokenProperties'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + branch: Optional[str] = None, + folder_path: Optional[str] = None, + auto_sync: Optional[bool] = None, + publish_runbook: Optional[bool] = None, + security_token: Optional["SourceControlSecurityTokenProperties"] = None, + description: Optional[str] = None, + **kwargs + ): + super(SourceControlUpdateParameters, self).__init__(**kwargs) + self.branch = branch + self.folder_path = folder_path + self.auto_sync = auto_sync + self.publish_runbook = publish_runbook + self.security_token = security_token + self.description = description + + +class Statistics(msrest.serialization.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.datetime + :ivar end_time: Gets the endTime of the statistic. + :vartype end_time: ~datetime.datetime + :ivar id: Gets the id. + :vartype id: str + """ + + _validation = { + 'counter_property': {'readonly': True}, + 'counter_value': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'counter_property': {'key': 'counterProperty', 'type': 'str'}, + 'counter_value': {'key': 'counterValue', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Statistics, self).__init__(**kwargs) + self.counter_property = None + self.counter_value = None + self.start_time = None + self.end_time = None + self.id = None + + +class StatisticsListResult(msrest.serialization.Model): + """The response model for the list statistics operation. + + :param value: Gets or sets a list of statistics. + :type value: list[~azure.mgmt.automation.models.Statistics] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Statistics]'}, + } + + def __init__( + self, + *, + value: Optional[List["Statistics"]] = None, + **kwargs + ): + super(StatisticsListResult, self).__init__(**kwargs) + self.value = value + + +class TagSettingsProperties(msrest.serialization.Model): + """Tag filter information for the VM. + + :param tags: A set of tags. Dictionary of tags with its list of values. + :type tags: dict[str, list[str]] + :param filter_operator: Filter VMs by Any or All specified tags. Possible values include: + "All", "Any". + :type filter_operator: str or ~azure.mgmt.automation.models.TagOperators + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{[str]}'}, + 'filter_operator': {'key': 'filterOperator', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, List[str]]] = None, + filter_operator: Optional[Union[str, "TagOperators"]] = None, + **kwargs + ): + super(TagSettingsProperties, self).__init__(**kwargs) + self.tags = tags + self.filter_operator = filter_operator + + +class TestJob(msrest.serialization.Model): + """Definition of the test job. + + :param creation_time: Gets or sets the creation time of the test job. + :type creation_time: ~datetime.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.datetime + :param end_time: Gets or sets the end time of the test job. + :type end_time: ~datetime.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.datetime + :param last_status_modified_time: Gets or sets the last status modified time of the test job. + :type last_status_modified_time: ~datetime.datetime + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param log_activity_trace: The activity-level tracing options of the runbook. + :type log_activity_trace: int + """ + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_details': {'key': 'statusDetails', 'type': 'str'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'exception', 'type': 'str'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__( + self, + *, + creation_time: Optional[datetime.datetime] = None, + status: Optional[str] = None, + status_details: Optional[str] = None, + run_on: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + exception: Optional[str] = None, + last_modified_time: Optional[datetime.datetime] = None, + last_status_modified_time: Optional[datetime.datetime] = None, + parameters: Optional[Dict[str, str]] = None, + log_activity_trace: Optional[int] = None, + **kwargs + ): + super(TestJob, self).__init__(**kwargs) + self.creation_time = creation_time + self.status = status + self.status_details = status_details + self.run_on = run_on + self.start_time = start_time + self.end_time = end_time + self.exception = exception + self.last_modified_time = last_modified_time + self.last_status_modified_time = last_status_modified_time + self.parameters = parameters + self.log_activity_trace = log_activity_trace + + +class TestJobCreateParameters(msrest.serialization.Model): + """The parameters supplied to the create test job operation. + + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + } + + def __init__( + self, + *, + parameters: Optional[Dict[str, str]] = None, + run_on: Optional[str] = None, + **kwargs + ): + super(TestJobCreateParameters, self).__init__(**kwargs) + self.parameters = parameters + self.run_on = run_on + + +class TypeField(msrest.serialization.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: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + super(TypeField, self).__init__(**kwargs) + self.name = name + self.type = type + + +class TypeFieldListResult(msrest.serialization.Model): + """The response model for the list fields operation. + + :param value: Gets or sets a list of fields. + :type value: list[~azure.mgmt.automation.models.TypeField] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TypeField]'}, + } + + def __init__( + self, + *, + value: Optional[List["TypeField"]] = None, + **kwargs + ): + super(TypeFieldListResult, self).__init__(**kwargs) + self.value = value + + +class UpdateConfigurationNavigation(msrest.serialization.Model): + """Software update configuration Run Navigation model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the software update configuration triggered the software update + configuration run. + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateConfigurationNavigation, self).__init__(**kwargs) + self.name = None + + +class Usage(msrest.serialization.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: Optional[str] = None, + name: Optional["UsageCounterName"] = None, + unit: Optional[str] = None, + current_value: Optional[float] = None, + limit: Optional[int] = None, + throttle_status: Optional[str] = None, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = id + self.name = name + self.unit = unit + self.current_value = current_value + self.limit = limit + self.throttle_status = throttle_status + + +class UsageCounterName(msrest.serialization.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: Optional[str] = None, + localized_value: Optional[str] = None, + **kwargs + ): + super(UsageCounterName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class UsageListResult(msrest.serialization.Model): + """The response model for the get usage operation. + + :param value: Gets or sets usage. + :type value: list[~azure.mgmt.automation.models.Usage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__( + self, + *, + value: Optional[List["Usage"]] = None, + **kwargs + ): + super(UsageListResult, self).__init__(**kwargs) + self.value = value + + +class Variable(ProxyResource): + """Definition of the variable. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param value: Gets or sets the value of the variable. + :type value: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + is_encrypted: Optional[bool] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + description: Optional[str] = None, + **kwargs + ): + super(Variable, self).__init__(**kwargs) + self.value = value + self.is_encrypted = is_encrypted + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + + +class VariableCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update variable operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + value: Optional[str] = None, + description: Optional[str] = None, + is_encrypted: Optional[bool] = None, + **kwargs + ): + super(VariableCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.value = value + self.description = description + self.is_encrypted = is_encrypted + + +class VariableListResult(msrest.serialization.Model): + """The response model for the list variables operation. + + :param value: Gets or sets a list of variables. + :type value: list[~azure.mgmt.automation.models.Variable] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Variable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Variable"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(VariableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VariableUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the update variable operation. + + :param name: Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(VariableUpdateParameters, self).__init__(**kwargs) + self.name = name + self.value = value + self.description = description + + +class Watcher(TrackedResource): + """Definition of the watcher type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which the watcher is + invoked. + :type execution_frequency_in_seconds: long + :param script_name: Gets or sets the name of the script the watcher is attached to, i.e. the + name of an existing runbook. + :type script_name: str + :param script_parameters: Gets or sets the parameters of the script. + :type script_parameters: dict[str, str] + :param script_run_on: Gets or sets the name of the hybrid worker group the watcher will run on. + :type script_run_on: str + :ivar status: Gets the current status of the watcher. + :vartype status: str + :ivar creation_time: Gets or sets the creation time. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets or sets the last modified time. + :vartype last_modified_time: ~datetime.datetime + :ivar last_modified_by: Details of the user who last modified the watcher. + :vartype last_modified_by: str + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'execution_frequency_in_seconds': {'key': 'properties.executionFrequencyInSeconds', 'type': 'long'}, + 'script_name': {'key': 'properties.scriptName', 'type': 'str'}, + 'script_parameters': {'key': 'properties.scriptParameters', 'type': '{str}'}, + 'script_run_on': {'key': 'properties.scriptRunOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + etag: Optional[str] = None, + execution_frequency_in_seconds: Optional[int] = None, + script_name: Optional[str] = None, + script_parameters: Optional[Dict[str, str]] = None, + script_run_on: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(Watcher, self).__init__(tags=tags, location=location, **kwargs) + self.etag = etag + self.execution_frequency_in_seconds = execution_frequency_in_seconds + self.script_name = script_name + self.script_parameters = script_parameters + self.script_run_on = script_run_on + self.status = None + self.creation_time = None + self.last_modified_time = None + self.last_modified_by = None + self.description = description + + +class WatcherListResult(msrest.serialization.Model): + """The response model for the list watcher operation. + + :param value: Gets or sets a list of watchers. + :type value: list[~azure.mgmt.automation.models.Watcher] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Watcher]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Watcher"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(WatcherListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WatcherUpdateParameters(msrest.serialization.Model): + """WatcherUpdateParameters. + + :param name: Gets or sets the name of the resource. + :type name: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which the watcher is + invoked. + :type execution_frequency_in_seconds: long + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'execution_frequency_in_seconds': {'key': 'properties.executionFrequencyInSeconds', 'type': 'long'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + execution_frequency_in_seconds: Optional[int] = None, + **kwargs + ): + super(WatcherUpdateParameters, self).__init__(**kwargs) + self.name = name + self.execution_frequency_in_seconds = execution_frequency_in_seconds + + +class Webhook(ProxyResource): + """Definition of the webhook type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param is_enabled: Gets or sets the value of the enabled flag of the webhook. + :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.datetime + :param last_invoked_time: Gets or sets the last invoked time. + :type last_invoked_time: ~datetime.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.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param last_modified_by: Details of the user who last modified the Webhook. + :type last_modified_by: str + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'last_invoked_time': {'key': 'properties.lastInvokedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + is_enabled: Optional[bool] = False, + uri: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + last_invoked_time: Optional[datetime.datetime] = None, + parameters: Optional[Dict[str, str]] = None, + runbook: Optional["RunbookAssociationProperty"] = None, + run_on: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + last_modified_time: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(Webhook, self).__init__(**kwargs) + self.is_enabled = is_enabled + self.uri = uri + self.expiry_time = expiry_time + self.last_invoked_time = last_invoked_time + self.parameters = parameters + self.runbook = runbook + self.run_on = run_on + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.last_modified_by = last_modified_by + self.description = description + + +class WebhookCreateOrUpdateParameters(msrest.serialization.Model): + """The parameters supplied to the create or update webhook operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param uri: Gets or sets the uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: ~datetime.datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the webhook job will run on. + :type run_on: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + is_enabled: Optional[bool] = None, + uri: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + parameters: Optional[Dict[str, str]] = None, + runbook: Optional["RunbookAssociationProperty"] = None, + run_on: Optional[str] = None, + **kwargs + ): + super(WebhookCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.is_enabled = is_enabled + self.uri = uri + self.expiry_time = expiry_time + self.parameters = parameters + self.runbook = runbook + self.run_on = run_on + + +class WebhookListResult(msrest.serialization.Model): + """The response model for the list webhook operation. + + :param value: Gets or sets a list of webhooks. + :type value: list[~azure.mgmt.automation.models.Webhook] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Webhook]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Webhook"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(WebhookListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WebhookUpdateParameters(msrest.serialization.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: Optional[str] = None, + is_enabled: Optional[bool] = None, + run_on: Optional[str] = None, + parameters: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + **kwargs + ): + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.name = name + self.is_enabled = is_enabled + self.run_on = run_on + self.parameters = parameters + self.description = description + + +class WindowsProperties(msrest.serialization.Model): + """Windows specific update configuration. + + :param included_update_classifications: Update classification included in the software update + configuration. A comma separated string with required values. Possible values include: + "Unclassified", "Critical", "Security", "UpdateRollup", "FeaturePack", "ServicePack", + "Definition", "Tools", "Updates". + :type included_update_classifications: str or + ~azure.mgmt.automation.models.WindowsUpdateClasses + :param excluded_kb_numbers: KB numbers excluded from the software update configuration. + :type excluded_kb_numbers: list[str] + :param included_kb_numbers: KB numbers included from the software update configuration. + :type included_kb_numbers: list[str] + :param reboot_setting: Reboot setting for the software update configuration. + :type reboot_setting: str + """ + + _attribute_map = { + 'included_update_classifications': {'key': 'includedUpdateClassifications', 'type': 'str'}, + 'excluded_kb_numbers': {'key': 'excludedKbNumbers', 'type': '[str]'}, + 'included_kb_numbers': {'key': 'includedKbNumbers', 'type': '[str]'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + } + + def __init__( + self, + *, + included_update_classifications: Optional[Union[str, "WindowsUpdateClasses"]] = None, + excluded_kb_numbers: Optional[List[str]] = None, + included_kb_numbers: Optional[List[str]] = None, + reboot_setting: Optional[str] = None, + **kwargs + ): + super(WindowsProperties, self).__init__(**kwargs) + self.included_update_classifications = included_update_classifications + self.excluded_kb_numbers = excluded_kb_numbers + self.included_kb_numbers = included_kb_numbers + self.reboot_setting = reboot_setting diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/__init__.py b/src/automation/azext_automation/vendored_sdks/automation/operations/__init__.py new file mode 100644 index 00000000000..2b7ced13e02 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/__init__.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 ._automation_account_operations import AutomationAccountOperations +from ._operation_operations import OperationOperations +from ._statistics_operations import StatisticsOperations +from ._usage_operations import UsageOperations +from ._key_operations import KeyOperations +from ._certificate_operations import CertificateOperations +from ._connection_operations import ConnectionOperations +from ._connection_type_operations import ConnectionTypeOperations +from ._credential_operations import CredentialOperations +from ._dsc_configuration_operations import DscConfigurationOperations +from ._hybrid_runbook_worker_group_operations import HybridRunbookWorkerGroupOperations +from ._job_schedule_operations import JobScheduleOperations +from ._linked_workspace_operations import LinkedWorkspaceOperations +from ._activity_operations import ActivityOperations +from ._module_operations import ModuleOperations +from ._object_data_type_operations import ObjectDataTypeOperations +from ._field_operations import FieldOperations +from ._schedule_operations import ScheduleOperations +from ._variable_operations import VariableOperations +from ._webhook_operations import WebhookOperations +from ._watcher_operations import WatcherOperations +from ._software_update_configuration_operations import SoftwareUpdateConfigurationOperations +from ._software_update_configuration_run_operations import SoftwareUpdateConfigurationRunOperations +from ._software_update_configuration_machine_run_operations import SoftwareUpdateConfigurationMachineRunOperations +from ._source_control_operations import SourceControlOperations +from ._source_control_sync_job_operations import SourceControlSyncJobOperations +from ._source_control_sync_job_stream_operations import SourceControlSyncJobStreamOperations +from ._job_operations import JobOperations +from ._job_stream_operations import JobStreamOperations +from ._agent_registration_information_operations import AgentRegistrationInformationOperations +from ._dsc_node_operations import DscNodeOperations +from ._node_report_operations import NodeReportOperations +from ._dsc_compilation_job_operations import DscCompilationJobOperations +from ._dsc_compilation_job_stream_operations import DscCompilationJobStreamOperations +from ._dsc_node_configuration_operations import DscNodeConfigurationOperations +from ._node_count_information_operations import NodeCountInformationOperations +from ._runbook_draft_operations import RunbookDraftOperations +from ._runbook_operations import RunbookOperations +from ._test_job_stream_operations import TestJobStreamOperations +from ._test_job_operations import TestJobOperations +from ._python2_package_operations import Python2PackageOperations + +__all__ = [ + 'AutomationAccountOperations', + 'OperationOperations', + 'StatisticsOperations', + 'UsageOperations', + 'KeyOperations', + 'CertificateOperations', + 'ConnectionOperations', + 'ConnectionTypeOperations', + 'CredentialOperations', + 'DscConfigurationOperations', + 'HybridRunbookWorkerGroupOperations', + 'JobScheduleOperations', + 'LinkedWorkspaceOperations', + 'ActivityOperations', + 'ModuleOperations', + 'ObjectDataTypeOperations', + 'FieldOperations', + 'ScheduleOperations', + 'VariableOperations', + 'WebhookOperations', + 'WatcherOperations', + 'SoftwareUpdateConfigurationOperations', + 'SoftwareUpdateConfigurationRunOperations', + 'SoftwareUpdateConfigurationMachineRunOperations', + 'SourceControlOperations', + 'SourceControlSyncJobOperations', + 'SourceControlSyncJobStreamOperations', + 'JobOperations', + 'JobStreamOperations', + 'AgentRegistrationInformationOperations', + 'DscNodeOperations', + 'NodeReportOperations', + 'DscCompilationJobOperations', + 'DscCompilationJobStreamOperations', + 'DscNodeConfigurationOperations', + 'NodeCountInformationOperations', + 'RunbookDraftOperations', + 'RunbookOperations', + 'TestJobStreamOperations', + 'TestJobOperations', + 'Python2PackageOperations', +] diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_activity_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_activity_operations.py new file mode 100644 index 00000000000..6314c6e388e --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_activity_operations.py @@ -0,0 +1,187 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ActivityOperations(object): + """ActivityOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + module_name, # type: str + activity_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Activity" + """Retrieve the activity in the module identified by module name and activity name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param activity_name: The name of activity. + :type activity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Activity or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Activity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Activity"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'activityName': self._serialize.url("activity_name", activity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Activity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}'} + + def list_by_module( + self, + resource_group_name, # type: str + automation_account_name, # type: str + module_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ActivityListResult" + """Retrieve a list of activities in the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ActivityListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ActivityListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_module.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ActivityListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_agent_registration_information_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_agent_registration_information_operations.py new file mode 100644 index 00000000000..522f3d4bb6a --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_agent_registration_information_operations.py @@ -0,0 +1,170 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AgentRegistrationInformationOperations(object): + """AgentRegistrationInformationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentRegistration" + """Retrieve the automation agent registration information. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentRegistration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AgentRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentRegistration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation'} + + def regenerate_key( + self, + resource_group_name, # type: str + automation_account_name, # type: str + key_name, # type: Union[str, "models.AgentRegistrationKeyName"] + **kwargs # type: Any + ): + # type: (...) -> "models.AgentRegistration" + """Regenerate a primary or secondary agent registration key. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param key_name: Gets or sets the agent registration key name - primary or secondary. + :type key_name: str or ~azure.mgmt.automation.models.AgentRegistrationKeyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentRegistration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AgentRegistration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentRegistration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.AgentRegistrationRegenerateKeyParameter(key_name=key_name) + api_version = "2018-01-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'AgentRegistrationRegenerateKeyParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentRegistration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_automation_account_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_automation_account_operations.py new file mode 100644 index 00000000000..41bc6c04164 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_automation_account_operations.py @@ -0,0 +1,449 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AutomationAccountOperations(object): + """AutomationAccountOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + name=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + **kwargs # type: Any + ): + # type: (...) -> "models.AutomationAccount" + """Update an automation account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param 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] + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccount or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.AutomationAccountUpdateParameters(name=name, location=location, tags=tags, sku=sku) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'AutomationAccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutomationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + name=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + **kwargs # type: Any + ): + # type: (...) -> "models.AutomationAccount" + """Create or update automation account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param 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] + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccount or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccount or ~azure.mgmt.automation.models.AutomationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.AutomationAccountCreateOrUpdateParameters(name=name, location=location, tags=tags, sku=sku) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'AutomationAccountCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AutomationAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AutomationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an automation account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AutomationAccount" + """Get information about an Automation Account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccount or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutomationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AutomationAccountListResult" + """Retrieve a list of accounts within a given resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccountListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccountListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccountListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AutomationAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts'} + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.AutomationAccountListResult" + """Retrieve a list of accounts within a given subscription. + + Lists the Automation Accounts within an Azure subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutomationAccountListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.AutomationAccountListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutomationAccountListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AutomationAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_certificate_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_certificate_operations.py new file mode 100644 index 00000000000..f36e8a316d1 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_certificate_operations.py @@ -0,0 +1,400 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificateOperations(object): + """CertificateOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The name of certificate. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Certificate" + """Retrieve the certificate identified by certificate name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The name of certificate. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Certificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + certificate_name, # type: str + name, # type: str + base64_value, # type: str + description=None, # type: Optional[str] + thumbprint=None, # type: Optional[str] + is_exportable=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "models.Certificate" + """Create a certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The parameters supplied to the create or update certificate operation. + :type certificate_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Certificate or ~azure.mgmt.automation.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Certificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.CertificateCreateOrUpdateParameters(name=name, base64_value=base64_value, description=description, thumbprint=thumbprint, is_exportable=is_exportable) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'CertificateCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Certificate', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + certificate_name, # type: str + name=None, # type: Optional[str] + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Certificate" + """Update a certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The parameters supplied to the update certificate operation. + :type certificate_name: str + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Certificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.CertificateUpdateParameters(name=name, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'CertificateUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.CertificateListResult" + """Retrieve a list of certificates. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.CertificateListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_connection_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_connection_operations.py new file mode 100644 index 00000000000..4c539479ce6 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_connection_operations.py @@ -0,0 +1,406 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ConnectionOperations(object): + """ConnectionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Connection" + """Delete the connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The name of connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Connection or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Connection or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Connection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Connection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Connection" + """Retrieve the connection identified by connection name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The name of connection. + :type connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Connection or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Connection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Connection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Connection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + connection_name, # type: str + name, # type: str + connection_type, # type: "models.ConnectionTypeAssociationProperty" + description=None, # type: Optional[str] + field_definition_values=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.Connection" + """Create or update a connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The parameters supplied to the create or update connection operation. + :type connection_name: str + :param name: Gets or sets the name of the connection. + :type name: str + :param connection_type: Gets or sets the connectionType of the connection. + :type connection_type: ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :param description: Gets or sets the description of the connection. + :type description: str + :param field_definition_values: Gets or sets the field definition properties of the connection. + :type field_definition_values: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Connection or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Connection or ~azure.mgmt.automation.models.Connection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Connection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ConnectionCreateOrUpdateParameters(name=name, description=description, connection_type=connection_type, field_definition_values=field_definition_values) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ConnectionCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Connection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Connection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + connection_name, # type: str + name=None, # type: Optional[str] + description=None, # type: Optional[str] + field_definition_values=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.Connection" + """Update a connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The parameters supplied to the update a connection operation. + :type connection_name: str + :param 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] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Connection or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Connection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Connection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ConnectionUpdateParameters(name=name, description=description, field_definition_values=field_definition_values) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ConnectionUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Connection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ConnectionListResult" + """Retrieve a list of connections. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_connection_type_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_connection_type_operations.py new file mode 100644 index 00000000000..91175d6d029 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_connection_type_operations.py @@ -0,0 +1,320 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ConnectionTypeOperations(object): + """ConnectionTypeOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + connection_type_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the connection type. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_type_name: The name of connection type. + :type connection_type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + connection_type_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ConnectionType" + """Retrieve the connection type identified by connection type name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_type_name: The name of connection type. + :type connection_type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionType or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ConnectionType + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionType"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionType', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + connection_type_name, # type: str + name, # type: str + field_definitions, # type: Dict[str, "FieldDefinition"] + is_global=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "models.ConnectionType" + """Create a connection type. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_type_name: The parameters supplied to the create or update connection type + operation. + :type connection_type_name: str + :param name: Gets or sets the name of the connection type. + :type name: str + :param field_definitions: Gets or sets the field definitions of the connection type. + :type field_definitions: dict[str, ~azure.mgmt.automation.models.FieldDefinition] + :param is_global: Gets or sets a Boolean value to indicate if the connection type is global. + :type is_global: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionType or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ConnectionType or ~azure.mgmt.automation.models.ConnectionType + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionType"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ConnectionTypeCreateOrUpdateParameters(name=name, is_global=is_global, field_definitions=field_definitions) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ConnectionTypeCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('ConnectionType', pipeline_response) + + if response.status_code == 409: + deserialized = self._deserialize('ConnectionType', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ConnectionTypeListResult" + """Retrieve a list of connection types. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionTypeListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ConnectionTypeListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionTypeListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ConnectionTypeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_credential_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_credential_operations.py new file mode 100644 index 00000000000..861d36b0d6f --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_credential_operations.py @@ -0,0 +1,402 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CredentialOperations(object): + """CredentialOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + credential_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The name of credential. + :type credential_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + credential_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Credential" + """Retrieve the credential identified by credential name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The name of credential. + :type credential_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Credential or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Credential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Credential"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Credential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + credential_name, # type: str + name, # type: str + user_name, # type: str + password, # type: str + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Credential" + """Create a credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The parameters supplied to the create or update credential operation. + :type credential_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Credential or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Credential or ~azure.mgmt.automation.models.Credential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Credential"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.CredentialCreateOrUpdateParameters(name=name, user_name=user_name, password=password, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'CredentialCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Credential', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Credential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + credential_name, # type: str + name=None, # type: Optional[str] + user_name=None, # type: Optional[str] + password=None, # type: Optional[str] + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Credential" + """Update a credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The parameters supplied to the Update credential operation. + :type credential_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Credential or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Credential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Credential"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.CredentialUpdateParameters(name=name, user_name=user_name, password=password, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'CredentialUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Credential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.CredentialListResult" + """Retrieve a list of credentials. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.CredentialListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CredentialListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CredentialListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_compilation_job_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_compilation_job_operations.py new file mode 100644 index 00000000000..5448fefb8b3 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_compilation_job_operations.py @@ -0,0 +1,390 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DscCompilationJobOperations(object): + """DscCompilationJobOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + automation_account_name, # type: str + compilation_job_name, # type: str + configuration, # type: "models.DscConfigurationAssociationProperty" + name=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + parameters=None, # type: Optional[Dict[str, str]] + increment_node_configuration_build=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "models.DscCompilationJob" + cls = kwargs.pop('cls', None) # type: ClsType["models.DscCompilationJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DscCompilationJobCreateParameters(name=name, location=location, tags=tags, configuration=configuration, parameters=parameters, increment_node_configuration_build=increment_node_configuration_build) + api_version = "2018-01-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobName': self._serialize.url("compilation_job_name", compilation_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DscCompilationJobCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscCompilationJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + def begin_create( + self, + resource_group_name, # type: str + automation_account_name, # type: str + compilation_job_name, # type: str + configuration, # type: "models.DscConfigurationAssociationProperty" + name=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + parameters=None, # type: Optional[Dict[str, str]] + increment_node_configuration_build=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "models.DscCompilationJob" + """Creates the Dsc compilation job of the configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param compilation_job_name: The DSC configuration Id. + :type compilation_job_name: str + :param configuration: Gets or sets the configuration. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :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] + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns DscCompilationJob + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.automation.models.DscCompilationJob] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DscCompilationJob"] + raw_result = self._create_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + compilation_job_name=compilation_job_name, + configuration=configuration, + name=name, + location=location, + tags=tags, + parameters=parameters, + increment_node_configuration_build=increment_node_configuration_build, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DscCompilationJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + compilation_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DscCompilationJob" + """Retrieve the Dsc configuration compilation job identified by job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param compilation_job_name: The DSC configuration Id. + :type compilation_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscCompilationJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscCompilationJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscCompilationJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobName': self._serialize.url("compilation_job_name", compilation_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscCompilationJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DscCompilationJobListResult" + """Retrieve a list of dsc compilation jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscCompilationJobListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscCompilationJobListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscCompilationJobListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DscCompilationJobListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs'} + + def get_stream( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_id, # type: str + job_stream_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.JobStream" + """Retrieve the job stream identified by job stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_id: The job id. + :type job_id: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStream or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStream + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStream"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get_stream.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobStream', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_stream.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_compilation_job_stream_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_compilation_job_stream_operations.py new file mode 100644 index 00000000000..9037eb05668 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_compilation_job_stream_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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DscCompilationJobStreamOperations(object): + """DscCompilationJobStreamOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_job( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.JobStreamListResult" + """Retrieve all the job streams for the compilation Job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_id: The job id. + :type job_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStreamListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStreamListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStreamListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobStreamListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_configuration_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_configuration_operations.py new file mode 100644 index 00000000000..38e9f2a37ba --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_configuration_operations.py @@ -0,0 +1,507 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DscConfigurationOperations(object): + """DscConfigurationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the dsc configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DscConfiguration" + """Retrieve the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + configuration_name, # type: str + source, # type: "models.ContentSource" + name=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + log_verbose=None, # type: Optional[bool] + log_progress=None, # type: Optional[bool] + parameters=None, # type: Optional[Dict[str, "DscConfigurationParameter"]] + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DscConfiguration" + """Create the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The create or update parameters for configuration. + :type configuration_name: str + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :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] + :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 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscConfiguration or ~azure.mgmt.automation.models.DscConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DscConfigurationCreateOrUpdateParameters(name=name, location=location, tags=tags, log_verbose=log_verbose, log_progress=log_progress, source=source, parameters=parameters, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DscConfigurationCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DscConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + configuration_name, # type: str + name=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + log_verbose=None, # type: Optional[bool] + log_progress=None, # type: Optional[bool] + source=None, # type: Optional["models.ContentSource"] + parameters=None, # type: Optional[Dict[str, "DscConfigurationParameter"]] + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DscConfiguration" + """Create the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The create or update parameters for configuration. + :type configuration_name: str + :param name: Gets or sets name of the resource. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DscConfigurationUpdateParameters(name=name, tags=tags, log_verbose=log_verbose, log_progress=log_progress, source=source, parameters=parameters, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + if _parameters is not None: + body_content = self._serialize.body(_parameters, 'DscConfigurationUpdateParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def get_content( + self, + resource_group_name, # type: str + automation_account_name, # type: str + configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Retrieve the configuration script identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'text/powershell' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + skip=None, # type: Optional[int] + top=None, # type: Optional[int] + inlinecount=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DscConfigurationListResult" + """Retrieve a list of configurations. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param skip: The number of rows to skip. + :type skip: int + :param top: The number of rows to take. + :type top: int + :param inlinecount: Return total rows. + :type inlinecount: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscConfigurationListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscConfigurationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscConfigurationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if inlinecount is not None: + query_parameters['$inlinecount'] = self._serialize.query("inlinecount", inlinecount, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DscConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_node_configuration_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_node_configuration_operations.py new file mode 100644 index 00000000000..5028209ccb5 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_node_configuration_operations.py @@ -0,0 +1,394 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DscNodeConfigurationOperations(object): + """DscNodeConfigurationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the Dsc node configurations by node configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DscNodeConfiguration" + """Retrieve the Dsc node configurations by node configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNodeConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + def _create_or_update_initial( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_configuration_name, # type: str + name=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + source=None, # type: Optional["models.ContentSource"] + configuration=None, # type: Optional["models.DscConfigurationAssociationProperty"] + increment_node_configuration_build=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "models.DscNodeConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DscNodeConfigurationCreateOrUpdateParameters(name=name, tags=tags, source=source, configuration=configuration, increment_node_configuration_build=increment_node_configuration_build) + api_version = "2018-01-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DscNodeConfigurationCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('DscNodeConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + def begin_create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_configuration_name, # type: str + name=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + source=None, # type: Optional["models.ContentSource"] + configuration=None, # type: Optional["models.DscConfigurationAssociationProperty"] + increment_node_configuration_build=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "models.DscNodeConfiguration" + """Create the node configuration identified by node configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :param name: Name of the node configuration. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param configuration: Gets or sets the configuration of the node. + :type configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param increment_node_configuration_build: If a new build version of NodeConfiguration is + required. + :type increment_node_configuration_build: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeConfiguration"] + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_configuration_name=node_configuration_name, + name=name, + tags=tags, + source=source, + configuration=configuration, + increment_node_configuration_build=increment_node_configuration_build, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DscNodeConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + skip=None, # type: Optional[int] + top=None, # type: Optional[int] + inlinecount=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DscNodeConfigurationListResult" + """Retrieve a list of dsc node configurations. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param skip: The number of rows to skip. + :type skip: int + :param top: The number of rows to take. + :type top: int + :param inlinecount: Return total rows. + :type inlinecount: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeConfigurationListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeConfigurationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeConfigurationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if inlinecount is not None: + query_parameters['$inlinecount'] = self._serialize.query("inlinecount", inlinecount, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DscNodeConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_node_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_node_operations.py new file mode 100644 index 00000000000..690467f184d --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_dsc_node_operations.py @@ -0,0 +1,335 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DscNodeOperations(object): + """DscNodeOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DscNode" + """Delete the dsc node identified by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The node id. + :type node_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNode or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNode"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DscNode" + """Retrieve the dsc node identified by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The node id. + :type node_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNode or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNode"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_id, # type: str + dsc_node_update_parameters_node_id=None, # type: Optional[str] + name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DscNode" + """Update the dsc node. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: Parameters supplied to the update dsc node. + :type node_id: str + :param dsc_node_update_parameters_node_id: Gets or sets the id of the dsc node. + :type dsc_node_update_parameters_node_id: str + :param name: Gets or sets the name of the dsc node configuration. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNode or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNode + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNode"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _dsc_node_update_parameters = models.DscNodeUpdateParameters(node_id=dsc_node_update_parameters_node_id, name=name) + api_version = "2018-01-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_dsc_node_update_parameters, 'DscNodeUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNode', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + skip=None, # type: Optional[int] + top=None, # type: Optional[int] + inlinecount=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DscNodeListResult" + """Retrieve a list of dsc nodes. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param skip: The number of rows to skip. + :type skip: int + :param top: The number of rows to take. + :type top: int + :param inlinecount: Return total rows. + :type inlinecount: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if inlinecount is not None: + query_parameters['$inlinecount'] = self._serialize.query("inlinecount", inlinecount, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DscNodeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_field_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_field_operations.py new file mode 100644 index 00000000000..949cc1bdf4b --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_field_operations.py @@ -0,0 +1,126 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class FieldOperations(object): + """FieldOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_type( + self, + resource_group_name, # type: str + automation_account_name, # type: str + module_name, # type: str + type_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.TypeFieldListResult" + """Retrieve a list of fields of a given type identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param type_name: The name of type. + :type type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TypeFieldListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TypeFieldListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TypeFieldListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TypeFieldListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_hybrid_runbook_worker_group_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_hybrid_runbook_worker_group_operations.py new file mode 100644 index 00000000000..6df93ae1f79 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_hybrid_runbook_worker_group_operations.py @@ -0,0 +1,313 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class HybridRunbookWorkerGroupOperations(object): + """HybridRunbookWorkerGroupOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + hybrid_runbook_worker_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. + :type hybrid_runbook_worker_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + hybrid_runbook_worker_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.HybridRunbookWorkerGroup" + """Retrieve a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. + :type hybrid_runbook_worker_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridRunbookWorkerGroup or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridRunbookWorkerGroup"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridRunbookWorkerGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + hybrid_runbook_worker_group_name, # type: str + credential=None, # type: Optional["models.RunAsCredentialAssociationProperty"] + **kwargs # type: Any + ): + # type: (...) -> "models.HybridRunbookWorkerGroup" + """Update a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. + :type hybrid_runbook_worker_group_name: str + :param credential: Sets the credential of a worker group. + :type credential: ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridRunbookWorkerGroup or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridRunbookWorkerGroup"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.HybridRunbookWorkerGroupUpdateParameters(credential=credential) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'HybridRunbookWorkerGroupUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridRunbookWorkerGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.HybridRunbookWorkerGroupsListResult" + """Retrieve a list of hybrid runbook worker groups. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridRunbookWorkerGroupsListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroupsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HybridRunbookWorkerGroupsListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HybridRunbookWorkerGroupsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_job_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_job_operations.py new file mode 100644 index 00000000000..4f47a4e6f86 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_job_operations.py @@ -0,0 +1,595 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, IO, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobOperations(object): + """JobOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_output( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_name, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> str + """Retrieve the job output identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The name of the job to be created. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_output.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'text/plain' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_output.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output'} + + def get_runbook_content( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_name, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> IO + """Retrieve the runbook content of the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_runbook_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_runbook_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent'} + + def suspend( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_name, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Suspend the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.suspend.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend'} + + def stop( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_name, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Stop the job identified by jobName. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_name, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Job" + """Retrieve the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Job or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Job"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Job', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'} + + def create( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_name, # type: str + client_request_id=None, # type: Optional[str] + runbook=None, # type: Optional["models.RunbookAssociationProperty"] + parameters=None, # type: Optional[Dict[str, str]] + run_on=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Job" + """Create a job of the runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Job or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Job + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Job"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.JobCreateParameters(runbook=runbook, parameters=parameters, run_on=run_on) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'JobCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Job', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.JobListResultV2" + """Retrieve a list of jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobListResultV2 or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobListResultV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobListResultV2"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('JobListResultV2', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs'} + + def resume( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_name, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Resume the job identified by jobName. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.resume.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_job_schedule_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_job_schedule_operations.py new file mode 100644 index 00000000000..5fb3b2c4eec --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_job_schedule_operations.py @@ -0,0 +1,322 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobScheduleOperations(object): + """JobScheduleOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_schedule_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the job schedule identified by job schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_schedule_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.JobSchedule" + """Retrieve the job schedule identified by job schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobSchedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobSchedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobSchedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def create( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_schedule_id, # type: str + schedule, # type: "models.ScheduleAssociationProperty" + runbook, # type: "models.RunbookAssociationProperty" + run_on=None, # type: Optional[str] + parameters=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.JobSchedule" + """Create a job schedule. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :param 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] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobSchedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobSchedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobSchedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.JobScheduleCreateParameters(schedule=schedule, runbook=runbook, run_on=run_on, parameters=parameters) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'JobScheduleCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobSchedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.JobScheduleListResult" + """Retrieve a list of job schedules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobScheduleListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobScheduleListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobScheduleListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('JobScheduleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_job_stream_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_job_stream_operations.py new file mode 100644 index 00000000000..357fe1f166a --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_job_stream_operations.py @@ -0,0 +1,202 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobStreamOperations(object): + """JobStreamOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_name, # type: str + job_stream_id, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.JobStream" + """Retrieve the job stream identified by job stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStream or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStream + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStream"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobStream', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}'} + + def list_by_job( + self, + resource_group_name, # type: str + automation_account_name, # type: str + job_name, # type: str + filter=None, # type: Optional[str] + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.JobStreamListResult" + """Retrieve a list of jobs streams identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStreamListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStreamListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStreamListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('JobStreamListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_key_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_key_operations.py new file mode 100644 index 00000000000..999bf6dee16 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_key_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class KeyOperations(object): + """KeyOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.KeyListResult" + """Retrieve the automation keys for an account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.KeyListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.KeyListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('KeyListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_linked_workspace_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_linked_workspace_operations.py new file mode 100644 index 00000000000..fd7f81fcf4e --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_linked_workspace_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LinkedWorkspaceOperations(object): + """LinkedWorkspaceOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.LinkedWorkspace" + """Retrieve the linked workspace for the account id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LinkedWorkspace or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.LinkedWorkspace + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LinkedWorkspace"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LinkedWorkspace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_module_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_module_operations.py new file mode 100644 index 00000000000..72119490907 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_module_operations.py @@ -0,0 +1,403 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ModuleOperations(object): + """ModuleOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + module_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the module by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The module name. + :type module_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + module_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Module" + """Retrieve the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The module name. + :type module_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + module_name, # type: str + content_link, # type: "models.ContentLink" + name=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.Module" + """Create or Update the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param 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] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module or ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ModuleCreateOrUpdateParameters(name=name, location=location, tags=tags, content_link=content_link) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ModuleCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + module_name, # type: str + name=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + content_link=None, # type: Optional["models.ContentLink"] + **kwargs # type: Any + ): + # type: (...) -> "models.Module" + """Update the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param 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] + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ModuleUpdateParameters(name=name, location=location, tags=tags, content_link=content_link) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ModuleUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ModuleListResult" + """Retrieve a list of modules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ModuleListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ModuleListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ModuleListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ModuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_node_count_information_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_node_count_information_operations.py new file mode 100644 index 00000000000..bf93a4fcc37 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_node_count_information_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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NodeCountInformationOperations(object): + """NodeCountInformationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + count_type, # type: Union[str, "models.CountType"] + **kwargs # type: Any + ): + # type: (...) -> "models.NodeCounts" + """Retrieve counts for Dsc Nodes. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param count_type: The type of counts to retrieve. + :type count_type: str or ~azure.mgmt.automation.models.CountType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NodeCounts or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.NodeCounts + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NodeCounts"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'countType': self._serialize.url("count_type", count_type, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NodeCounts', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodecounts/{countType}'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_node_report_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_node_report_operations.py new file mode 100644 index 00000000000..4c565258665 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_node_report_operations.py @@ -0,0 +1,257 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NodeReportOperations(object): + """NodeReportOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_node( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_id, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DscNodeReportListResult" + """Retrieve the Dsc node report list by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The parameters supplied to the list operation. + :type node_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeReportListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeReportListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeReportListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_node.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DscNodeReportListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_id, # type: str + report_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DscNodeReport" + """Retrieve the Dsc node report data by node id and report id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The Dsc node id. + :type node_id: str + :param report_id: The report id. + :type report_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DscNodeReport or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.DscNodeReport + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscNodeReport"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DscNodeReport', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}'} + + def get_content( + self, + resource_group_name, # type: str + automation_account_name, # type: str + node_id, # type: str + report_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> object + """Retrieve the Dsc node reports by node id and report id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The Dsc node id. + :type node_id: str + :param report_id: The report id. + :type report_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-01-15" + + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_object_data_type_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_object_data_type_operations.py new file mode 100644 index 00000000000..327c197950f --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_object_data_type_operations.py @@ -0,0 +1,202 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ObjectDataTypeOperations(object): + """ObjectDataTypeOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_field_by_module_and_type( + self, + resource_group_name, # type: str + automation_account_name, # type: str + module_name, # type: str + type_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.TypeFieldListResult" + """Retrieve a list of fields of a given type identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param type_name: The name of type. + :type type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TypeFieldListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TypeFieldListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TypeFieldListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_field_by_module_and_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TypeFieldListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_field_by_module_and_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields'} + + def list_field_by_type( + self, + resource_group_name, # type: str + automation_account_name, # type: str + type_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.TypeFieldListResult" + """Retrieve a list of fields of a given type across all accessible modules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param type_name: The name of type. + :type type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TypeFieldListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TypeFieldListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TypeFieldListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_field_by_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TypeFieldListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_field_by_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_operation_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_operation_operations.py new file mode 100644 index 00000000000..03197792b26 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_operation_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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.OperationListResult" + """Lists all of the available Automation REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.OperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Automation/operations'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_python2_package_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_python2_package_operations.py new file mode 100644 index 00000000000..ed32a894ce2 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_python2_package_operations.py @@ -0,0 +1,388 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Python2PackageOperations(object): + """Python2PackageOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + package_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the python 2 package by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The python package name. + :type package_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + package_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Module" + """Retrieve the python 2 package identified by package name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The python package name. + :type package_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + package_name, # type: str + content_link, # type: "models.ContentLink" + tags=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.Module" + """Create or Update the python 2 package identified by package name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The name of python package. + :type package_name: str + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module or ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.PythonPackageCreateParameters(tags=tags, content_link=content_link) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'PythonPackageCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + package_name, # type: str + tags=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.Module" + """Update the python 2 package identified by package name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The name of python package. + :type package_name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Module or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Module + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Module"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.PythonPackageUpdateParameters(tags=tags) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'PythonPackageUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Module', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ModuleListResult" + """Retrieve a list of python 2 packages. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ModuleListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ModuleListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ModuleListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ModuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_runbook_draft_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_runbook_draft_operations.py new file mode 100644 index 00000000000..fa41387df3c --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_runbook_draft_operations.py @@ -0,0 +1,346 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, IO, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RunbookDraftOperations(object): + """RunbookDraftOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_content( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Retrieve the content of runbook draft identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'text/powershell' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + def _replace_content_initial( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + runbook_content, # type: str + **kwargs # type: Any + ): + # type: (...) -> IO + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "text/powershell") + + # Construct URL + url = self._replace_content_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(runbook_content, 'str') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if response.status_code == 202: + response_headers['location']=self._deserialize('str', response.headers.get('location')) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _replace_content_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + def begin_replace_content( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + runbook_content, # type: str + **kwargs # type: Any + ): + # type: (...) -> IO + """Replaces the runbook draft content. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param runbook_content: The runbook draft content. + :type runbook_content: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns + :rtype: ~azure.core.polling.LROPoller[IO] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[IO] + raw_result = self._replace_content_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + runbook_content=runbook_content, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_replace_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RunbookDraft" + """Retrieve the runbook draft identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunbookDraft or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.RunbookDraft + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunbookDraft"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RunbookDraft', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft'} + + def undo_edit( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RunbookDraftUndoEditResult" + """Undo draft edit to last known published state identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunbookDraftUndoEditResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.RunbookDraftUndoEditResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunbookDraftUndoEditResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.undo_edit.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RunbookDraftUndoEditResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + undo_edit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_runbook_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_runbook_operations.py new file mode 100644 index 00000000000..51da4787fec --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_runbook_operations.py @@ -0,0 +1,588 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RunbookOperations(object): + """RunbookOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _publish_initial( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self._publish_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['location']=self._deserialize('str', response.headers.get('location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _publish_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/publish'} + + def begin_publish( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Publish runbook draft. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the publish runbook operation. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._publish_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_publish.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/publish'} + + def get_content( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Retrieve the content of runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'text/powershell' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Runbook" + """Retrieve the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Runbook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Runbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Runbook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Runbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + runbook_type, # type: Union[str, "models.RunbookTypeEnum"] + name=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + log_verbose=None, # type: Optional[bool] + log_progress=None, # type: Optional[bool] + draft=None, # type: Optional["models.RunbookDraft"] + publish_content_link=None, # type: Optional["models.ContentLink"] + description=None, # type: Optional[str] + log_activity_trace=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.Runbook" + """Create the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param runbook_type: Gets or sets the type of the runbook. + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :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] + :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 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Runbook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Runbook or ~azure.mgmt.automation.models.Runbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Runbook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.RunbookCreateOrUpdateParameters(name=name, location=location, tags=tags, log_verbose=log_verbose, log_progress=log_progress, runbook_type=runbook_type, draft=draft, publish_content_link=publish_content_link, description=description, log_activity_trace=log_activity_trace) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'RunbookCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Runbook', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Runbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + name=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + description=None, # type: Optional[str] + log_verbose=None, # type: Optional[bool] + log_progress=None, # type: Optional[bool] + log_activity_trace=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.Runbook" + """Update the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param 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] + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Runbook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Runbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Runbook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.RunbookUpdateParameters(name=name, location=location, tags=tags, description=description, log_verbose=log_verbose, log_progress=log_progress, log_activity_trace=log_activity_trace) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'RunbookUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Runbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the runbook by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RunbookListResult" + """Retrieve a list of runbooks. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunbookListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.RunbookListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RunbookListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RunbookListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_schedule_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_schedule_operations.py new file mode 100644 index 00000000000..065ef856adb --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_schedule_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 datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ScheduleOperations(object): + """ScheduleOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + schedule_name, # type: str + name, # type: str + start_time, # type: datetime.datetime + frequency, # type: Union[str, "models.ScheduleFrequency"] + description=None, # type: Optional[str] + expiry_time=None, # type: Optional[datetime.datetime] + interval=None, # type: Optional[object] + time_zone=None, # type: Optional[str] + week_days=None, # type: Optional[List[str]] + month_days=None, # type: Optional[List[int]] + monthly_occurrences=None, # type: Optional[List["AdvancedScheduleMonthlyOccurrence"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Schedule" + """Create a schedule. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param 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.datetime + :param frequency: Gets or sets the frequency of the schedule. + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param description: Gets or sets the description of the schedule. + :type description: str + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: ~datetime.datetime + :param interval: Gets or sets the interval of the schedule. + :type interval: object + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :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] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Schedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Schedule or ~azure.mgmt.automation.models.Schedule or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ScheduleCreateOrUpdateParameters(name=name, description=description, start_time=start_time, expiry_time=expiry_time, interval=interval, frequency=frequency, time_zone=time_zone, week_days=week_days, month_days=month_days, monthly_occurrences=monthly_occurrences) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ScheduleCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 409]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Schedule', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Schedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + schedule_name, # type: str + name=None, # type: Optional[str] + description=None, # type: Optional[str] + is_enabled=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "models.Schedule" + """Update the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Schedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Schedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ScheduleUpdateParameters(name=name, description=description, is_enabled=is_enabled) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ScheduleUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Schedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + schedule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Schedule" + """Retrieve the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Schedule or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Schedule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Schedule"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Schedule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + schedule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ScheduleListResult" + """Retrieve a list of schedules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduleListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.ScheduleListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ScheduleListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_software_update_configuration_machine_run_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_software_update_configuration_machine_run_operations.py new file mode 100644 index 00000000000..d1079cd4ddc --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_software_update_configuration_machine_run_operations.py @@ -0,0 +1,191 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SoftwareUpdateConfigurationMachineRunOperations(object): + """SoftwareUpdateConfigurationMachineRunOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_by_id( + self, + resource_group_name, # type: str + automation_account_name, # type: str + software_update_configuration_machine_run_id, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SoftwareUpdateConfigurationMachineRun" + """Get a single software update configuration machine run by Id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_machine_run_id: The Id of the software update + configuration machine run. + :type software_update_configuration_machine_run_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationMachineRun or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationMachineRun"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationMachineRunId': self._serialize.url("software_update_configuration_machine_run_id", software_update_configuration_machine_run_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationMachineRun', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}'} + + def list( + self, + resource_group_name, # type: str + automation_account_name, # type: str + client_request_id=None, # type: Optional[str] + filter=None, # type: Optional[str] + skip=None, # type: Optional[str] + top=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SoftwareUpdateConfigurationMachineRunListResult" + """Return list of software update configuration machine runs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. You can use the following filters: + 'properties/osType', 'properties/status', 'properties/startTime', and + 'properties/softwareUpdateConfiguration/name'. + :type filter: str + :param skip: number of entries you skip before returning results. + :type skip: str + :param top: Maximum number of entries returned in the results collection. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationMachineRunListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRunListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationMachineRunListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationMachineRunListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_software_update_configuration_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_software_update_configuration_operations.py new file mode 100644 index 00000000000..2137b5a841d --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_software_update_configuration_operations.py @@ -0,0 +1,410 @@ +# 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 datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SoftwareUpdateConfigurationOperations(object): + """SoftwareUpdateConfigurationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create( + self, + resource_group_name, # type: str + automation_account_name, # type: str + software_update_configuration_name, # type: str + operating_system, # type: Union[str, "models.OperatingSystemType"] + client_request_id=None, # type: Optional[str] + error=None, # type: Optional["models.ErrorResponse"] + parameters=None, # type: Optional[Dict[str, str]] + source=None, # type: Optional[str] + task_properties_parameters=None, # type: Optional[Dict[str, str]] + task_properties_source=None, # type: Optional[str] + start_time=None, # type: Optional[datetime.datetime] + expiry_time=None, # type: Optional[datetime.datetime] + expiry_time_offset_minutes=None, # type: Optional[float] + is_enabled=False, # type: Optional[bool] + next_run=None, # type: Optional[datetime.datetime] + next_run_offset_minutes=None, # type: Optional[float] + interval=None, # type: Optional[int] + frequency=None, # type: Optional[Union[str, "models.ScheduleFrequency"]] + time_zone=None, # type: Optional[str] + creation_time=None, # type: Optional[datetime.datetime] + last_modified_time=None, # type: Optional[datetime.datetime] + description=None, # type: Optional[str] + week_days=None, # type: Optional[List[str]] + month_days=None, # type: Optional[List[int]] + monthly_occurrences=None, # type: Optional[List["AdvancedScheduleMonthlyOccurrence"]] + windows=None, # type: Optional["models.WindowsProperties"] + linux=None, # type: Optional["models.LinuxProperties"] + duration=None, # type: Optional[datetime.timedelta] + azure_virtual_machines=None, # type: Optional[List[str]] + non_azure_computer_names=None, # type: Optional[List[str]] + azure_queries=None, # type: Optional[List["AzureQueryProperties"]] + non_azure_queries=None, # type: Optional[List["NonAzureQueryProperties"]] + **kwargs # type: Any + ): + # type: (...) -> "models.SoftwareUpdateConfiguration" + """Create a new software update configuration with the name given in the URI. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software update configuration to be + created. + :type software_update_configuration_name: str + :param operating_system: operating system of target machines. + :type operating_system: str or ~azure.mgmt.automation.models.OperatingSystemType + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param error: Details of provisioning error. + :type error: ~azure.mgmt.automation.models.ErrorResponse + :param parameters: Gets or sets the parameters of the task. + :type parameters: dict[str, str] + :param source: Gets or sets the name of the runbook. + :type source: str + :param task_properties_parameters: Gets or sets the parameters of the task. + :type task_properties_parameters: dict[str, str] + :param task_properties_source: Gets or sets the name of the runbook. + :type task_properties_source: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: ~datetime.datetime + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: ~datetime.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. + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: ~datetime.datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. + :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 creation_time: Gets or sets the creation time. + :type creation_time: ~datetime.datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: ~datetime.datetime + :param description: Gets or sets the description. + :type description: str + :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] + :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: ~datetime.timedelta + :param azure_virtual_machines: List of azure resource Ids for azure virtual machines targeted + by the software update configuration. + :type azure_virtual_machines: list[str] + :param non_azure_computer_names: List of names of non-azure machines targeted by the software + update configuration. + :type non_azure_computer_names: list[str] + :param azure_queries: List of Azure queries in the software update configuration. + :type azure_queries: list[~azure.mgmt.automation.models.AzureQueryProperties] + :param non_azure_queries: List of non Azure queries in the software update configuration. + :type non_azure_queries: list[~azure.mgmt.automation.models.NonAzureQueryProperties] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration or ~azure.mgmt.automation.models.SoftwareUpdateConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.SoftwareUpdateConfiguration(error=error, parameters_properties_tasks_post_task_parameters=parameters, source_properties_tasks_post_task_source=source, parameters_properties_tasks_pre_task_parameters=task_properties_parameters, source_properties_tasks_pre_task_source=task_properties_source, start_time=start_time, expiry_time=expiry_time, expiry_time_offset_minutes=expiry_time_offset_minutes, is_enabled=is_enabled, next_run=next_run, next_run_offset_minutes=next_run_offset_minutes, interval=interval, frequency=frequency, time_zone=time_zone, creation_time_properties_schedule_info_creation_time=creation_time, last_modified_time_properties_schedule_info_last_modified_time=last_modified_time, description=description, week_days=week_days, month_days=month_days, monthly_occurrences=monthly_occurrences, operating_system=operating_system, windows=windows, linux=linux, duration=duration, azure_virtual_machines=azure_virtual_machines, non_azure_computer_names=non_azure_computer_names, azure_queries=azure_queries, non_azure_queries=non_azure_queries) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'SoftwareUpdateConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SoftwareUpdateConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + def get_by_name( + self, + resource_group_name, # type: str + automation_account_name, # type: str + software_update_configuration_name, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SoftwareUpdateConfiguration" + """Get a single software update configuration by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software update configuration to be + created. + :type software_update_configuration_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_by_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + software_update_configuration_name, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """delete a specific software update configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software update configuration to be + created. + :type software_update_configuration_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + def list( + self, + resource_group_name, # type: str + automation_account_name, # type: str + client_request_id=None, # type: Optional[str] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SoftwareUpdateConfigurationListResult" + """Get all software update configurations for the account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_software_update_configuration_run_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_software_update_configuration_run_operations.py new file mode 100644 index 00000000000..bdd6fef0e4d --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_software_update_configuration_run_operations.py @@ -0,0 +1,190 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SoftwareUpdateConfigurationRunOperations(object): + """SoftwareUpdateConfigurationRunOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_by_id( + self, + resource_group_name, # type: str + automation_account_name, # type: str + software_update_configuration_run_id, # type: str + client_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SoftwareUpdateConfigurationRun" + """Get a single software update configuration Run by Id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_run_id: The Id of the software update configuration run. + :type software_update_configuration_run_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationRun or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationRun"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationRunId': self._serialize.url("software_update_configuration_run_id", software_update_configuration_run_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationRun', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}'} + + def list( + self, + resource_group_name, # type: str + automation_account_name, # type: str + client_request_id=None, # type: Optional[str] + filter=None, # type: Optional[str] + skip=None, # type: Optional[str] + top=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SoftwareUpdateConfigurationRunListResult" + """Return list of software update configuration runs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. You can use the following filters: + 'properties/osType', 'properties/status', 'properties/startTime', and + 'properties/softwareUpdateConfiguration/name'. + :type filter: str + :param skip: Number of entries you skip before returning results. + :type skip: str + :param top: Maximum number of entries returned in the results collection. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SoftwareUpdateConfigurationRunListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationRunListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SoftwareUpdateConfigurationRunListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", 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 = {} # type: Dict[str, Any] + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SoftwareUpdateConfigurationRunListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_source_control_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_source_control_operations.py new file mode 100644 index 00000000000..b8111654c2f --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_source_control_operations.py @@ -0,0 +1,427 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SourceControlOperations(object): + """SourceControlOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + source_control_name, # type: str + repo_url=None, # type: Optional[str] + branch=None, # type: Optional[str] + folder_path=None, # type: Optional[str] + auto_sync=None, # type: Optional[bool] + publish_runbook=None, # type: Optional[bool] + source_type=None, # type: Optional[Union[str, "models.SourceType"]] + security_token=None, # type: Optional["models.SourceControlSecurityTokenProperties"] + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SourceControl" + """Create a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as empty string for + VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. Path must be relative. + :type folder_path: str + :param auto_sync: The auto async of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param security_token: The authorization token for the repo of the source control. + :type security_token: ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControl or ~azure.mgmt.automation.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.SourceControlCreateOrUpdateParameters(repo_url=repo_url, branch=branch, folder_path=folder_path, auto_sync=auto_sync, publish_runbook=publish_runbook, source_type=source_type, security_token=security_token, description=description) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'SourceControlCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + source_control_name, # type: str + branch=None, # type: Optional[str] + folder_path=None, # type: Optional[str] + auto_sync=None, # type: Optional[bool] + publish_runbook=None, # type: Optional[bool] + security_token=None, # type: Optional["models.SourceControlSecurityTokenProperties"] + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SourceControl" + """Update a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param branch: The repo branch of the source control. + :type branch: str + :param folder_path: The folder path of the source control. Path must be relative. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is true. + :type publish_runbook: bool + :param security_token: The authorization token for the repo of the source control. + :type security_token: ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.SourceControlUpdateParameters(branch=branch, folder_path=folder_path, auto_sync=auto_sync, publish_runbook=publish_runbook, security_token=security_token, description=description) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'SourceControlUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + source_control_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The name of source control. + :type source_control_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + source_control_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SourceControl" + """Retrieve the source control identified by source control name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The name of source control. + :type source_control_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SourceControlListResult" + """Retrieve a list of source controls. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_source_control_sync_job_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_source_control_sync_job_operations.py new file mode 100644 index 00000000000..25408656a41 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_source_control_sync_job_operations.py @@ -0,0 +1,269 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SourceControlSyncJobOperations(object): + """SourceControlSyncJobOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create( + self, + resource_group_name, # type: str + automation_account_name, # type: str + source_control_name, # type: str + source_control_sync_job_id, # type: str + commit_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SourceControlSyncJob" + """Creates the sync job for a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param commit_id: The commit id of the source control sync job. If not syncing to a commitId, + enter an empty string. + :type commit_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.SourceControlSyncJobCreateParameters(commit_id=commit_id) + api_version = "2017-05-15-preview" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'SourceControlSyncJobCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControlSyncJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + source_control_name, # type: str + source_control_sync_job_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SourceControlSyncJobById" + """Retrieve the source control sync job identified by job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJobById or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobById + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJobById"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControlSyncJobById', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + source_control_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SourceControlSyncJobListResult" + """Retrieve a list of source control sync jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJobListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJobListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlSyncJobListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_source_control_sync_job_stream_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_source_control_sync_job_stream_operations.py new file mode 100644 index 00000000000..d240e0cf3a2 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_source_control_sync_job_stream_operations.py @@ -0,0 +1,200 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SourceControlSyncJobStreamOperations(object): + """SourceControlSyncJobStreamOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_sync_job( + self, + resource_group_name, # type: str + automation_account_name, # type: str + source_control_name, # type: str + source_control_sync_job_id, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SourceControlSyncJobStreamsListBySyncJob" + """Retrieve a list of sync job streams identified by sync job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJobStreamsListBySyncJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobStreamsListBySyncJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJobStreamsListBySyncJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_sync_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlSyncJobStreamsListBySyncJob', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_sync_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + source_control_name, # type: str + source_control_sync_job_id, # type: str + stream_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SourceControlSyncJobStreamById" + """Retrieve a sync job stream identified by stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param stream_id: The id of the sync job stream. + :type stream_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlSyncJobStreamById or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobStreamById + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceControlSyncJobStreamById"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2017-05-15-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'streamId': self._serialize.url("stream_id", stream_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControlSyncJobStreamById', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams/{streamId}'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_statistics_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_statistics_operations.py new file mode 100644 index 00000000000..0f9781d4a20 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_statistics_operations.py @@ -0,0 +1,123 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StatisticsOperations(object): + """StatisticsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.StatisticsListResult" + """Retrieve the statistics for the account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StatisticsListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.StatisticsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.StatisticsListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StatisticsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_test_job_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_test_job_operations.py new file mode 100644 index 00000000000..147e5b5a654 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_test_job_operations.py @@ -0,0 +1,353 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TestJobOperations(object): + """TestJobOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + parameters=None, # type: Optional[Dict[str, str]] + run_on=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.TestJob" + """Create a test job of the runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the create test job operation. + :type runbook_name: str + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where the job is to be + executed. + :type run_on: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TestJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TestJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TestJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.TestJobCreateParameters(parameters=parameters, run_on=run_on) + api_version = "2018-06-30" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'TestJobCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TestJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.TestJob" + """Retrieve the test job for the specified runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TestJob or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.TestJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TestJob"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TestJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'} + + def resume( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resume the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.resume.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume'} + + def stop( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop'} + + def suspend( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Suspend the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.suspend.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_test_job_stream_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_test_job_stream_operations.py new file mode 100644 index 00000000000..638a1ade8ad --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_test_job_stream_operations.py @@ -0,0 +1,192 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TestJobStreamOperations(object): + """TestJobStreamOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + job_stream_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.JobStream" + """Retrieve a test job stream of the test job identified by runbook name and stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStream or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStream + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStream"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobStream', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}'} + + def list_by_test_job( + self, + resource_group_name, # type: str + automation_account_name, # type: str + runbook_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.JobStreamListResult" + """Retrieve a list of test job streams identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobStreamListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.JobStreamListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JobStreamListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2018-06-30" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_test_job.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('JobStreamListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_test_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_usage_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_usage_operations.py new file mode 100644 index 00000000000..f68ddce3763 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_usage_operations.py @@ -0,0 +1,118 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsageOperations(object): + """UsageOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.UsageListResult" + """Retrieve the usage for the account id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: UsageListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.UsageListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsageListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_variable_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_variable_operations.py new file mode 100644 index 00000000000..0c92fcc700b --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_variable_operations.py @@ -0,0 +1,400 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VariableOperations(object): + """VariableOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + variable_name, # type: str + name, # type: str + value=None, # type: Optional[str] + description=None, # type: Optional[str] + is_encrypted=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "models.Variable" + """Create a variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The variable name. + :type variable_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Variable or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Variable or ~azure.mgmt.automation.models.Variable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Variable"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.VariableCreateOrUpdateParameters(name=name, value=value, description=description, is_encrypted=is_encrypted) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'VariableCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Variable', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Variable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + variable_name, # type: str + name=None, # type: Optional[str] + value=None, # type: Optional[str] + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Variable" + """Update a variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The variable name. + :type variable_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Variable or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Variable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Variable"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.VariableUpdateParameters(name=name, value=value, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'VariableUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Variable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + variable_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The name of variable. + :type variable_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + variable_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Variable" + """Retrieve the variable identified by variable name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The name of variable. + :type variable_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Variable or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Variable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Variable"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Variable', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VariableListResult" + """Retrieve a list of variables. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VariableListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.VariableListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VariableListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VariableListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_watcher_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_watcher_operations.py new file mode 100644 index 00000000000..6c0abf66efd --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_watcher_operations.py @@ -0,0 +1,531 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WatcherOperations(object): + """WatcherOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + watcher_name, # type: str + tags=None, # type: Optional[Dict[str, str]] + location=None, # type: Optional[str] + etag=None, # type: Optional[str] + execution_frequency_in_seconds=None, # type: Optional[int] + script_name=None, # type: Optional[str] + script_parameters=None, # type: Optional[Dict[str, str]] + script_run_on=None, # type: Optional[str] + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Watcher" + """Create the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives. + :type location: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which the watcher is + invoked. + :type execution_frequency_in_seconds: long + :param script_name: Gets or sets the name of the script the watcher is attached to, i.e. the + name of an existing runbook. + :type script_name: str + :param script_parameters: Gets or sets the parameters of the script. + :type script_parameters: dict[str, str] + :param script_run_on: Gets or sets the name of the hybrid worker group the watcher will run on. + :type script_run_on: str + :param description: Gets or sets the description. + :type description: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Watcher or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Watcher or ~azure.mgmt.automation.models.Watcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Watcher"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.Watcher(tags=tags, location=location, etag=etag, execution_frequency_in_seconds=execution_frequency_in_seconds, script_name=script_name, script_parameters=script_parameters, script_run_on=script_run_on, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'Watcher') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Watcher', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Watcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Watcher" + """Retrieve the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Watcher or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Watcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Watcher"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Watcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + watcher_name, # type: str + name=None, # type: Optional[str] + execution_frequency_in_seconds=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.Watcher" + """Update the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param name: Gets or sets the name of the resource. + :type name: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which the watcher is + invoked. + :type execution_frequency_in_seconds: long + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Watcher or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Watcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Watcher"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.WatcherUpdateParameters(name=name, execution_frequency_in_seconds=execution_frequency_in_seconds) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'WatcherUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Watcher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the watcher by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + def start( + self, + resource_group_name, # type: str + automation_account_name, # type: str + watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resume the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/start'} + + def stop( + self, + resource_group_name, # type: str + automation_account_name, # type: str + watcher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resume the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/stop'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WatcherListResult" + """Retrieve a list of watchers. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WatcherListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.WatcherListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WatcherListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WatcherListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/operations/_webhook_operations.py b/src/automation/azext_automation/vendored_sdks/automation/operations/_webhook_operations.py new file mode 100644 index 00000000000..99ecd0998a2 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/operations/_webhook_operations.py @@ -0,0 +1,478 @@ +# 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 datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WebhookOperations(object): + """WebhookOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.automation.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def generate_uri( + self, + resource_group_name, # type: str + automation_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Generates a Uri for use in creating a webhook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.generate_uri.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_uri.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri'} + + def delete( + self, + resource_group_name, # type: str + automation_account_name, # type: str + webhook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the webhook by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def get( + self, + resource_group_name, # type: str + automation_account_name, # type: str + webhook_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Webhook" + """Retrieve the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Webhook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Webhook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Webhook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Webhook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def create_or_update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + webhook_name, # type: str + name, # type: str + is_enabled=None, # type: Optional[bool] + uri=None, # type: Optional[str] + expiry_time=None, # type: Optional[datetime.datetime] + parameters=None, # type: Optional[Dict[str, str]] + runbook=None, # type: Optional["models.RunbookAssociationProperty"] + run_on=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Webhook" + """Create the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param 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.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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Webhook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Webhook or ~azure.mgmt.automation.models.Webhook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Webhook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.WebhookCreateOrUpdateParameters(name=name, is_enabled=is_enabled, uri=uri, expiry_time=expiry_time, parameters=parameters, runbook=runbook, run_on=run_on) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'WebhookCreateOrUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Webhook', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Webhook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def update( + self, + resource_group_name, # type: str + automation_account_name, # type: str + webhook_name, # type: str + name=None, # type: Optional[str] + is_enabled=None, # type: Optional[bool] + run_on=None, # type: Optional[str] + parameters=None, # type: Optional[Dict[str, str]] + description=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Webhook" + """Update the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Webhook or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.Webhook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Webhook"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.WebhookUpdateParameters(name=name, is_enabled=is_enabled, run_on=run_on, parameters=parameters, description=description) + api_version = "2015-10-31" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'WebhookUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Webhook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def list_by_automation_account( + self, + resource_group_name, # type: str + automation_account_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WebhookListResult" + """Retrieve a list of webhooks. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebhookListResult or the result of cls(response) + :rtype: ~azure.mgmt.automation.models.WebhookListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebhookListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2015-10-31" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebhookListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks'} diff --git a/src/automation/azext_automation/vendored_sdks/automation/py.typed b/src/automation/azext_automation/vendored_sdks/automation/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/automation/azext_automation/vendored_sdks/automation/setup.py b/src/automation/azext_automation/vendored_sdks/automation/setup.py new file mode 100644 index 00000000000..610674387e8 --- /dev/null +++ b/src/automation/azext_automation/vendored_sdks/automation/setup.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. +# -------------------------------------------------------------------------- +# coding: utf-8 + +from setuptools import setup, find_packages + +NAME = "automationclient" +VERSION = "0.1.1" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["msrest>=0.6.0", "azure-core<2.0.0,>=1.2.0"] + +setup( + name=NAME, + version=VERSION, + description="AutomationClient", + author_email="", + url="", + keywords=["Swagger", "AutomationClient"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + Automation Client. + """ +) diff --git a/src/automation/report.md b/src/automation/report.md new file mode 100644 index 00000000000..606fbcc4934 --- /dev/null +++ b/src/automation/report.md @@ -0,0 +1,1473 @@ +# Azure CLI Module Creation Report + +### automation activity list + +list a automation activity. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--module-name**|string|The name of module.|module_name| +### automation activity show + +show a automation activity. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--module-name**|string|The name of module.|module_name| +|**--activity-name**|string|The name of activity.|activity_name| +### automation agent-registration-information regenerate-key + +regenerate-key a automation agent-registration-information. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--key-name**|choice|Gets or sets the agent registration key name - primary or secondary.|key_name| +### automation agent-registration-information show + +show a automation agent-registration-information. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation automation-account create + +create a automation automation-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--name**|string|Gets or sets name of the resource.|name| +|**--location**|string|Gets or sets the location of the resource.|location| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--sku**|object|Gets or sets account SKU.|sku| +### automation automation-account delete + +delete a automation automation-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation automation-account list + +list a automation automation-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +### automation automation-account show + +show a automation automation-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation automation-account update + +update a automation automation-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--name**|string|Gets or sets the name of the resource.|name| +|**--location**|string|Gets or sets the location of the resource.|location| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--sku**|object|Gets or sets account SKU.|sku| +### automation certificate create + +create a automation certificate. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--certificate-name**|string|The parameters supplied to the create or update certificate operation.|certificate_name| +|**--name**|string|Gets or sets the name of the certificate.|name| +|**--base64value**|string|Gets or sets the base64 encoded value of the certificate.|base64_value| +|**--description**|string|Gets or sets the description of the certificate.|description| +|**--thumbprint**|string|Gets or sets the thumbprint of the certificate.|thumbprint| +|**--is-exportable**|boolean|Gets or sets the is exportable flag of the certificate.|is_exportable| +### automation certificate delete + +delete a automation certificate. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--certificate-name**|string|The name of certificate.|certificate_name| +### automation certificate list + +list a automation certificate. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation certificate show + +show a automation certificate. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--certificate-name**|string|The name of certificate.|certificate_name| +### automation certificate update + +update a automation certificate. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--certificate-name**|string|The parameters supplied to the update certificate operation.|certificate_name| +|**--name**|string|Gets or sets the name of the certificate.|name| +|**--description**|string|Gets or sets the description of the certificate.|description| +### automation connection create + +create a automation connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--connection-name**|string|The parameters supplied to the create or update connection operation.|connection_name| +|**--name**|string|Gets or sets the name of the connection.|name| +|**--connection-type**|object|Gets or sets the connectionType of the connection.|connection_type| +|**--description**|string|Gets or sets the description of the connection.|description| +|**--field-definition-values**|dictionary|Gets or sets the field definition properties of the connection.|field_definition_values| +### automation connection delete + +delete a automation connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--connection-name**|string|The name of connection.|connection_name| +### automation connection list + +list a automation connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation connection show + +show a automation connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--connection-name**|string|The name of connection.|connection_name| +### automation connection update + +update a automation connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--connection-name**|string|The parameters supplied to the update a connection operation.|connection_name| +|**--name**|string|Gets or sets the name of the connection.|name| +|**--description**|string|Gets or sets the description of the connection.|description| +|**--field-definition-values**|dictionary|Gets or sets the field definition values of the connection.|field_definition_values| +### automation connection-type create + +create a automation connection-type. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--connection-type-name**|string|The parameters supplied to the create or update connection type operation.|connection_type_name| +|**--name**|string|Gets or sets the name of the connection type.|name| +|**--field-definitions**|dictionary|Gets or sets the field definitions of the connection type.|field_definitions| +|**--is-global**|boolean|Gets or sets a Boolean value to indicate if the connection type is global.|is_global| +### automation connection-type delete + +delete a automation connection-type. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--connection-type-name**|string|The name of connection type.|connection_type_name| +### automation connection-type list + +list a automation connection-type. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation connection-type show + +show a automation connection-type. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--connection-type-name**|string|The name of connection type.|connection_type_name| +### automation connection-type update + +create a automation connection-type. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--connection-type-name**|string|The parameters supplied to the create or update connection type operation.|connection_type_name| +|**--name**|string|Gets or sets the name of the connection type.|name| +|**--field-definitions**|dictionary|Gets or sets the field definitions of the connection type.|field_definitions| +|**--is-global**|boolean|Gets or sets a Boolean value to indicate if the connection type is global.|is_global| +### automation credential create + +create a automation credential. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--credential-name**|string|The parameters supplied to the create or update credential operation.|credential_name| +|**--name**|string|Gets or sets the name of the credential.|name| +|**--user-name**|string|Gets or sets the user name of the credential.|user_name| +|**--password**|string|Gets or sets the password of the credential.|password| +|**--description**|string|Gets or sets the description of the credential.|description| +### automation credential delete + +delete a automation credential. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--credential-name**|string|The name of credential.|credential_name| +### automation credential list + +list a automation credential. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation credential show + +show a automation credential. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--credential-name**|string|The name of credential.|credential_name| +### automation credential update + +update a automation credential. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--credential-name**|string|The parameters supplied to the Update credential operation.|credential_name| +|**--name**|string|Gets or sets the name of the credential.|name| +|**--user-name**|string|Gets or sets the user name of the credential.|user_name| +|**--password**|string|Gets or sets the password of the credential.|password| +|**--description**|string|Gets or sets the description of the credential.|description| +### automation dsc-compilation-job create + +create a automation dsc-compilation-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--compilation-job-name**|string|The DSC configuration Id.|compilation_job_name| +|**--configuration**|object|Gets or sets the configuration.|configuration| +|**--name**|string|Gets or sets name of the resource.|name| +|**--location**|string|Gets or sets the location of the resource.|location| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--parameters**|dictionary|Gets or sets the parameters of the job.|parameters| +|**--increment-node-configuration-build**|boolean|If a new build version of NodeConfiguration is required.|increment_node_configuration_build| +### automation dsc-compilation-job list + +list a automation dsc-compilation-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation dsc-compilation-job show + +show a automation dsc-compilation-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-id**|uuid|The job id.|job_id| +|**--job-stream-id**|string|The job stream id.|job_stream_id| +|**--compilation-job-name**|string|The DSC configuration Id.|compilation_job_name| +### automation dsc-compilation-job-stream list + +list a automation dsc-compilation-job-stream. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-id**|uuid|The job id.|job_id| +### automation dsc-configuration create + +create a automation dsc-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--configuration-name**|string|The create or update parameters for configuration.|configuration_name| +|**--source**|object|Gets or sets the source.|source| +|**--name**|string|Gets or sets name of the resource.|name| +|**--location**|string|Gets or sets the location of the resource.|location| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--log-verbose**|boolean|Gets or sets verbose log option.|log_verbose| +|**--log-progress**|boolean|Gets or sets progress log option.|log_progress| +|**--parameters**|dictionary|Gets or sets the configuration parameters.|parameters| +|**--description**|string|Gets or sets the description of the configuration.|description| +### automation dsc-configuration delete + +delete a automation dsc-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--configuration-name**|string|The configuration name.|configuration_name| +### automation dsc-configuration list + +list a automation dsc-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +|**--skip**|integer|The number of rows to skip.|skip| +|**--top**|integer|The number of rows to take.|top| +|**--inlinecount**|string|Return total rows.|inlinecount| +### automation dsc-configuration show + +show a automation dsc-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--configuration-name**|string|The configuration name.|configuration_name| +### automation dsc-configuration update + +update a automation dsc-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--configuration-name**|string|The create or update parameters for configuration.|configuration_name| +|**--name**|string|Gets or sets name of the resource.|name| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--log-verbose**|boolean|Gets or sets verbose log option.|log_verbose| +|**--log-progress**|boolean|Gets or sets progress log option.|log_progress| +|**--source**|object|Gets or sets the source.|source| +|**--parameters**|dictionary|Gets or sets the configuration parameters.|parameters| +|**--description**|string|Gets or sets the description of the configuration.|description| +### automation dsc-node delete + +delete a automation dsc-node. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--node-id**|string|The node id.|node_id| +### automation dsc-node list + +list a automation dsc-node. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +|**--skip**|integer|The number of rows to skip.|skip| +|**--top**|integer|The number of rows to take.|top| +|**--inlinecount**|string|Return total rows.|inlinecount| +### automation dsc-node show + +show a automation dsc-node. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--node-id**|string|The node id.|node_id| +### automation dsc-node update + +update a automation dsc-node. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--node-id**|string|Parameters supplied to the update dsc node.|node_id| +|**--node-id**|string|Gets or sets the id of the dsc node.|node_id| +|**--node-configuration-name**|string|Gets or sets the name of the dsc node configuration.|name_properties_node_configuration_name| +### automation dsc-node-configuration create + +create a automation dsc-node-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--node-configuration-name**|string|The Dsc node configuration name.|node_configuration_name| +|**--name**|string|Name of the node configuration.|name| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--source**|object|Gets or sets the source.|source| +|**--configuration**|object|Gets or sets the configuration of the node.|configuration| +|**--increment-node-configuration-build**|boolean|If a new build version of NodeConfiguration is required.|increment_node_configuration_build| +### automation dsc-node-configuration delete + +delete a automation dsc-node-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--node-configuration-name**|string|The Dsc node configuration name.|node_configuration_name| +### automation dsc-node-configuration list + +list a automation dsc-node-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +|**--skip**|integer|The number of rows to skip.|skip| +|**--top**|integer|The number of rows to take.|top| +|**--inlinecount**|string|Return total rows.|inlinecount| +### automation dsc-node-configuration show + +show a automation dsc-node-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--node-configuration-name**|string|The Dsc node configuration name.|node_configuration_name| +### automation dsc-node-configuration update + +create a automation dsc-node-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--node-configuration-name**|string|The Dsc node configuration name.|node_configuration_name| +|**--name**|string|Name of the node configuration.|name| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--source**|object|Gets or sets the source.|source| +|**--configuration**|object|Gets or sets the configuration of the node.|configuration| +|**--increment-node-configuration-build**|boolean|If a new build version of NodeConfiguration is required.|increment_node_configuration_build| +### automation field list + +list a automation field. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--module-name**|string|The name of module.|module_name| +|**--type-name**|string|The name of type.|type_name| +### automation hybrid-runbook-worker-group delete + +delete a automation hybrid-runbook-worker-group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--hybrid-runbook-worker-group-name**|string|The hybrid runbook worker group name|hybrid_runbook_worker_group_name| +### automation hybrid-runbook-worker-group list + +list a automation hybrid-runbook-worker-group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation hybrid-runbook-worker-group show + +show a automation hybrid-runbook-worker-group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--hybrid-runbook-worker-group-name**|string|The hybrid runbook worker group name|hybrid_runbook_worker_group_name| +### automation hybrid-runbook-worker-group update + +update a automation hybrid-runbook-worker-group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--hybrid-runbook-worker-group-name**|string|The hybrid runbook worker group name|hybrid_runbook_worker_group_name| +|**--credential**|object|Sets the credential of a worker group.|credential| +### automation job create + +create a automation job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-name**|string|The job name.|job_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +|**--runbook**|object|Gets or sets the runbook.|runbook| +|**--parameters**|dictionary|Gets or sets the parameters of the job.|parameters| +|**--run-on**|string|Gets or sets the runOn which specifies the group name where the job is to be executed.|run_on| +### automation job list + +list a automation job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation job resume + +resume a automation job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-name**|string|The job name.|job_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation job show + +show a automation job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-name**|string|The name of the job to be created.|job_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation job stop + +stop a automation job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-name**|string|The job name.|job_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation job suspend + +suspend a automation job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-name**|string|The job name.|job_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation job-schedule create + +create a automation job-schedule. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-schedule-id**|uuid|The job schedule name.|job_schedule_id| +|**--schedule**|object|Gets or sets the schedule.|schedule| +|**--runbook**|object|Gets or sets the runbook.|runbook| +|**--run-on**|string|Gets or sets the hybrid worker group that the scheduled job should run on.|run_on| +|**--parameters**|dictionary|Gets or sets a list of job properties.|parameters| +### automation job-schedule delete + +delete a automation job-schedule. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-schedule-id**|uuid|The job schedule name.|job_schedule_id| +### automation job-schedule list + +list a automation job-schedule. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation job-schedule show + +show a automation job-schedule. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-schedule-id**|uuid|The job schedule name.|job_schedule_id| +### automation job-stream list + +list a automation job-stream. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-name**|string|The job name.|job_name| +|**--filter**|string|The filter to apply on the operation.|filter| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation job-stream show + +show a automation job-stream. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--job-name**|string|The job name.|job_name| +|**--job-stream-id**|string|The job stream id.|job_stream_id| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation key list-by-automation-account + +list-by-automation-account a automation key. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation linked-workspace show + +show a automation linked-workspace. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation module create + +create a automation module. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--module-name**|string|The name of module.|module_name| +|**--content-link**|object|Gets or sets the module content link.|content_link| +|**--name**|string|Gets or sets name of the resource.|name| +|**--location**|string|Gets or sets the location of the resource.|location| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +### automation module delete + +delete a automation module. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--module-name**|string|The module name.|module_name| +### automation module list + +list a automation module. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation module show + +show a automation module. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--module-name**|string|The module name.|module_name| +### automation module update + +update a automation module. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--module-name**|string|The name of module.|module_name| +|**--name**|string|Gets or sets name of the resource.|name| +|**--location**|string|Gets or sets the location of the resource.|location| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--content-link**|object|Gets or sets the module content link.|content_link| +### automation node-count-information show + +show a automation node-count-information. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--count-type**|choice|The type of counts to retrieve|count_type| +### automation node-report list + +list a automation node-report. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--node-id**|string|The parameters supplied to the list operation.|node_id| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation node-report show + +show a automation node-report. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--node-id**|string|The Dsc node id.|node_id| +|**--report-id**|string|The report id.|report_id| +### automation object-data-type list-field + +list-field a automation object-data-type. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--module-name**|string|The name of module.|module_name| +|**--type-name**|string|The name of type.|type_name| +### automation python2-package create + +create a automation python2-package. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--package-name**|string|The name of python package.|package_name| +|**--content-link**|object|Gets or sets the module content link.|content_link| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +### automation python2-package delete + +delete a automation python2-package. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--package-name**|string|The python package name.|package_name| +### automation python2-package list + +list a automation python2-package. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation python2-package show + +show a automation python2-package. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--package-name**|string|The python package name.|package_name| +### automation python2-package update + +update a automation python2-package. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--package-name**|string|The name of python package.|package_name| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +### automation runbook create + +create a automation runbook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +|**--runbook-type**|choice|Gets or sets the type of the runbook.|runbook_type| +|**--name**|string|Gets or sets the name of the resource.|name| +|**--location**|string|Gets or sets the location of the resource.|location| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--log-verbose**|boolean|Gets or sets verbose log option.|log_verbose| +|**--log-progress**|boolean|Gets or sets progress log option.|log_progress| +|**--draft**|object|Gets or sets the draft runbook properties.|draft| +|**--publish-content-link**|object|Gets or sets the published runbook content link.|publish_content_link| +|**--description**|string|Gets or sets the description of the runbook.|description| +|**--log-activity-trace**|integer|Gets or sets the activity-level tracing options of the runbook.|log_activity_trace| +### automation runbook delete + +delete a automation runbook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +### automation runbook list + +list a automation runbook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation runbook publish + +publish a automation runbook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The parameters supplied to the publish runbook operation.|runbook_name| +### automation runbook show + +show a automation runbook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +### automation runbook update + +update a automation runbook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +|**--name**|string|Gets or sets the name of the resource.|name| +|**--location**|string|Gets or sets the location of the resource.|location| +|**--tags**|dictionary|Gets or sets the tags attached to the resource.|tags| +|**--description**|string|Gets or sets the description of the runbook.|description| +|**--log-verbose**|boolean|Gets or sets verbose log option.|log_verbose| +|**--log-progress**|boolean|Gets or sets progress log option.|log_progress| +|**--log-activity-trace**|integer|Gets or sets the activity-level tracing options of the runbook.|log_activity_trace| +### automation runbook-draft replace-content + +replace-content a automation runbook-draft. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +|**--runbook-content**|string|The runbook draft content.|runbook_content| +### automation runbook-draft show + +show a automation runbook-draft. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +### automation runbook-draft undo-edit + +undo-edit a automation runbook-draft. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +### automation schedule create + +create a automation schedule. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--schedule-name**|string|The schedule name.|schedule_name| +|**--name**|string|Gets or sets the name of the Schedule.|name| +|**--start-time**|date-time|Gets or sets the start time of the schedule.|start_time| +|**--frequency**|choice|Gets or sets the frequency of the schedule.|frequency| +|**--description**|string|Gets or sets the description of the schedule.|description| +|**--expiry-time**|date-time|Gets or sets the end time of the schedule.|expiry_time| +|**--interval**|any|Gets or sets the interval of the schedule.|interval| +|**--time-zone**|string|Gets or sets the time zone of the schedule.|time_zone| +|**--advanced-schedule-week-days**|array|Days of the week that the job should execute on.|week_days| +|**--advanced-schedule-month-days**|array|Days of the month that the job should execute on. Must be between 1 and 31.|month_days| +|**--advanced-schedule-monthly-occurrences**|array|Occurrences of days within a month.|monthly_occurrences| +### automation schedule delete + +delete a automation schedule. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--schedule-name**|string|The schedule name.|schedule_name| +### automation schedule list + +list a automation schedule. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation schedule show + +show a automation schedule. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--schedule-name**|string|The schedule name.|schedule_name| +### automation schedule update + +update a automation schedule. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--schedule-name**|string|The schedule name.|schedule_name| +|**--name**|string|Gets or sets the name of the Schedule.|name| +|**--description**|string|Gets or sets the description of the schedule.|description| +|**--is-enabled**|boolean|Gets or sets a value indicating whether this schedule is enabled.|is_enabled| +### automation software-update-configuration create + +create a automation software-update-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--software-update-configuration-name**|string|The name of the software update configuration to be created.|software_update_configuration_name| +|**--update-configuration-operating-system**|sealed-choice|operating system of target machines|operating_system| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +|**--error**|object|Details of provisioning error|error| +|**--tasks-post-task-parameters**|dictionary|Gets or sets the parameters of the task.|parameters_properties_tasks_post_task_parameters| +|**--tasks-post-task-source**|string|Gets or sets the name of the runbook.|source_properties_tasks_post_task_source| +|**--tasks-pre-task-parameters**|dictionary|Gets or sets the parameters of the task.|parameters_properties_tasks_post_task_parameters| +|**--tasks-pre-task-source**|string|Gets or sets the name of the runbook.|source_properties_tasks_post_task_source| +|**--schedule-info-start-time**|date-time|Gets or sets the start time of the schedule.|start_time| +|**--schedule-info-expiry-time**|date-time|Gets or sets the end time of the schedule.|expiry_time| +|**--schedule-info-expiry-time-offset-minutes**|number|Gets or sets the expiry time's offset in minutes.|expiry_time_offset_minutes| +|**--schedule-info-is-enabled**|boolean|Gets or sets a value indicating whether this schedule is enabled.|is_enabled| +|**--schedule-info-next-run**|date-time|Gets or sets the next run time of the schedule.|next_run| +|**--schedule-info-next-run-offset-minutes**|number|Gets or sets the next run time's offset in minutes.|next_run_offset_minutes| +|**--schedule-info-interval**|integer|Gets or sets the interval of the schedule.|interval| +|**--schedule-info-frequency**|choice|Gets or sets the frequency of the schedule.|frequency| +|**--schedule-info-time-zone**|string|Gets or sets the time zone of the schedule.|time_zone| +|**--schedule-info-creation-time**|date-time|Gets or sets the creation time.|creation_time| +|**--schedule-info-last-modified-time**|date-time|Gets or sets the last modified time.|last_modified_time| +|**--schedule-info-description**|string|Gets or sets the description.|description| +|**--schedule-info-advanced-schedule-week-days**|array|Days of the week that the job should execute on.|week_days| +|**--schedule-info-advanced-schedule-month-days**|array|Days of the month that the job should execute on. Must be between 1 and 31.|month_days| +|**--schedule-info-advanced-schedule-monthly-occurrences**|array|Occurrences of days within a month.|monthly_occurrences| +|**--update-configuration-windows**|object|Windows specific update configuration.|windows| +|**--update-configuration-linux**|object|Linux specific update configuration.|linux| +|**--update-configuration-duration**|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|duration| +|**--update-configuration-azure-virtual-machines**|array|List of azure resource Ids for azure virtual machines targeted by the software update configuration.|azure_virtual_machines| +|**--update-configuration-non-azure-computer-names**|array|List of names of non-azure machines targeted by the software update configuration.|non_azure_computer_names| +|**--update-configuration-targets-azure-queries**|array|List of Azure queries in the software update configuration.|azure_queries| +|**--update-configuration-targets-non-azure-queries**|array|List of non Azure queries in the software update configuration.|non_azure_queries| +### automation software-update-configuration delete + +delete a automation software-update-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--software-update-configuration-name**|string|The name of the software update configuration to be created.|software_update_configuration_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation software-update-configuration list + +list a automation software-update-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation software-update-configuration show + +show a automation software-update-configuration. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--software-update-configuration-name**|string|The name of the software update configuration to be created.|software_update_configuration_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation software-update-configuration-machine-run list + +list a automation software-update-configuration-machine-run. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +|**--filter**|string|The filter to apply on the operation. You can use the following filters: 'properties/osType', 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name'|filter| +|**--skip**|string|number of entries you skip before returning results|skip| +|**--top**|string|Maximum number of entries returned in the results collection|top| +### automation software-update-configuration-machine-run show + +show a automation software-update-configuration-machine-run. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--software-update-configuration-machine-run-id**|uuid|The Id of the software update configuration machine run.|software_update_configuration_machine_run_id| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation software-update-configuration-run list + +list a automation software-update-configuration-run. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +|**--filter**|string|The filter to apply on the operation. You can use the following filters: 'properties/osType', 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name'|filter| +|**--skip**|string|Number of entries you skip before returning results|skip| +|**--top**|string|Maximum number of entries returned in the results collection|top| +### automation software-update-configuration-run show + +show a automation software-update-configuration-run. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--software-update-configuration-run-id**|uuid|The Id of the software update configuration run.|software_update_configuration_run_id| +|**--client-request-id**|string|Identifies this specific client request.|client_request_id| +### automation source-control create + +create a automation source-control. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--source-control-name**|string|The source control name.|source_control_name| +|**--repo-url**|string|The repo url of the source control.|repo_url| +|**--branch**|string|The repo branch of the source control. Include branch as empty string for VsoTfvc.|branch| +|**--folder-path**|string|The folder path of the source control. Path must be relative.|folder_path| +|**--auto-sync**|boolean|The auto async of the source control. Default is false.|auto_sync| +|**--publish-runbook**|boolean|The auto publish of the source control. Default is true.|publish_runbook| +|**--source-type**|choice|The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.|source_type| +|**--security-token**|object|The authorization token for the repo of the source control.|security_token| +|**--description**|string|The user description of the source control.|description| +### automation source-control delete + +delete a automation source-control. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--source-control-name**|string|The name of source control.|source_control_name| +### automation source-control list + +list a automation source-control. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation source-control show + +show a automation source-control. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--source-control-name**|string|The name of source control.|source_control_name| +### automation source-control update + +update a automation source-control. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--source-control-name**|string|The source control name.|source_control_name| +|**--branch**|string|The repo branch of the source control.|branch| +|**--folder-path**|string|The folder path of the source control. Path must be relative.|folder_path| +|**--auto-sync**|boolean|The auto sync of the source control. Default is false.|auto_sync| +|**--publish-runbook**|boolean|The auto publish of the source control. Default is true.|publish_runbook| +|**--security-token**|object|The authorization token for the repo of the source control.|security_token| +|**--description**|string|The user description of the source control.|description| +### automation source-control-sync-job create + +create a automation source-control-sync-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--source-control-name**|string|The source control name.|source_control_name| +|**--source-control-sync-job-id**|uuid|The source control sync job id.|source_control_sync_job_id| +|**--commit-id**|string|The commit id of the source control sync job. If not syncing to a commitId, enter an empty string.|commit_id| +### automation source-control-sync-job list + +list a automation source-control-sync-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--source-control-name**|string|The source control name.|source_control_name| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation source-control-sync-job show + +show a automation source-control-sync-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--source-control-name**|string|The source control name.|source_control_name| +|**--source-control-sync-job-id**|uuid|The source control sync job id.|source_control_sync_job_id| +### automation source-control-sync-job-stream list + +list a automation source-control-sync-job-stream. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--source-control-name**|string|The source control name.|source_control_name| +|**--source-control-sync-job-id**|uuid|The source control sync job id.|source_control_sync_job_id| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation source-control-sync-job-stream show + +show a automation source-control-sync-job-stream. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--source-control-name**|string|The source control name.|source_control_name| +|**--source-control-sync-job-id**|uuid|The source control sync job id.|source_control_sync_job_id| +|**--stream-id**|string|The id of the sync job stream.|stream_id| +### automation statistics list + +list a automation statistics. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation test-job create + +create a automation test-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The parameters supplied to the create test job operation.|runbook_name| +|**--parameters**|dictionary|Gets or sets the parameters of the test job.|parameters| +|**--run-on**|string|Gets or sets the runOn which specifies the group name where the job is to be executed.|run_on| +### automation test-job resume + +resume a automation test-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +### automation test-job show + +show a automation test-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +### automation test-job stop + +stop a automation test-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +### automation test-job suspend + +suspend a automation test-job. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +### automation test-job-stream list + +list a automation test-job-stream. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation test-job-stream show + +show a automation test-job-stream. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--runbook-name**|string|The runbook name.|runbook_name| +|**--job-stream-id**|string|The job stream id.|job_stream_id| +### automation usage list + +list a automation usage. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation variable create + +create a automation variable. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--variable-name**|string|The variable name.|variable_name| +|**--name**|string|Gets or sets the name of the variable.|name| +|**--value**|string|Gets or sets the value of the variable.|value| +|**--description**|string|Gets or sets the description of the variable.|description| +|**--is-encrypted**|boolean|Gets or sets the encrypted flag of the variable.|is_encrypted| +### automation variable delete + +delete a automation variable. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--variable-name**|string|The name of variable.|variable_name| +### automation variable list + +list a automation variable. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation variable show + +show a automation variable. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--variable-name**|string|The name of variable.|variable_name| +### automation variable update + +update a automation variable. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--variable-name**|string|The variable name.|variable_name| +|**--name**|string|Gets or sets the name of the variable.|name| +|**--value**|string|Gets or sets the value of the variable.|value| +|**--description**|string|Gets or sets the description of the variable.|description| +### automation watcher create + +create a automation watcher. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--watcher-name**|string|The watcher name.|watcher_name| +|**--tags**|dictionary|Resource tags.|tags| +|**--location**|string|The Azure Region where the resource lives|location| +|**--etag**|string|Gets or sets the etag of the resource.|etag| +|**--execution-frequency-in-seconds**|integer|Gets or sets the frequency at which the watcher is invoked.|execution_frequency_in_seconds| +|**--script-name**|string|Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.|script_name| +|**--script-parameters**|dictionary|Gets or sets the parameters of the script.|script_parameters| +|**--script-run-on**|string|Gets or sets the name of the hybrid worker group the watcher will run on.|script_run_on| +|**--description**|string|Gets or sets the description.|description| +### automation watcher delete + +delete a automation watcher. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--watcher-name**|string|The watcher name.|watcher_name| +### automation watcher list + +list a automation watcher. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation watcher show + +show a automation watcher. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--watcher-name**|string|The watcher name.|watcher_name| +### automation watcher start + +start a automation watcher. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--watcher-name**|string|The watcher name.|watcher_name| +### automation watcher stop + +stop a automation watcher. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--watcher-name**|string|The watcher name.|watcher_name| +### automation watcher update + +update a automation watcher. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--watcher-name**|string|The watcher name.|watcher_name| +|**--name**|string|Gets or sets the name of the resource.|name| +|**--execution-frequency-in-seconds**|integer|Gets or sets the frequency at which the watcher is invoked.|execution_frequency_in_seconds| +### automation webhook create + +create a automation webhook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--webhook-name**|string|The webhook name.|webhook_name| +|**--name**|string|Gets or sets the name of the webhook.|name| +|**--is-enabled**|boolean|Gets or sets the value of the enabled flag of webhook.|is_enabled| +|**--uri**|string|Gets or sets the uri.|uri| +|**--expiry-time**|date-time|Gets or sets the expiry time.|expiry_time| +|**--parameters**|dictionary|Gets or sets the parameters of the job.|parameters| +|**--runbook**|object|Gets or sets the runbook.|runbook| +|**--run-on**|string|Gets or sets the name of the hybrid worker group the webhook job will run on.|run_on| +### automation webhook delete + +delete a automation webhook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--webhook-name**|string|The webhook name.|webhook_name| +### automation webhook generate-uri + +generate-uri a automation webhook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +### automation webhook list + +list a automation webhook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--filter**|string|The filter to apply on the operation.|filter| +### automation webhook show + +show a automation webhook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--webhook-name**|string|The webhook name.|webhook_name| +### automation webhook update + +update a automation webhook. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of an Azure Resource group.|resource_group_name| +|**--automation-account-name**|string|The name of the automation account.|automation_account_name| +|**--webhook-name**|string|The webhook name.|webhook_name| +|**--name**|string|Gets or sets the name of the webhook.|name| +|**--is-enabled**|boolean|Gets or sets the value of the enabled flag of webhook.|is_enabled| +|**--run-on**|string|Gets or sets the name of the hybrid worker group the webhook job will run on.|run_on| +|**--parameters**|dictionary|Gets or sets the parameters of the job.|parameters| +|**--description**|string|Gets or sets the description of the webhook.|description| \ No newline at end of file diff --git a/src/automation/setup.cfg b/src/automation/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/automation/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/automation/setup.py b/src/automation/setup.py new file mode 100644 index 00000000000..ad9a51e712b --- /dev/null +++ b/src/automation/setup.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# TODO: Confirm this is the right version number you want and it matches your +# HISTORY.rst entry. +VERSION = '0.1.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = [] + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='automation', + version=VERSION, + description='Microsoft Azure Command-Line Tools AutomationClient Extension', + # TODO: Update author and email, if applicable + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + # TODO: consider pointing directly to your source code instead of the generic repo + url='https://github.com/Azure/azure-cli-extensions', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_automation': ['azext_metadata.json']}, +)