From 12d58530afc6896a7989a3c0f3e6b27b5d94a934 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 14 Sep 2018 12:45:10 -0700 Subject: [PATCH] [AutoPR automation/resource-manager] New tag for 2018-06 APIs for Automation (#3354) * Generated from 8caea7ee753f56b10f8b26a010d1d8287cb33607 Added missing property to make JobStreamProperties definitions identical * Packaging update of azure-mgmt-automation --- azure-mgmt-automation/HISTORY.rst | 9 + azure-mgmt-automation/MANIFEST.in | 2 + azure-mgmt-automation/README.rst | 49 +++++ azure-mgmt-automation/azure/__init__.py | 1 + azure-mgmt-automation/azure/mgmt/__init__.py | 1 + .../mgmt/automation/automation_client.py | 40 ++--- .../azure/mgmt/automation/models/__init__.py | 100 +++++------ .../models/automation_client_enums.py | 168 +++++++++--------- .../models/runbook_draft_undo_edit_result.py | 2 +- .../runbook_draft_undo_edit_result_py3.py | 2 +- .../mgmt/automation/operations/__init__.py | 16 +- .../operations/runbook_draft_operations.py | 132 ++------------ .../operations/runbook_operations.py | 113 ++++++++++-- .../operations/test_job_operations.py | 4 +- .../operations/test_job_streams_operations.py | 4 +- .../azure/mgmt/automation/version.py | 2 +- azure-mgmt-automation/azure_bdist_wheel.py | 54 ++++++ azure-mgmt-automation/sdk_packaging.toml | 6 + azure-mgmt-automation/setup.cfg | 3 + azure-mgmt-automation/setup.py | 86 +++++++++ 20 files changed, 498 insertions(+), 296 deletions(-) create mode 100644 azure-mgmt-automation/HISTORY.rst create mode 100644 azure-mgmt-automation/MANIFEST.in create mode 100644 azure-mgmt-automation/README.rst create mode 100644 azure-mgmt-automation/azure/__init__.py create mode 100644 azure-mgmt-automation/azure/mgmt/__init__.py create mode 100644 azure-mgmt-automation/azure_bdist_wheel.py create mode 100644 azure-mgmt-automation/sdk_packaging.toml create mode 100644 azure-mgmt-automation/setup.cfg create mode 100644 azure-mgmt-automation/setup.py diff --git a/azure-mgmt-automation/HISTORY.rst b/azure-mgmt-automation/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-automation/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-automation/MANIFEST.in b/azure-mgmt-automation/MANIFEST.in new file mode 100644 index 000000000000..9ecaeb15de50 --- /dev/null +++ b/azure-mgmt-automation/MANIFEST.in @@ -0,0 +1,2 @@ +include *.rst +include azure_bdist_wheel.py \ No newline at end of file diff --git a/azure-mgmt-automation/README.rst b/azure-mgmt-automation/README.rst new file mode 100644 index 000000000000..45de4e6b43dd --- /dev/null +++ b/azure-mgmt-automation/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-automation/azure/__init__.py b/azure-mgmt-automation/azure/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/azure-mgmt-automation/azure/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/azure-mgmt-automation/azure/mgmt/__init__.py b/azure-mgmt-automation/azure/mgmt/__init__.py new file mode 100644 index 000000000000..de40ea7ca058 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/azure-mgmt-automation/azure/mgmt/automation/automation_client.py b/azure-mgmt-automation/azure/mgmt/automation/automation_client.py index 14d92c7ec336..5b2926ecd3ed 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/automation_client.py +++ b/azure-mgmt-automation/azure/mgmt/automation/automation_client.py @@ -30,10 +30,6 @@ from .operations.module_operations import ModuleOperations from .operations.object_data_types_operations import ObjectDataTypesOperations from .operations.fields_operations import FieldsOperations -from .operations.runbook_draft_operations import RunbookDraftOperations -from .operations.runbook_operations import RunbookOperations -from .operations.test_job_streams_operations import TestJobStreamsOperations -from .operations.test_job_operations import TestJobOperations from .operations.schedule_operations import ScheduleOperations from .operations.variable_operations import VariableOperations from .operations.webhook_operations import WebhookOperations @@ -53,6 +49,10 @@ from .operations.dsc_compilation_job_stream_operations import DscCompilationJobStreamOperations from .operations.dsc_node_configuration_operations import DscNodeConfigurationOperations from .operations.node_count_information_operations import NodeCountInformationOperations +from .operations.runbook_draft_operations import RunbookDraftOperations +from .operations.runbook_operations import RunbookOperations +from .operations.test_job_streams_operations import TestJobStreamsOperations +from .operations.test_job_operations import TestJobOperations from . import models @@ -136,14 +136,6 @@ class AutomationClient(SDKClient): :vartype object_data_types: azure.mgmt.automation.operations.ObjectDataTypesOperations :ivar fields: Fields operations :vartype fields: azure.mgmt.automation.operations.FieldsOperations - :ivar runbook_draft: RunbookDraft operations - :vartype runbook_draft: azure.mgmt.automation.operations.RunbookDraftOperations - :ivar runbook: Runbook operations - :vartype runbook: azure.mgmt.automation.operations.RunbookOperations - :ivar test_job_streams: TestJobStreams operations - :vartype test_job_streams: azure.mgmt.automation.operations.TestJobStreamsOperations - :ivar test_job: TestJob operations - :vartype test_job: azure.mgmt.automation.operations.TestJobOperations :ivar schedule: Schedule operations :vartype schedule: azure.mgmt.automation.operations.ScheduleOperations :ivar variable: Variable operations @@ -182,6 +174,14 @@ class AutomationClient(SDKClient): :vartype dsc_node_configuration: azure.mgmt.automation.operations.DscNodeConfigurationOperations :ivar node_count_information: NodeCountInformation operations :vartype node_count_information: azure.mgmt.automation.operations.NodeCountInformationOperations + :ivar runbook_draft: RunbookDraft operations + :vartype runbook_draft: azure.mgmt.automation.operations.RunbookDraftOperations + :ivar runbook: Runbook operations + :vartype runbook: azure.mgmt.automation.operations.RunbookOperations + :ivar test_job_streams: TestJobStreams operations + :vartype test_job_streams: azure.mgmt.automation.operations.TestJobStreamsOperations + :ivar test_job: TestJob operations + :vartype test_job: azure.mgmt.automation.operations.TestJobOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -240,14 +240,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.fields = FieldsOperations( self._client, self.config, self._serialize, self._deserialize) - self.runbook_draft = RunbookDraftOperations( - self._client, self.config, self._serialize, self._deserialize) - self.runbook = RunbookOperations( - self._client, self.config, self._serialize, self._deserialize) - self.test_job_streams = TestJobStreamsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.test_job = TestJobOperations( - self._client, self.config, self._serialize, self._deserialize) self.schedule = ScheduleOperations( self._client, self.config, self._serialize, self._deserialize) self.variable = VariableOperations( @@ -286,3 +278,11 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.node_count_information = NodeCountInformationOperations( self._client, self.config, self._serialize, self._deserialize) + self.runbook_draft = RunbookDraftOperations( + self._client, self.config, self._serialize, self._deserialize) + self.runbook = RunbookOperations( + self._client, self.config, self._serialize, self._deserialize) + self.test_job_streams = TestJobStreamsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.test_job = TestJobOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py b/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py index bcffa10b0f8a..71e2afbed9c7 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py +++ b/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py @@ -64,18 +64,6 @@ from .module_create_or_update_parameters_py3 import ModuleCreateOrUpdateParameters from .module_update_parameters_py3 import ModuleUpdateParameters from .type_field_py3 import TypeField - from .runbook_parameter_py3 import RunbookParameter - from .runbook_draft_py3 import RunbookDraft - from .runbook_py3 import Runbook - from .runbook_create_or_update_parameters_py3 import RunbookCreateOrUpdateParameters - from .runbook_update_parameters_py3 import RunbookUpdateParameters - from .runbook_draft_undo_edit_result_py3 import RunbookDraftUndoEditResult - from .test_job_create_parameters_py3 import TestJobCreateParameters - from .test_job_py3 import TestJob - from .runbook_create_or_update_draft_properties_py3 import RunbookCreateOrUpdateDraftProperties - from .runbook_create_or_update_draft_parameters_py3 import RunbookCreateOrUpdateDraftParameters - from .job_stream_py3 import JobStream - from .job_stream_list_result_py3 import JobStreamListResult from .advanced_schedule_monthly_occurrence_py3 import AdvancedScheduleMonthlyOccurrence from .advanced_schedule_py3 import AdvancedSchedule from .schedule_create_or_update_parameters_py3 import ScheduleCreateOrUpdateParameters @@ -112,6 +100,8 @@ from .source_control_sync_job_by_id_py3 import SourceControlSyncJobById from .source_control_sync_job_stream_py3 import SourceControlSyncJobStream from .source_control_sync_job_stream_by_id_py3 import SourceControlSyncJobStreamById + from .job_stream_py3 import JobStream + from .job_stream_list_result_py3 import JobStreamListResult from .job_py3 import Job from .job_collection_item_py3 import JobCollectionItem from .job_create_parameters_py3 import JobCreateParameters @@ -135,6 +125,16 @@ from .node_count_properties_py3 import NodeCountProperties from .node_count_py3 import NodeCount from .node_counts_py3 import NodeCounts + from .runbook_parameter_py3 import RunbookParameter + from .runbook_draft_py3 import RunbookDraft + from .runbook_py3 import Runbook + from .runbook_create_or_update_parameters_py3 import RunbookCreateOrUpdateParameters + from .runbook_update_parameters_py3 import RunbookUpdateParameters + from .runbook_draft_undo_edit_result_py3 import RunbookDraftUndoEditResult + from .test_job_create_parameters_py3 import TestJobCreateParameters + from .test_job_py3 import TestJob + from .runbook_create_or_update_draft_properties_py3 import RunbookCreateOrUpdateDraftProperties + from .runbook_create_or_update_draft_parameters_py3 import RunbookCreateOrUpdateDraftParameters except (SyntaxError, ImportError): from .sku import Sku from .automation_account import AutomationAccount @@ -190,18 +190,6 @@ from .module_create_or_update_parameters import ModuleCreateOrUpdateParameters from .module_update_parameters import ModuleUpdateParameters from .type_field import TypeField - from .runbook_parameter import RunbookParameter - from .runbook_draft import RunbookDraft - from .runbook import Runbook - from .runbook_create_or_update_parameters import RunbookCreateOrUpdateParameters - from .runbook_update_parameters import RunbookUpdateParameters - from .runbook_draft_undo_edit_result import RunbookDraftUndoEditResult - from .test_job_create_parameters import TestJobCreateParameters - from .test_job import TestJob - from .runbook_create_or_update_draft_properties import RunbookCreateOrUpdateDraftProperties - from .runbook_create_or_update_draft_parameters import RunbookCreateOrUpdateDraftParameters - from .job_stream import JobStream - from .job_stream_list_result import JobStreamListResult from .advanced_schedule_monthly_occurrence import AdvancedScheduleMonthlyOccurrence from .advanced_schedule import AdvancedSchedule from .schedule_create_or_update_parameters import ScheduleCreateOrUpdateParameters @@ -238,6 +226,8 @@ from .source_control_sync_job_by_id import SourceControlSyncJobById from .source_control_sync_job_stream import SourceControlSyncJobStream from .source_control_sync_job_stream_by_id import SourceControlSyncJobStreamById + from .job_stream import JobStream + from .job_stream_list_result import JobStreamListResult from .job import Job from .job_collection_item import JobCollectionItem from .job_create_parameters import JobCreateParameters @@ -261,6 +251,16 @@ from .node_count_properties import NodeCountProperties from .node_count import NodeCount from .node_counts import NodeCounts + from .runbook_parameter import RunbookParameter + from .runbook_draft import RunbookDraft + from .runbook import Runbook + from .runbook_create_or_update_parameters import RunbookCreateOrUpdateParameters + from .runbook_update_parameters import RunbookUpdateParameters + from .runbook_draft_undo_edit_result import RunbookDraftUndoEditResult + from .test_job_create_parameters import TestJobCreateParameters + from .test_job import TestJob + from .runbook_create_or_update_draft_properties import RunbookCreateOrUpdateDraftProperties + from .runbook_create_or_update_draft_parameters import RunbookCreateOrUpdateDraftParameters from .automation_account_paged import AutomationAccountPaged from .operation_paged import OperationPaged from .statistics_paged import StatisticsPaged @@ -275,8 +275,6 @@ from .activity_paged import ActivityPaged from .module_paged import ModulePaged from .type_field_paged import TypeFieldPaged -from .runbook_paged import RunbookPaged -from .job_stream_paged import JobStreamPaged from .schedule_paged import SchedulePaged from .variable_paged import VariablePaged from .webhook_paged import WebhookPaged @@ -285,10 +283,12 @@ from .source_control_sync_job_paged import SourceControlSyncJobPaged from .source_control_sync_job_stream_paged import SourceControlSyncJobStreamPaged from .job_collection_item_paged import JobCollectionItemPaged +from .job_stream_paged import JobStreamPaged from .dsc_node_paged import DscNodePaged from .dsc_node_report_paged import DscNodeReportPaged from .dsc_compilation_job_paged import DscCompilationJobPaged from .dsc_node_configuration_paged import DscNodeConfigurationPaged +from .runbook_paged import RunbookPaged from .automation_client_enums import ( SkuNameEnum, AutomationAccountState, @@ -299,11 +299,6 @@ DscConfigurationState, GroupTypeEnum, ModuleProvisioningState, - RunbookTypeEnum, - RunbookState, - RunbookProvisioningState, - HttpStatusCode, - JobStreamType, ScheduleDay, ScheduleFrequency, OperatingSystemType, @@ -314,9 +309,14 @@ ProvisioningState, SyncType, StreamType, + JobStreamType, JobStatus, JobProvisioningState, AgentRegistrationKeyName, + RunbookTypeEnum, + RunbookState, + RunbookProvisioningState, + HttpStatusCode, CountType, ) @@ -375,18 +375,6 @@ 'ModuleCreateOrUpdateParameters', 'ModuleUpdateParameters', 'TypeField', - 'RunbookParameter', - 'RunbookDraft', - 'Runbook', - 'RunbookCreateOrUpdateParameters', - 'RunbookUpdateParameters', - 'RunbookDraftUndoEditResult', - 'TestJobCreateParameters', - 'TestJob', - 'RunbookCreateOrUpdateDraftProperties', - 'RunbookCreateOrUpdateDraftParameters', - 'JobStream', - 'JobStreamListResult', 'AdvancedScheduleMonthlyOccurrence', 'AdvancedSchedule', 'ScheduleCreateOrUpdateParameters', @@ -423,6 +411,8 @@ 'SourceControlSyncJobById', 'SourceControlSyncJobStream', 'SourceControlSyncJobStreamById', + 'JobStream', + 'JobStreamListResult', 'Job', 'JobCollectionItem', 'JobCreateParameters', @@ -446,6 +436,16 @@ 'NodeCountProperties', 'NodeCount', 'NodeCounts', + 'RunbookParameter', + 'RunbookDraft', + 'Runbook', + 'RunbookCreateOrUpdateParameters', + 'RunbookUpdateParameters', + 'RunbookDraftUndoEditResult', + 'TestJobCreateParameters', + 'TestJob', + 'RunbookCreateOrUpdateDraftProperties', + 'RunbookCreateOrUpdateDraftParameters', 'AutomationAccountPaged', 'OperationPaged', 'StatisticsPaged', @@ -460,8 +460,6 @@ 'ActivityPaged', 'ModulePaged', 'TypeFieldPaged', - 'RunbookPaged', - 'JobStreamPaged', 'SchedulePaged', 'VariablePaged', 'WebhookPaged', @@ -470,10 +468,12 @@ 'SourceControlSyncJobPaged', 'SourceControlSyncJobStreamPaged', 'JobCollectionItemPaged', + 'JobStreamPaged', 'DscNodePaged', 'DscNodeReportPaged', 'DscCompilationJobPaged', 'DscNodeConfigurationPaged', + 'RunbookPaged', 'SkuNameEnum', 'AutomationAccountState', 'AutomationKeyName', @@ -483,11 +483,6 @@ 'DscConfigurationState', 'GroupTypeEnum', 'ModuleProvisioningState', - 'RunbookTypeEnum', - 'RunbookState', - 'RunbookProvisioningState', - 'HttpStatusCode', - 'JobStreamType', 'ScheduleDay', 'ScheduleFrequency', 'OperatingSystemType', @@ -498,8 +493,13 @@ 'ProvisioningState', 'SyncType', 'StreamType', + 'JobStreamType', 'JobStatus', 'JobProvisioningState', 'AgentRegistrationKeyName', + 'RunbookTypeEnum', + 'RunbookState', + 'RunbookProvisioningState', + 'HttpStatusCode', 'CountType', ] diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py index 27ff5fc7e27c..a8709b1ba7f8 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py @@ -81,90 +81,6 @@ class ModuleProvisioningState(str, Enum): updating = "Updating" -class RunbookTypeEnum(str, Enum): - - script = "Script" - graph = "Graph" - power_shell_workflow = "PowerShellWorkflow" - power_shell = "PowerShell" - graph_power_shell_workflow = "GraphPowerShellWorkflow" - graph_power_shell = "GraphPowerShell" - - -class RunbookState(str, Enum): - - new = "New" - edit = "Edit" - published = "Published" - - -class RunbookProvisioningState(str, Enum): - - succeeded = "Succeeded" - - -class HttpStatusCode(str, Enum): - - continue_enum = "Continue" - switching_protocols = "SwitchingProtocols" - ok = "OK" - created = "Created" - accepted = "Accepted" - non_authoritative_information = "NonAuthoritativeInformation" - no_content = "NoContent" - reset_content = "ResetContent" - partial_content = "PartialContent" - multiple_choices = "MultipleChoices" - ambiguous = "Ambiguous" - moved_permanently = "MovedPermanently" - moved = "Moved" - found = "Found" - redirect = "Redirect" - see_other = "SeeOther" - redirect_method = "RedirectMethod" - not_modified = "NotModified" - use_proxy = "UseProxy" - unused = "Unused" - temporary_redirect = "TemporaryRedirect" - redirect_keep_verb = "RedirectKeepVerb" - bad_request = "BadRequest" - unauthorized = "Unauthorized" - payment_required = "PaymentRequired" - forbidden = "Forbidden" - not_found = "NotFound" - method_not_allowed = "MethodNotAllowed" - not_acceptable = "NotAcceptable" - proxy_authentication_required = "ProxyAuthenticationRequired" - request_timeout = "RequestTimeout" - conflict = "Conflict" - gone = "Gone" - length_required = "LengthRequired" - precondition_failed = "PreconditionFailed" - request_entity_too_large = "RequestEntityTooLarge" - request_uri_too_long = "RequestUriTooLong" - unsupported_media_type = "UnsupportedMediaType" - requested_range_not_satisfiable = "RequestedRangeNotSatisfiable" - expectation_failed = "ExpectationFailed" - upgrade_required = "UpgradeRequired" - internal_server_error = "InternalServerError" - not_implemented = "NotImplemented" - bad_gateway = "BadGateway" - service_unavailable = "ServiceUnavailable" - gateway_timeout = "GatewayTimeout" - http_version_not_supported = "HttpVersionNotSupported" - - -class JobStreamType(str, Enum): - - progress = "Progress" - output = "Output" - warning = "Warning" - error = "Error" - debug = "Debug" - verbose = "Verbose" - any = "Any" - - class ScheduleDay(str, Enum): monday = "Monday" @@ -244,6 +160,17 @@ class StreamType(str, Enum): output = "Output" +class JobStreamType(str, Enum): + + progress = "Progress" + output = "Output" + warning = "Warning" + error = "Error" + debug = "Debug" + verbose = "Verbose" + any = "Any" + + class JobStatus(str, Enum): new = "New" @@ -275,6 +202,79 @@ class AgentRegistrationKeyName(str, Enum): secondary = "secondary" +class RunbookTypeEnum(str, Enum): + + script = "Script" + graph = "Graph" + power_shell_workflow = "PowerShellWorkflow" + power_shell = "PowerShell" + graph_power_shell_workflow = "GraphPowerShellWorkflow" + graph_power_shell = "GraphPowerShell" + + +class RunbookState(str, Enum): + + new = "New" + edit = "Edit" + published = "Published" + + +class RunbookProvisioningState(str, Enum): + + succeeded = "Succeeded" + + +class HttpStatusCode(str, Enum): + + continue_enum = "Continue" + switching_protocols = "SwitchingProtocols" + ok = "OK" + created = "Created" + accepted = "Accepted" + non_authoritative_information = "NonAuthoritativeInformation" + no_content = "NoContent" + reset_content = "ResetContent" + partial_content = "PartialContent" + multiple_choices = "MultipleChoices" + ambiguous = "Ambiguous" + moved_permanently = "MovedPermanently" + moved = "Moved" + found = "Found" + redirect = "Redirect" + see_other = "SeeOther" + redirect_method = "RedirectMethod" + not_modified = "NotModified" + use_proxy = "UseProxy" + unused = "Unused" + temporary_redirect = "TemporaryRedirect" + redirect_keep_verb = "RedirectKeepVerb" + bad_request = "BadRequest" + unauthorized = "Unauthorized" + payment_required = "PaymentRequired" + forbidden = "Forbidden" + not_found = "NotFound" + method_not_allowed = "MethodNotAllowed" + not_acceptable = "NotAcceptable" + proxy_authentication_required = "ProxyAuthenticationRequired" + request_timeout = "RequestTimeout" + conflict = "Conflict" + gone = "Gone" + length_required = "LengthRequired" + precondition_failed = "PreconditionFailed" + request_entity_too_large = "RequestEntityTooLarge" + request_uri_too_long = "RequestUriTooLong" + unsupported_media_type = "UnsupportedMediaType" + requested_range_not_satisfiable = "RequestedRangeNotSatisfiable" + expectation_failed = "ExpectationFailed" + upgrade_required = "UpgradeRequired" + internal_server_error = "InternalServerError" + not_implemented = "NotImplemented" + bad_gateway = "BadGateway" + service_unavailable = "ServiceUnavailable" + gateway_timeout = "GatewayTimeout" + http_version_not_supported = "HttpVersionNotSupported" + + class CountType(str, Enum): status = "status" diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py index ceab272b7b23..bafb74b4f931 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py @@ -35,7 +35,7 @@ class RunbookDraftUndoEditResult(Model): """ _attribute_map = { - 'status_code': {'key': 'statusCode', 'type': 'HttpStatusCode'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, 'request_id': {'key': 'requestId', 'type': 'str'}, } diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result_py3.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result_py3.py index 5ad27eb0cfdd..5811fe97d522 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result_py3.py +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result_py3.py @@ -35,7 +35,7 @@ class RunbookDraftUndoEditResult(Model): """ _attribute_map = { - 'status_code': {'key': 'statusCode', 'type': 'HttpStatusCode'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, 'request_id': {'key': 'requestId', 'type': 'str'}, } diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py b/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py index 89b6b666b52b..25f505bff5fc 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py @@ -26,10 +26,6 @@ from .module_operations import ModuleOperations from .object_data_types_operations import ObjectDataTypesOperations from .fields_operations import FieldsOperations -from .runbook_draft_operations import RunbookDraftOperations -from .runbook_operations import RunbookOperations -from .test_job_streams_operations import TestJobStreamsOperations -from .test_job_operations import TestJobOperations from .schedule_operations import ScheduleOperations from .variable_operations import VariableOperations from .webhook_operations import WebhookOperations @@ -49,6 +45,10 @@ from .dsc_compilation_job_stream_operations import DscCompilationJobStreamOperations from .dsc_node_configuration_operations import DscNodeConfigurationOperations from .node_count_information_operations import NodeCountInformationOperations +from .runbook_draft_operations import RunbookDraftOperations +from .runbook_operations import RunbookOperations +from .test_job_streams_operations import TestJobStreamsOperations +from .test_job_operations import TestJobOperations __all__ = [ 'AutomationAccountOperations', @@ -68,10 +68,6 @@ 'ModuleOperations', 'ObjectDataTypesOperations', 'FieldsOperations', - 'RunbookDraftOperations', - 'RunbookOperations', - 'TestJobStreamsOperations', - 'TestJobOperations', 'ScheduleOperations', 'VariableOperations', 'WebhookOperations', @@ -91,4 +87,8 @@ 'DscCompilationJobStreamOperations', 'DscNodeConfigurationOperations', 'NodeCountInformationOperations', + 'RunbookDraftOperations', + 'RunbookOperations', + 'TestJobStreamsOperations', + 'TestJobOperations', ] diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py index 37644686bc1f..d33ca52531ed 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py @@ -25,7 +25,7 @@ class RunbookDraftOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-10-31". + :ivar api_version: Client Api Version. Constant value: "2018-06-30". """ models = models @@ -35,12 +35,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-10-31" + self.api_version = "2018-06-30" self.config = config def get_content( - self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, callback=None, **operation_config): + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): """Retrieve the content of runbook draft identified by runbook name. :param resource_group_name: Name of an Azure Resource group. @@ -52,15 +52,10 @@ def get_content( :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response - :param callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -89,7 +84,7 @@ def get_content( # Construct and send request request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -99,7 +94,7 @@ def get_content( deserialized = None if response.status_code == 200: - deserialized = self._client.stream_download(response, callback) + deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -110,7 +105,7 @@ def get_content( def _replace_content_initial( - self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, **operation_config): + self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.replace_content.metadata['url'] path_format_arguments = { @@ -137,7 +132,7 @@ def _replace_content_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = upload_gen(runbook_content) + body_content = self._serialize.body(runbook_content, 'str') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -150,7 +145,7 @@ def _replace_content_initial( header_dict = {} if response.status_code == 200: - deserialized = self._deserialize('object', response) + deserialized = self._deserialize('str', response) header_dict = { 'location': 'str', } @@ -163,7 +158,7 @@ def _replace_content_initial( return deserialized def replace_content( - self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, polling=True, **operation_config): + self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, polling=True, **operation_config): """Replaces the runbook draft content. :param resource_group_name: Name of an Azure Resource group. @@ -172,18 +167,17 @@ def replace_content( :type automation_account_name: str :param runbook_name: The runbook name. :type runbook_name: str - :param runbook_content: The runbook draft content. - :type runbook_content: Generator + :param runbook_content: The runbook draft content. + :type runbook_content: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[Generator] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[Generator]] + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`ErrorResponseException` """ @@ -201,7 +195,7 @@ def get_long_running_output(response): header_dict = { 'location': 'str', } - deserialized = self._deserialize('object', response) + deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -283,96 +277,6 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft'} - - def _publish_initial( - self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.publish.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), - 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), - 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202]: - raise models.ErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - header_dict = { - 'location': 'str', - } - client_raw_response.add_headers(header_dict) - return client_raw_response - - def publish( - self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Publish runbook draft. - - :param resource_group_name: Name of an Azure Resource group. - :type resource_group_name: str - :param automation_account_name: The name of the automation account. - :type automation_account_name: str - :param runbook_name: The parameters supplied to the publish runbook - operation. - :type runbook_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._publish_initial( - resource_group_name=resource_group_name, - automation_account_name=automation_account_name, - runbook_name=runbook_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - client_raw_response.add_headers({ - 'location': 'str', - }) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - publish.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish'} - def undo_edit( self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): """Undo draft edit to last known published state identified by runbook diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py index 9d43688ec94b..8e0de36b282b 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -23,7 +25,7 @@ class RunbookOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-10-31". + :ivar api_version: Client Api Version. Constant value: "2018-06-30". """ models = models @@ -33,12 +35,102 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-10-31" + self.api_version = "2018-06-30" self.config = config + + def _publish_initial( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.publish.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'location': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def publish( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Publish runbook draft. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the publish runbook + operation. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._publish_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'location': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + publish.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/publish'} + def get_content( - self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, callback=None, **operation_config): + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): """Retrieve the content of runbook identified by runbook name. :param resource_group_name: Name of an Azure Resource group. @@ -50,15 +142,10 @@ def get_content( :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response - :param callback: When specified, will be called with each chunk of - data that is streamed. The callback should take two arguments, the - bytes of the current chunk of data and the response object. If the - data is uploading, response will be None. - :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -87,7 +174,7 @@ def get_content( # Construct and send request request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=True, **operation_config) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -97,7 +184,7 @@ def get_content( deserialized = None if response.status_code == 200: - deserialized = self._client.stream_download(response, callback) + deserialized = self._deserialize('str', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -228,7 +315,7 @@ def create_or_update( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201, 400]: + if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_operations.py index 9e886f2303b3..f2657d5b8e12 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_operations.py +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_operations.py @@ -22,7 +22,7 @@ class TestJobOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-10-31". + :ivar api_version: Client Api Version. Constant value: "2018-06-30". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-10-31" + self.api_version = "2018-06-30" self.config = config diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py index 91b476306237..93e5d74e3993 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py @@ -22,7 +22,7 @@ class TestJobStreamsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-10-31". + :ivar api_version: Client Api Version. Constant value: "2018-06-30". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-10-31" + self.api_version = "2018-06-30" self.config = config diff --git a/azure-mgmt-automation/azure/mgmt/automation/version.py b/azure-mgmt-automation/azure/mgmt/automation/version.py index 9bd1dfac7ecb..3e682bbd5fb1 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/version.py +++ b/azure-mgmt-automation/azure/mgmt/automation/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.2.0" +VERSION = "0.3.0" diff --git a/azure-mgmt-automation/azure_bdist_wheel.py b/azure-mgmt-automation/azure_bdist_wheel.py new file mode 100644 index 000000000000..8a81d1b61775 --- /dev/null +++ b/azure-mgmt-automation/azure_bdist_wheel.py @@ -0,0 +1,54 @@ +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +from distutils import log as logger +import os.path + +from wheel.bdist_wheel import bdist_wheel +class azure_bdist_wheel(bdist_wheel): + """The purpose of this class is to build wheel a little differently than the sdist, + without requiring to build the wheel from the sdist (i.e. you can build the wheel + directly from source). + """ + + description = "Create an Azure wheel distribution" + + user_options = bdist_wheel.user_options + \ + [('azure-namespace-package=', None, + "Name of the deepest nspkg used")] + + def initialize_options(self): + bdist_wheel.initialize_options(self) + self.azure_namespace_package = None + + def finalize_options(self): + bdist_wheel.finalize_options(self) + if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): + raise ValueError("azure_namespace_package must finish by -nspkg") + + def run(self): + if not self.distribution.install_requires: + self.distribution.install_requires = [] + self.distribution.install_requires.append( + "{}>=2.0.0".format(self.azure_namespace_package)) + bdist_wheel.run(self) + + def write_record(self, bdist_dir, distinfo_dir): + if self.azure_namespace_package: + # Split and remove last part, assuming it's "nspkg" + subparts = self.azure_namespace_package.split('-')[0:-1] + folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] + for azure_sub_package in folder_with_init: + init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') + if os.path.isfile(init_file): + logger.info("manually remove {} while building the wheel".format(init_file)) + os.remove(init_file) + else: + raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) + bdist_wheel.write_record(self, bdist_dir, distinfo_dir) +cmdclass = { + 'bdist_wheel': azure_bdist_wheel, +} diff --git a/azure-mgmt-automation/sdk_packaging.toml b/azure-mgmt-automation/sdk_packaging.toml new file mode 100644 index 000000000000..cc62c94a76f8 --- /dev/null +++ b/azure-mgmt-automation/sdk_packaging.toml @@ -0,0 +1,6 @@ +[packaging] +package_name = "azure-mgmt-automation" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-automation/setup.cfg b/azure-mgmt-automation/setup.cfg new file mode 100644 index 000000000000..856f4164982c --- /dev/null +++ b/azure-mgmt-automation/setup.cfg @@ -0,0 +1,3 @@ +[bdist_wheel] +universal=1 +azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-automation/setup.py b/azure-mgmt-automation/setup.py new file mode 100644 index 000000000000..ebac31b3d4be --- /dev/null +++ b/azure-mgmt-automation/setup.py @@ -0,0 +1,86 @@ +#!/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. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + cmdclass = {} + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-automation" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=["tests"]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + cmdclass=cmdclass +)