diff --git a/src/migrate/HISTORY.rst b/src/migrate/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/migrate/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/migrate/README.rst b/src/migrate/README.rst new file mode 100644 index 00000000000..4287ed62d38 --- /dev/null +++ b/src/migrate/README.rst @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'migrate' Extension +========================================== + +This package is for the 'migrate' extension. +i.e. 'az migrate' diff --git a/src/migrate/azext_migrate/__init__.py b/src/migrate/azext_migrate/__init__.py new file mode 100644 index 00000000000..5e873ddd688 --- /dev/null +++ b/src/migrate/azext_migrate/__init__.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from .generated._help import helps # pylint: disable=unused-import + + +class AzureMigrateCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from .generated._client_factory import cf_migrate + migrate_custom = CliCommandType( + operations_tmpl='azext_migrate.custom#{}', + client_factory=cf_migrate) + super(AzureMigrateCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=migrate_custom) + + def load_command_table(self, args): + from .generated.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from .generated._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = AzureMigrateCommandsLoader diff --git a/src/migrate/azext_migrate/action.py b/src/migrate/azext_migrate/action.py new file mode 100644 index 00000000000..f2fa5d85299 --- /dev/null +++ b/src/migrate/azext_migrate/action.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# 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/migrate/azext_migrate/azext_metadata.json b/src/migrate/azext_migrate/azext_metadata.json new file mode 100644 index 00000000000..55c81bf3328 --- /dev/null +++ b/src/migrate/azext_migrate/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67" +} \ No newline at end of file diff --git a/src/migrate/azext_migrate/commands.py b/src/migrate/azext_migrate/commands.py new file mode 100644 index 00000000000..59721c0d89e --- /dev/null +++ b/src/migrate/azext_migrate/commands.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.commands import * # noqa: F403 +try: + from .manual.commands import * # noqa: F403 +except ImportError: + pass diff --git a/src/migrate/azext_migrate/custom.py b/src/migrate/azext_migrate/custom.py new file mode 100644 index 00000000000..dc155eb1d67 --- /dev/null +++ b/src/migrate/azext_migrate/custom.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# 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/migrate/azext_migrate/generated/_client_factory.py b/src/migrate/azext_migrate/generated/_client_factory.py new file mode 100644 index 00000000000..2bb8e82a442 --- /dev/null +++ b/src/migrate/azext_migrate/generated/_client_factory.py @@ -0,0 +1,34 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_migrate(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.migrate import AzureMigrate + return get_mgmt_service_client(cli_ctx, AzureMigrate) + + +def cf_assessment_option(cli_ctx, *_): + return cf_migrate(cli_ctx).assessment_option + + +def cf_project(cli_ctx, *_): + return cf_migrate(cli_ctx).project + + +def cf_machine(cli_ctx, *_): + return cf_migrate(cli_ctx).machine + + +def cf_group(cli_ctx, *_): + return cf_migrate(cli_ctx).group + + +def cf_assessment(cli_ctx, *_): + return cf_migrate(cli_ctx).assessment + + +def cf_assessed_machine(cli_ctx, *_): + return cf_migrate(cli_ctx).assessed_machine diff --git a/src/migrate/azext_migrate/generated/_help.py b/src/migrate/azext_migrate/generated/_help.py new file mode 100644 index 00000000000..ad503727f75 --- /dev/null +++ b/src/migrate/azext_migrate/generated/_help.py @@ -0,0 +1,242 @@ +# coding=utf-8 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=line-too-long +from knack.help_files import helps # pylint: disable=unused-import + + +helps['migrate assessment-option'] = """ + type: group + short-summary: migrate assessment-option +""" + +helps['migrate assessment-option show'] = """ + type: command + short-summary: Get the available options for the properties of an assessment. + examples: + - name: AssessmentOptions_Get + text: |- + az migrate assessment-option show --location-name "SoutheastAsia" +""" + +helps['migrate project'] = """ + type: group + short-summary: migrate project +""" + +helps['migrate project list'] = """ + type: command + short-summary: Get all the projects in the subscription. + examples: + - name: Projects_List + text: |- + az migrate project list --resource-group "myResourceGroup" +""" + +helps['migrate project show'] = """ + type: command + short-summary: Get the project with the specified name. + examples: + - name: Projects_Get + text: |- + az migrate project show --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate project create'] = """ + type: command + short-summary: Create a project with specified name. If a project already exists, update it. + examples: + - name: Projects_Create + text: |- + az migrate project create --e-tag "\\"b701c73a-0000-0000-0000-59c12ff00000\\"" --location \\ + "West Us" --customer-workspace-id "url-to-customers-service-map" \\ + --customer-workspace-location "West Us" --project-name "project01" --resource-group \\ + "myResourceGroup" +""" + +helps['migrate project update'] = """ + type: command + short-summary: Update a project with specified name. Supports partial updates, for example only tags can be provided. + examples: + - name: Projects_Update + text: |- + az migrate project update --e-tag "" --location "West Us" --customer-workspace-id \\ + "url-to-customers-service-map" --customer-workspace-location "West Us" --project-name \\ + "project01" --resource-group "myResourceGroup" +""" + +helps['migrate project delete'] = """ + type: command + short-summary: Delete the project. Deleting non-existent project is a no-operation. + examples: + - name: Projects_Delete + text: |- + az migrate project delete --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate project get-key'] = """ + type: command + short-summary: Gets the Log Analytics Workspace ID and Primary Key for the specified project. + examples: + - name: Projects_GetKeys + text: |- + az migrate project get-key --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate machine'] = """ + type: group + short-summary: migrate machine +""" + +helps['migrate machine list'] = """ + type: command + short-summary: Get data of all the machines available in the project. Returns a json array of objects of type 'machine' defined in Models section. + examples: + - name: Machines_ListByProject + text: |- + az migrate machine list --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate machine show'] = """ + type: command + short-summary: Get the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + examples: + - name: Machines_Get + text: |- + az migrate machine show --machine-name "amansing_vm1" --project-name "project01" \\ + --resource-group "myResourceGroup" +""" + +helps['migrate group'] = """ + type: group + short-summary: migrate group +""" + +helps['migrate group list'] = """ + type: command + short-summary: Get all groups created in the project. Returns a json array of objects of type 'group' as specified in the Models section. + examples: + - name: Groups_ListByProject + text: |- + az migrate group list --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate group show'] = """ + type: command + short-summary: Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + examples: + - name: Groups_Get + text: |- + az migrate group show --group-name "group01" --project-name "project01" --resource-group \\ + "myResourceGroup" +""" + +helps['migrate group create'] = """ + type: command + short-summary: Create a new group by sending a json object of type 'group' as given in Models section as part of the Request Body. The group name in a project is unique. Labels can be applied on a group as part of creation. If a group with the groupName specified in the URL already exists, then this call acts as an update. This operation is Idempotent. + examples: + - name: Groups_Create + text: |- + az migrate group create --e-tag "\\"1100637e-0000-0000-0000-59f6ed1f0000\\"" --group-name \\ + "group01" --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate group delete'] = """ + type: command + short-summary: Delete the group from the project. The machines remain in the project. Deleting a non-existent group results in a no-operation. A group is an aggregation mechanism for machines in a project. Therefore, deleting group does not delete machines in it. + examples: + - name: Groups_Delete + text: |- + az migrate group delete --group-name "group01" --project-name "project01" \\ + --resource-group "myResourceGroup" +""" + +helps['migrate assessment'] = """ + type: group + short-summary: migrate assessment +""" + +helps['migrate assessment list'] = """ + type: command + short-summary: Get all assessments created in the project. Returns a json array of objects of type 'assessment' as specified in Models section. + examples: + - name: Assessments_ListByGroup + text: |- + az migrate assessment list --group-name "group01" --project-name "project01" \\ + --resource-group "myResourceGroup" +""" + +helps['migrate assessment show'] = """ + type: command + short-summary: Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + examples: + - name: Assessments_Get + text: |- + az migrate assessment show --assessment-name "assessment01" --group-name "group01" \\ + --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate assessment create'] = """ + type: command + short-summary: Create a new assessment with the given name and the specified settings. Since name of an assessment in a project is a unique identifier, if an assessment with the name provided already exists, then the existing assessment is updated. Any PUT operation, resulting in either create or update on an assessment, will cause the assessment to go in a "InProgress" state. This will be indicated by the field 'computationState' on the Assessment object. During this time no other PUT operation will be allowed on that assessment object, nor will a Delete operation. Once the computation for the assessment is complete, the field 'computationState' will be updated to 'Ready', and then other PUT or DELETE operations can happen on the assessment. When assessment is under computation, any PUT will lead to a 400 - Bad Request error. + examples: + - name: Assessments_Create + text: |- + az migrate assessment create --e-tag "\\"1100637e-0000-0000-0000-59f6ed1f0000\\"" \\ + --azure-hybrid-use-benefit "Yes" --azure-location "WestUs" --azure-offer-code \\ + "MSAZR0003P" --azure-pricing-tier "Standard" --azure-storage-redundancy \\ + "LocallyRedundant" --currency "USD" --discount-percentage 100 --percentile "Percentile50" \\ + --scaling-factor 1.2 --sizing-criterion "PerformanceBased" --stage "InProgress" \\ + --time-range "Day" --assessment-name "assessment01" --group-name "group01" --project-name \\ + "project01" --resource-group "myResourceGroup" +""" + +helps['migrate assessment delete'] = """ + type: command + short-summary: Delete an assessment from the project. The machines remain in the assessment. Deleting a non-existent assessment results in a no-operation. When an assessment is under computation, as indicated by the 'computationState' field, it cannot be deleted. Any such attempt will return a 400 - Bad Request. + examples: + - name: Assessments_Delete + text: |- + az migrate assessment delete --assessment-name "assessment01" --group-name "group01" \\ + --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate assessment get-report-download-url'] = """ + type: command + short-summary: Get the URL for downloading the assessment in a report format. + examples: + - name: Assessments_GetReportDownloadUrl + text: |- + az migrate assessment get-report-download-url --assessment-name "assessment01" \\ + --group-name "group01" --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate assessed-machine'] = """ + type: group + short-summary: migrate assessed-machine +""" + +helps['migrate assessed-machine list'] = """ + type: command + short-summary: Get list of machines that assessed as part of the specified assessment. Returns a json array of objects of type 'assessedMachine' as specified in the Models section. Whenever an assessment is created or updated, it goes under computation. During this phase, the 'status' field of Assessment object reports 'Computing'. During the period when the assessment is under computation, the list of assessed machines is empty and no assessed machines are returned by this call. + examples: + - name: AssessedMachines_ListByAssessment + text: |- + az migrate assessed-machine list --assessment-name "assessment01" --group-name "group01" \\ + --project-name "project01" --resource-group "myResourceGroup" +""" + +helps['migrate assessed-machine show'] = """ + type: command + short-summary: Get an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + examples: + - name: AssessedMachines_Get + text: |- + az migrate assessed-machine show --assessed-machine-name "amansing_vm1" --assessment-name \\ + "assessment01" --group-name "group01" --project-name "project01" --resource-group \\ + "myResourceGroup" +""" diff --git a/src/migrate/azext_migrate/generated/_params.py b/src/migrate/azext_migrate/generated/_params.py new file mode 100644 index 00000000000..ff20b1596e9 --- /dev/null +++ b/src/migrate/azext_migrate/generated/_params.py @@ -0,0 +1,144 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azext_migrate.action import ( + AddTags, + AddMachines +) + + +def load_arguments(self, _): + + with self.argument_context('migrate assessment-option show') as c: + c.argument('location_name', help='Azure region in which the project is created.') + + with self.argument_context('migrate project list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('migrate project show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + + with self.argument_context('migrate project create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('e_tag', help='For optimistic concurrency control.') + c.argument('location', arg_type=get_location_type(self.cli_ctx)) + c.argument('tags', tags_type, action=AddTags, nargs='+') + c.argument('properties_customer_workspace_id', help='ARM ID of the Service Map workspace created by user.') + c.argument('properties_customer_workspace_location', help='Location of the Service Map workspace created by user.') + c.argument('properties_provisioning_state', arg_type=get_enum_type(['Accepted', 'Creating', 'Deleting', 'Failed', 'Moving', 'Succeeded']), help='Provisioning state of the project.') + + with self.argument_context('migrate project update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('e_tag', help='For optimistic concurrency control.') + c.argument('location', arg_type=get_location_type(self.cli_ctx)) + c.argument('tags', tags_type, action=AddTags, nargs='+') + c.argument('properties_customer_workspace_id', help='ARM ID of the Service Map workspace created by user.') + c.argument('properties_customer_workspace_location', help='Location of the Service Map workspace created by user.') + c.argument('properties_provisioning_state', arg_type=get_enum_type(['Accepted', 'Creating', 'Deleting', 'Failed', 'Moving', 'Succeeded']), help='Provisioning state of the project.') + + with self.argument_context('migrate project delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + + with self.argument_context('migrate project get-key') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + + with self.argument_context('migrate machine list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + + with self.argument_context('migrate machine show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('machine_name', help='Unique name of a machine in private datacenter.') + + with self.argument_context('migrate group list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + + with self.argument_context('migrate group show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + + with self.argument_context('migrate group create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + c.argument('e_tag', help='For optimistic concurrency control.') + c.argument('properties_machines', help='List of machine names that are part of this group.', action=AddMachines, nargs='+') + + with self.argument_context('migrate group delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + + with self.argument_context('migrate assessment list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + + with self.argument_context('migrate assessment show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + c.argument('assessment_name', help='Unique name of an assessment within a project.') + + with self.argument_context('migrate assessment create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + c.argument('assessment_name', help='Unique name of an assessment within a project.') + c.argument('e_tag', help='For optimistic concurrency control.') + c.argument('properties_azure_location', arg_type=get_enum_type(['Unknown', 'EastAsia', 'SoutheastAsia', 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth', 'CanadaCentral', 'CanadaEast', 'WestEurope', 'NorthEurope', 'CentralIndia', 'SouthIndia', 'WestIndia', 'JapanEast', 'JapanWest', 'KoreaCentral', 'KoreaSouth', 'UkWest', 'UkSouth', 'NorthCentralUs', 'EastUs', 'WestUs2', 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', 'WestCentralUs', 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast']), help='Target Azure location for which the machines should be assessed. These enums are the same as used by Compute API.') + c.argument('properties_azure_offer_code', arg_type=get_enum_type(['Unknown', 'MSAZR0003P', 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', 'MSAZR0062P', 'MSAZR0063P', 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P', 'MSAZR0148P', 'MSAZR0025P', 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P', 'MSAZR0122P', 'MSAZR0123P', 'MSAZR0124P', 'MSAZR0125P', 'MSAZR0126P', 'MSAZR0127P', 'MSAZR0128P', 'MSAZR0129P', 'MSAZR0130P', 'MSAZR0111P', 'MSAZR0144P', 'MSAZR0149P', 'MSMCAZR0044P', 'MSMCAZR0059P', 'MSMCAZR0060P', 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P', 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P']), help='Offer code according to which cost estimation is done.') + c.argument('properties_azure_pricing_tier', arg_type=get_enum_type(['Standard', 'Basic']), help='Pricing tier for Size evaluation.') + c.argument('properties_azure_storage_redundancy', arg_type=get_enum_type(['Unknown', 'LocallyRedundant', 'ZoneRedundant', 'GeoRedundant', 'ReadAccessGeoRedundant']), help='Storage Redundancy type offered by Azure.') + c.argument('properties_scaling_factor', help='Scaling factor used over utilization data to add a performance buffer for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3.') + c.argument('properties_percentile', arg_type=get_enum_type(['Percentile50', 'Percentile90', 'Percentile95', 'Percentile99']), help='Percentile of performance data used to recommend Azure size.') + c.argument('properties_time_range', arg_type=get_enum_type(['Day', 'Week', 'Month']), help='Time range of performance data used to recommend a size.') + c.argument('properties_stage', arg_type=get_enum_type(['InProgress', 'UnderReview', 'Approved']), help='User configurable setting that describes the status of the assessment.') + c.argument('properties_currency', arg_type=get_enum_type(['Unknown', 'USD', 'DKK', 'CAD', 'IDR', 'JPY', 'KRW', 'NZD', 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', 'GBP', 'MXN', 'MYR', 'INR', 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY']), help='Currency to report prices in.') + c.argument('properties_azure_hybrid_use_benefit', arg_type=get_enum_type(['Unknown', 'Yes', 'No']), help='AHUB discount on windows virtual machines.') + c.argument('properties_discount_percentage', help='Custom discount percentage to be applied on final costs. Can be in the range [0, 100].') + c.argument('properties_sizing_criterion', arg_type=get_enum_type(['PerformanceBased', 'AsOnPremises']), help='Assessment sizing criterion.') + + with self.argument_context('migrate assessment delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + c.argument('assessment_name', help='Unique name of an assessment within a project.') + + with self.argument_context('migrate assessment get-report-download-url') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + c.argument('assessment_name', help='Unique name of an assessment within a project.') + + with self.argument_context('migrate assessed-machine list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + c.argument('assessment_name', help='Unique name of an assessment within a project.') + + with self.argument_context('migrate assessed-machine show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('project_name', help='Name of the Azure Migrate project.') + c.argument('group_name', help='Unique name of a group within a project.') + c.argument('assessment_name', help='Unique name of an assessment within a project.') + c.argument('assessed_machine_name', help='Unique name of an assessed machine evaluated as part of an assessment.') diff --git a/src/migrate/azext_migrate/generated/_validators.py b/src/migrate/azext_migrate/generated/_validators.py new file mode 100644 index 00000000000..01e8fe71d5a --- /dev/null +++ b/src/migrate/azext_migrate/generated/_validators.py @@ -0,0 +1,18 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +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/migrate/azext_migrate/generated/action.py b/src/migrate/azext_migrate/generated/action.py new file mode 100644 index 00000000000..34cd87b1cfe --- /dev/null +++ b/src/migrate/azext_migrate/generated/action.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import argparse +from knack.util import CLIError + + +# pylint: disable=protected-access + + +class AddTags(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddTags, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + return d + + +class AddMachines(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddMachines, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + return d diff --git a/src/migrate/azext_migrate/generated/commands.py b/src/migrate/azext_migrate/generated/commands.py new file mode 100644 index 00000000000..6dd6e1f2fae --- /dev/null +++ b/src/migrate/azext_migrate/generated/commands.py @@ -0,0 +1,69 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from ._client_factory import cf_assessment_option + migrate_assessment_option = CliCommandType( + operations_tmpl='azext_migrate.vendored_sdks.migrate.operations._assessment_option_operations#AssessmentOptionOperations.{}', + client_factory=cf_assessment_option) + with self.command_group('migrate assessment-option', migrate_assessment_option, client_factory=cf_assessment_option) as g: + g.custom_show_command('show', 'migrate_assessment_option_show') + + from ._client_factory import cf_project + migrate_project = CliCommandType( + operations_tmpl='azext_migrate.vendored_sdks.migrate.operations._project_operations#ProjectOperations.{}', + client_factory=cf_project) + with self.command_group('migrate project', migrate_project, client_factory=cf_project) as g: + g.custom_command('list', 'migrate_project_list') + g.custom_show_command('show', 'migrate_project_show') + g.custom_command('create', 'migrate_project_create') + g.custom_command('update', 'migrate_project_update') + g.custom_command('delete', 'migrate_project_delete') + g.custom_command('get-key', 'migrate_project_get_key') + + from ._client_factory import cf_machine + migrate_machine = CliCommandType( + operations_tmpl='azext_migrate.vendored_sdks.migrate.operations._machine_operations#MachineOperations.{}', + client_factory=cf_machine) + with self.command_group('migrate machine', migrate_machine, client_factory=cf_machine) as g: + g.custom_command('list', 'migrate_machine_list') + g.custom_show_command('show', 'migrate_machine_show') + + from ._client_factory import cf_group + migrate_group = CliCommandType( + operations_tmpl='azext_migrate.vendored_sdks.migrate.operations._group_operations#GroupOperations.{}', + client_factory=cf_group) + with self.command_group('migrate group', migrate_group, client_factory=cf_group) as g: + g.custom_command('list', 'migrate_group_list') + g.custom_show_command('show', 'migrate_group_show') + g.custom_command('create', 'migrate_group_create') + g.custom_command('delete', 'migrate_group_delete') + + from ._client_factory import cf_assessment + migrate_assessment = CliCommandType( + operations_tmpl='azext_migrate.vendored_sdks.migrate.operations._assessment_operations#AssessmentOperations.{}', + client_factory=cf_assessment) + with self.command_group('migrate assessment', migrate_assessment, client_factory=cf_assessment) as g: + g.custom_command('list', 'migrate_assessment_list') + g.custom_show_command('show', 'migrate_assessment_show') + g.custom_command('create', 'migrate_assessment_create') + g.custom_command('delete', 'migrate_assessment_delete') + g.custom_command('get-report-download-url', 'migrate_assessment_get_report_download_url') + + from ._client_factory import cf_assessed_machine + migrate_assessed_machine = CliCommandType( + operations_tmpl='azext_migrate.vendored_sdks.migrate.operations._assessed_machine_operations#AssessedMachineOperations.{}', + client_factory=cf_assessed_machine) + with self.command_group('migrate assessed-machine', migrate_assessed_machine, client_factory=cf_assessed_machine) as g: + g.custom_command('list', 'migrate_assessed_machine_list') + g.custom_show_command('show', 'migrate_assessed_machine_show') diff --git a/src/migrate/azext_migrate/generated/custom.py b/src/migrate/azext_migrate/generated/custom.py new file mode 100644 index 00000000000..1fa4f962dc8 --- /dev/null +++ b/src/migrate/azext_migrate/generated/custom.py @@ -0,0 +1,176 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-statements +# pylint: disable=too-many-lines +# pylint: disable=too-many-locals +# pylint: disable=unused-argument + + +def migrate_assessment_option_show(cmd, client, + location_name): + return client.get(location_name=location_name) + + +def migrate_project_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_by_subscription() + + +def migrate_project_show(cmd, client, + resource_group_name, + project_name): + return client.get(resource_group_name=resource_group_name, project_name=project_name) + + +def migrate_project_create(cmd, client, + resource_group_name, + project_name, + e_tag=None, + location=None, + tags=None, + properties_customer_workspace_id=None, + properties_customer_workspace_location=None, + properties_provisioning_state=None): + return client.create(resource_group_name=resource_group_name, project_name=project_name, e_tag=e_tag, location=location, tags=tags, customer_workspace_id=properties_customer_workspace_id, customer_workspace_location=properties_customer_workspace_location, provisioning_state=properties_provisioning_state) + + +def migrate_project_update(cmd, client, + resource_group_name, + project_name, + e_tag=None, + location=None, + tags=None, + properties_customer_workspace_id=None, + properties_customer_workspace_location=None, + properties_provisioning_state=None): + return client.update(resource_group_name=resource_group_name, project_name=project_name, e_tag=e_tag, location=location, tags=tags, customer_workspace_id=properties_customer_workspace_id, customer_workspace_location=properties_customer_workspace_location, provisioning_state=properties_provisioning_state) + + +def migrate_project_delete(cmd, client, + resource_group_name, + project_name): + return client.delete(resource_group_name=resource_group_name, project_name=project_name) + + +def migrate_project_get_key(cmd, client, + resource_group_name, + project_name): + return client.get_key(resource_group_name=resource_group_name, project_name=project_name) + + +def migrate_machine_list(cmd, client, + resource_group_name, + project_name): + return client.list_by_project(resource_group_name=resource_group_name, project_name=project_name) + + +def migrate_machine_show(cmd, client, + resource_group_name, + project_name, + machine_name): + return client.get(resource_group_name=resource_group_name, project_name=project_name, machine_name=machine_name) + + +def migrate_group_list(cmd, client, + resource_group_name, + project_name): + return client.list_by_project(resource_group_name=resource_group_name, project_name=project_name) + + +def migrate_group_show(cmd, client, + resource_group_name, + project_name, + group_name): + return client.get(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name) + + +def migrate_group_create(cmd, client, + resource_group_name, + project_name, + group_name, + properties_machines, + e_tag=None): + return client.create(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name, e_tag=e_tag, machines=properties_machines) + + +def migrate_group_delete(cmd, client, + resource_group_name, + project_name, + group_name): + return client.delete(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name) + + +def migrate_assessment_list(cmd, client, + resource_group_name, + project_name, + group_name=None): + if resource_group_name is not None and project_name is not None and group_name is not None: + return client.list_by_group(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name) + return client.list_by_project(resource_group_name=resource_group_name, project_name=project_name) + + +def migrate_assessment_show(cmd, client, + resource_group_name, + project_name, + group_name, + assessment_name): + return client.get(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name, assessment_name=assessment_name) + + +def migrate_assessment_create(cmd, client, + resource_group_name, + project_name, + group_name, + assessment_name, + properties_azure_location, + properties_azure_offer_code, + properties_azure_pricing_tier, + properties_azure_storage_redundancy, + properties_scaling_factor, + properties_percentile, + properties_time_range, + properties_stage, + properties_currency, + properties_azure_hybrid_use_benefit, + properties_discount_percentage, + properties_sizing_criterion, + e_tag=None): + return client.create(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name, assessment_name=assessment_name, e_tag=e_tag, azure_location=properties_azure_location, azure_offer_code=properties_azure_offer_code, azure_pricing_tier=properties_azure_pricing_tier, azure_storage_redundancy=properties_azure_storage_redundancy, scaling_factor=properties_scaling_factor, percentile=properties_percentile, time_range=properties_time_range, stage=properties_stage, currency=properties_currency, azure_hybrid_use_benefit=properties_azure_hybrid_use_benefit, discount_percentage=properties_discount_percentage, sizing_criterion=properties_sizing_criterion) + + +def migrate_assessment_delete(cmd, client, + resource_group_name, + project_name, + group_name, + assessment_name): + return client.delete(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name, assessment_name=assessment_name) + + +def migrate_assessment_get_report_download_url(cmd, client, + resource_group_name, + project_name, + group_name, + assessment_name): + return client.get_report_download_url(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name, assessment_name=assessment_name) + + +def migrate_assessed_machine_list(cmd, client, + resource_group_name, + project_name, + group_name, + assessment_name): + return client.list_by_assessment(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name, assessment_name=assessment_name) + + +def migrate_assessed_machine_show(cmd, client, + resource_group_name, + project_name, + group_name, + assessment_name, + assessed_machine_name): + return client.get(resource_group_name=resource_group_name, project_name=project_name, group_name=group_name, assessment_name=assessment_name, assessed_machine_name=assessed_machine_name) diff --git a/src/migrate/azext_migrate/tests/latest/__init__.py b/src/migrate/azext_migrate/tests/latest/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/migrate/azext_migrate/tests/latest/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/migrate/azext_migrate/tests/latest/preparers.py b/src/migrate/azext_migrate/tests/latest/preparers.py new file mode 100644 index 00000000000..ab56ef938b5 --- /dev/null +++ b/src/migrate/azext_migrate/tests/latest/preparers.py @@ -0,0 +1,130 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +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=75, 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 {}'.format(name)) + + +class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='virtual_network', + 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=75, key=KEY_VNET_SUBNET): + 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.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!") + + # 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 subnet create --resource-group {} " \ + "--vnet-name {} --name {} --address-prefixes {}" + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group_name, self.vnet_name, name, + self.address_prefixes)) + + 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 subnet" + "delete --name {} --resource-group {} " + "--vnet-name {}".format( + name, self.resource_group_name, + self.vnet_name)) diff --git a/src/migrate/azext_migrate/tests/latest/test_migrate_scenario.py b/src/migrate/azext_migrate/tests/latest/test_migrate_scenario.py new file mode 100644 index 00000000000..f23c49b180a --- /dev/null +++ b/src/migrate/azext_migrate/tests/latest/test_migrate_scenario.py @@ -0,0 +1,178 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class AzureMigrateScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_migrate_myResourceGroup', key='rg') + def test_migrate(self, resource_group): + + self.kwargs.update({ + 'project01': self.create_random_name(prefix='projects', length=24), + 'group01': self.create_random_name(prefix='groups', length=24), + 'assessment01': self.create_random_name(prefix='assessments', length=24), + }) + + # EXAMPLE NOT FOUND: LocationCheckNameAvailability_Available + + # EXAMPLE NOT FOUND: LocationCheckNameAvailability_AlreadyExists + + self.cmd('az migrate assessment-option show ' + '--location-name "SoutheastAsia"', + checks=[]) + + self.cmd('az migrate project create ' + '--e-tag "\"b701c73a-0000-0000-0000-59c12ff00000\"" ' + '--location "West Us" ' + '--customer-workspace-id "url-to-customers-service-map" ' + '--customer-workspace-location "West Us" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate project list ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate project list', + checks=[]) + + self.cmd('az migrate project show ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate project update ' + '--e-tag "" ' + '--location "West Us" ' + '--customer-workspace-id "url-to-customers-service-map" ' + '--customer-workspace-location "West Us" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate project get-key ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate machine list ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate machine show ' + '--machine-name "{amansing_vm1}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate group create ' + '--e-tag "\"1100637e-0000-0000-0000-59f6ed1f0000\"" ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate group list ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate group show ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate assessment create ' + '--e-tag "\"1100637e-0000-0000-0000-59f6ed1f0000\"" ' + '--azure-hybrid-use-benefit "Yes" ' + '--azure-location "WestUs" ' + '--azure-offer-code "MSAZR0003P" ' + '--azure-pricing-tier "Standard" ' + '--azure-storage-redundancy "LocallyRedundant" ' + '--currency "USD" ' + '--discount-percentage 100 ' + '--percentile "Percentile50" ' + '--scaling-factor 1.2 ' + '--sizing-criterion "PerformanceBased" ' + '--stage "InProgress" ' + '--time-range "Day" ' + '--assessment-name "{assessment01}" ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate assessment list ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate assessment get-report-download-url ' + '--assessment-name "{assessment01}" ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate assessed-machine list ' + '--assessment-name "{assessment01}" ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate assessed-machine show ' + '--assessed-machine-name "{amansing_vm1}" ' + '--assessment-name "{assessment01}" ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate assessment delete ' + '--assessment-name "{assessment01}" ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate group delete ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate assessment list ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate assessment show ' + '--assessment-name "{assessment01}" ' + '--group-name "{group01}" ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + self.cmd('az migrate project delete ' + '--project-name "{project01}" ' + '--resource-group "{rg}"', + checks=[]) + + # EXAMPLE NOT FOUND: Operations_List diff --git a/src/migrate/azext_migrate/vendored_sdks/__init__.py b/src/migrate/azext_migrate/vendored_sdks/__init__.py new file mode 100644 index 00000000000..be1a152630c --- /dev/null +++ b/src/migrate/azext_migrate/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__) \ No newline at end of file diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/__init__.py b/src/migrate/azext_migrate/vendored_sdks/migrate/__init__.py new file mode 100644 index 00000000000..2a2ed3ed274 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/__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 ._azure_migrate import AzureMigrate +__all__ = ['AzureMigrate'] diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/_azure_migrate.py b/src/migrate/azext_migrate/vendored_sdks/migrate/_azure_migrate.py new file mode 100644 index 00000000000..b8883d39f0a --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/_azure_migrate.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +from ._configuration import AzureMigrateConfiguration +from .operations import LocationOperations +from .operations import AssessmentOptionOperations +from .operations import ProjectOperations +from .operations import MachineOperations +from .operations import GroupOperations +from .operations import AssessmentOperations +from .operations import AssessedMachineOperations +from .operations import OperationOperations +from . import models + + +class AzureMigrate(object): + """Move your workloads to Azure. + + :ivar location: LocationOperations operations + :vartype location: azure_migrate.operations.LocationOperations + :ivar assessment_option: AssessmentOptionOperations operations + :vartype assessment_option: azure_migrate.operations.AssessmentOptionOperations + :ivar project: ProjectOperations operations + :vartype project: azure_migrate.operations.ProjectOperations + :ivar machine: MachineOperations operations + :vartype machine: azure_migrate.operations.MachineOperations + :ivar group: GroupOperations operations + :vartype group: azure_migrate.operations.GroupOperations + :ivar assessment: AssessmentOperations operations + :vartype assessment: azure_migrate.operations.AssessmentOperations + :ivar assessed_machine: AssessedMachineOperations operations + :vartype assessed_machine: azure_migrate.operations.AssessedMachineOperations + :ivar operation: OperationOperations operations + :vartype operation: azure_migrate.operations.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: Azure Subscription Id in which project was created. + :type subscription_id: str + :param acceptlanguage: Standard request header. Used by service to respond to client in appropriate language. + :type acceptlanguage: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + acceptlanguage=None, # type: Optional[str] + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureMigrateConfiguration(credential, subscription_id, acceptlanguage, **kwargs) + self._client = PipelineClient(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.location = LocationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.assessment_option = AssessmentOptionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.project = ProjectOperations( + self._client, self._config, self._serialize, self._deserialize) + self.machine = MachineOperations( + self._client, self._config, self._serialize, self._deserialize) + self.group = GroupOperations( + self._client, self._config, self._serialize, self._deserialize) + self.assessment = AssessmentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.assessed_machine = AssessedMachineOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AzureMigrate + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/_configuration.py b/src/migrate/azext_migrate/vendored_sdks/migrate/_configuration.py new file mode 100644 index 00000000000..73d6df626a3 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/_configuration.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, Optional + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class AzureMigrateConfiguration(Configuration): + """Configuration for AzureMigrate + 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: Azure Subscription Id in which project was created. + :type subscription_id: str + :param acceptlanguage: Standard request header. Used by service to respond to client in appropriate language. + :type acceptlanguage: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + acceptlanguage=None, # type: Optional[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(AzureMigrateConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.acceptlanguage = acceptlanguage + self.api_version = "2018-02-02" + self._configure(**kwargs) + self.user_agent_policy.add_user_agent('azsdk-python-azuremigrate/{}'.format(VERSION)) + + 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, **kwargs) diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/__init__.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/__init__.py new file mode 100644 index 00000000000..4afa82d2abc --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/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 ._azure_migrate_async import AzureMigrate +__all__ = ['AzureMigrate'] diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/_azure_migrate_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/_azure_migrate_async.py new file mode 100644 index 00000000000..1faeb33abc5 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/_azure_migrate_async.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import AzureMigrateConfiguration +from .operations_async import LocationOperations +from .operations_async import AssessmentOptionOperations +from .operations_async import ProjectOperations +from .operations_async import MachineOperations +from .operations_async import GroupOperations +from .operations_async import AssessmentOperations +from .operations_async import AssessedMachineOperations +from .operations_async import OperationOperations +from .. import models + + +class AzureMigrate(object): + """Move your workloads to Azure. + + :ivar location: LocationOperations operations + :vartype location: azure_migrate.aio.operations_async.LocationOperations + :ivar assessment_option: AssessmentOptionOperations operations + :vartype assessment_option: azure_migrate.aio.operations_async.AssessmentOptionOperations + :ivar project: ProjectOperations operations + :vartype project: azure_migrate.aio.operations_async.ProjectOperations + :ivar machine: MachineOperations operations + :vartype machine: azure_migrate.aio.operations_async.MachineOperations + :ivar group: GroupOperations operations + :vartype group: azure_migrate.aio.operations_async.GroupOperations + :ivar assessment: AssessmentOperations operations + :vartype assessment: azure_migrate.aio.operations_async.AssessmentOperations + :ivar assessed_machine: AssessedMachineOperations operations + :vartype assessed_machine: azure_migrate.aio.operations_async.AssessedMachineOperations + :ivar operation: OperationOperations operations + :vartype operation: azure_migrate.aio.operations_async.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: Azure Subscription Id in which project was created. + :type subscription_id: str + :param acceptlanguage: Standard request header. Used by service to respond to client in appropriate language. + :type acceptlanguage: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + acceptlanguage: Optional[str] = None, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureMigrateConfiguration(credential, subscription_id, acceptlanguage, **kwargs) + self._client = AsyncPipelineClient(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.location = LocationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.assessment_option = AssessmentOptionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.project = ProjectOperations( + self._client, self._config, self._serialize, self._deserialize) + self.machine = MachineOperations( + self._client, self._config, self._serialize, self._deserialize) + self.group = GroupOperations( + self._client, self._config, self._serialize, self._deserialize) + self.assessment = AssessmentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.assessed_machine = AssessedMachineOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AzureMigrate": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/_configuration_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/_configuration_async.py new file mode 100644 index 00000000000..801ab988a86 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/_configuration_async.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class AzureMigrateConfiguration(Configuration): + """Configuration for AzureMigrate + 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: Azure Subscription Id in which project was created. + :type subscription_id: str + :param acceptlanguage: Standard request header. Used by service to respond to client in appropriate language. + :type acceptlanguage: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + acceptlanguage: Optional[str] = None, + **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(AzureMigrateConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.acceptlanguage = acceptlanguage + self.api_version = "2018-02-02" + self._configure(**kwargs) + self.user_agent_policy.add_user_agent('azsdk-python-azuremigrate/{}'.format(VERSION)) + + 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, **kwargs) diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/__init__.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/__init__.py new file mode 100644 index 00000000000..4d0427f46f5 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._location_operations_async import LocationOperations +from ._assessment_option_operations_async import AssessmentOptionOperations +from ._project_operations_async import ProjectOperations +from ._machine_operations_async import MachineOperations +from ._group_operations_async import GroupOperations +from ._assessment_operations_async import AssessmentOperations +from ._assessed_machine_operations_async import AssessedMachineOperations +from ._operation_operations_async import OperationOperations + +__all__ = [ + 'LocationOperations', + 'AssessmentOptionOperations', + 'ProjectOperations', + 'MachineOperations', + 'GroupOperations', + 'AssessmentOperations', + 'AssessedMachineOperations', + 'OperationOperations', +] diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_assessed_machine_operations_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_assessed_machine_operations_async.py new file mode 100644 index 00000000000..0471fb5932b --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_assessed_machine_operations_async.py @@ -0,0 +1,199 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AssessedMachineOperations: + """AssessedMachineOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_assessment( + self, + resource_group_name: str, + project_name: str, + group_name: str, + assessment_name: str, + **kwargs + ) -> "models.AssessedMachineResultList": + """Get list of machines that assessed as part of the specified assessment. Returns a json array of objects of type 'assessedMachine' as specified in the Models section. + + Whenever an assessment is created or updated, it goes under computation. During this phase, the 'status' field of Assessment object reports 'Computing'. + During the period when the assessment is under computation, the list of assessed machines is empty and no assessed machines are returned by this call. + + Get assessed machines for assessment. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessedMachineResultList or the result of cls(response) + :rtype: ~azure_migrate.models.AssessedMachineResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.AssessedMachineResultList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_assessment.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('AssessedMachineResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_assessment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines'} + + async def get( + self, + resource_group_name: str, + project_name: str, + group_name: str, + assessment_name: str, + assessed_machine_name: str, + **kwargs + ) -> "models.AssessedMachine": + """Get an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + + Get an assessed machine. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :param assessed_machine_name: Unique name of an assessed machine evaluated as part of an + assessment. + :type assessed_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessedMachine or the result of cls(response) + :rtype: ~azure_migrate.models.AssessedMachine + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.AssessedMachine"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + 'assessedMachineName': self._serialize.url("assessed_machine_name", assessed_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('AssessedMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_assessment_operations_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_assessment_operations_async.py new file mode 100644 index 00000000000..caab98bcbe9 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_assessment_operations_async.py @@ -0,0 +1,532 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AssessmentOperations: + """AssessmentOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_group( + self, + resource_group_name: str, + project_name: str, + group_name: str, + **kwargs + ) -> "models.AssessmentResultList": + """Get all assessments created for the specified group. + + Returns a json array of objects of type 'assessment' as specified in Models section. + + Get all assessments created for the specified group. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessmentResultList or the result of cls(response) + :rtype: ~azure_migrate.models.AssessmentResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.AssessmentResultList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_group.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('AssessmentResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments'} + + def list_by_project( + self, + resource_group_name: str, + project_name: str, + **kwargs + ) -> "models.AssessmentResultList": + """Get all assessments created in the project. + + Returns a json array of objects of type 'assessment' as specified in Models section. + + Get all assessments created in the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessmentResultList or the result of cls(response) + :rtype: ~azure_migrate.models.AssessmentResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.AssessmentResultList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_project.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('AssessmentResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_project.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/assessments'} + + async def get( + self, + resource_group_name: str, + project_name: str, + group_name: str, + assessment_name: str, + **kwargs + ) -> "models.Assessment": + """Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + + Get an assessment. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Assessment or the result of cls(response) + :rtype: ~azure_migrate.models.Assessment + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.Assessment"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Assessment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}'} + + async def create( + self, + resource_group_name: str, + project_name: str, + group_name: str, + assessment_name: str, + azure_location: Union[str, "models.AzureLocation"], + azure_offer_code: Union[str, "models.AzureOfferCode"], + azure_pricing_tier: Union[str, "models.AzurePricingTier"], + azure_storage_redundancy: Union[str, "models.AzureStorageRedundancy"], + scaling_factor: float, + percentile: Union[str, "models.Percentile"], + time_range: Union[str, "models.TimeRange"], + stage: Union[str, "models.AssessmentStage"], + currency: Union[str, "models.Currency"], + azure_hybrid_use_benefit: Union[str, "models.AzureHybridUseBenefit"], + discount_percentage: float, + sizing_criterion: Union[str, "models.AssessmentSizingCriterion"], + e_tag: Optional[str] = None, + **kwargs + ) -> "models.Assessment": + """Create a new assessment with the given name and the specified settings. Since name of an assessment in a project is a unique identifier, if an assessment with the name provided already exists, then the existing assessment is updated. + + Any PUT operation, resulting in either create or update on an assessment, will cause the assessment to go in a "InProgress" state. This will be indicated by the field 'computationState' on the Assessment object. During this time no other PUT operation will be allowed on that assessment object, nor will a Delete operation. Once the computation for the assessment is complete, the field 'computationState' will be updated to 'Ready', and then other PUT or DELETE operations can happen on the assessment. + + When assessment is under computation, any PUT will lead to a 400 - Bad Request error. + + Create or Update assessment. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :param azure_location: Target Azure location for which the machines should be assessed. These + enums are the same as used by Compute API. + :type azure_location: str or ~azure_migrate.models.AzureLocation + :param azure_offer_code: Offer code according to which cost estimation is done. + :type azure_offer_code: str or ~azure_migrate.models.AzureOfferCode + :param azure_pricing_tier: Pricing tier for Size evaluation. + :type azure_pricing_tier: str or ~azure_migrate.models.AzurePricingTier + :param azure_storage_redundancy: Storage Redundancy type offered by Azure. + :type azure_storage_redundancy: str or ~azure_migrate.models.AzureStorageRedundancy + :param scaling_factor: Scaling factor used over utilization data to add a performance buffer + for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3. + :type scaling_factor: float + :param percentile: Percentile of performance data used to recommend Azure size. + :type percentile: str or ~azure_migrate.models.Percentile + :param time_range: Time range of performance data used to recommend a size. + :type time_range: str or ~azure_migrate.models.TimeRange + :param stage: User configurable setting that describes the status of the assessment. + :type stage: str or ~azure_migrate.models.AssessmentStage + :param currency: Currency to report prices in. + :type currency: str or ~azure_migrate.models.Currency + :param azure_hybrid_use_benefit: AHUB discount on windows virtual machines. + :type azure_hybrid_use_benefit: str or ~azure_migrate.models.AzureHybridUseBenefit + :param discount_percentage: Custom discount percentage to be applied on final costs. Can be in + the range [0, 100]. + :type discount_percentage: float + :param sizing_criterion: Assessment sizing criterion. + :type sizing_criterion: str or ~azure_migrate.models.AssessmentSizingCriterion + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Assessment or Assessment or the result of cls(response) + :rtype: ~azure_migrate.models.Assessment or ~azure_migrate.models.Assessment + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.Assessment"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + assessment = models.Assessment(e_tag=e_tag, azure_location=azure_location, azure_offer_code=azure_offer_code, azure_pricing_tier=azure_pricing_tier, azure_storage_redundancy=azure_storage_redundancy, scaling_factor=scaling_factor, percentile=percentile, time_range=time_range, stage=stage, currency=currency, azure_hybrid_use_benefit=azure_hybrid_use_benefit, discount_percentage=discount_percentage, sizing_criterion=sizing_criterion) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + if assessment is not None: + body_content = self._serialize.body(assessment, 'Assessment') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Assessment', pipeline_response) + + if response.status_code == 201: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Assessment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}'} + + async def delete( + self, + resource_group_name: str, + project_name: str, + group_name: str, + assessment_name: str, + **kwargs + ) -> None: + """Delete an assessment from the project. The machines remain in the assessment. Deleting a non-existent assessment results in a no-operation. + + When an assessment is under computation, as indicated by the 'computationState' field, it cannot be deleted. Any such attempt will return a 400 - Bad Request. + + Deletes an assessment from the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_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_migrate.models.CloudErrorException: + """ + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}'} + + async def get_report_download_url( + self, + resource_group_name: str, + project_name: str, + group_name: str, + assessment_name: str, + **kwargs + ) -> "models.DownloadUrl": + """Get the URL for downloading the assessment in a report format. + + Get download URL for the assessment report. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DownloadUrl or the result of cls(response) + :rtype: ~azure_migrate.models.DownloadUrl + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.DownloadUrl"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # Construct URL + url = self.get_report_download_url.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('DownloadUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_report_download_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/downloadUrl'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_assessment_option_operations_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_assessment_option_operations_async.py new file mode 100644 index 00000000000..cb28c489b22 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_assessment_option_operations_async.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AssessmentOptionOperations: + """AssessmentOptionOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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, + location_name: str, + **kwargs + ) -> "models.AssessmentOptionsResultList": + """Get the available options for the properties of an assessment. + + Get the assessment options. + + :param location_name: Azure region in which the project is created. + :type location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessmentOptionsResultList or the result of cls(response) + :rtype: ~azure_migrate.models.AssessmentOptionsResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.AssessmentOptionsResultList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + deserialized = self._deserialize('AssessmentOptionsResultList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/locations/{locationName}/assessmentOptions'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_group_operations_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_group_operations_async.py new file mode 100644 index 00000000000..7af2d016a5c --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_group_operations_async.py @@ -0,0 +1,334 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GroupOperations: + """GroupOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_project( + self, + resource_group_name: str, + project_name: str, + **kwargs + ) -> "models.GroupResultList": + """Get all groups created in the project. Returns a json array of objects of type 'group' as specified in the Models section. + + Get all groups. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GroupResultList or the result of cls(response) + :rtype: ~azure_migrate.models.GroupResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.GroupResultList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_project.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('GroupResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_project.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups'} + + async def get( + self, + resource_group_name: str, + project_name: str, + group_name: str, + **kwargs + ) -> "models.Group": + """Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + + Get a specific group. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Group or the result of cls(response) + :rtype: ~azure_migrate.models.Group + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.Group"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Group', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}'} + + async def create( + self, + resource_group_name: str, + project_name: str, + group_name: str, + machines: List[str], + e_tag: Optional[str] = None, + **kwargs + ) -> "models.Group": + """Create a new group by sending a json object of type 'group' as given in Models section as part of the Request Body. The group name in a project is unique. Labels can be applied on a group as part of creation. + + If a group with the groupName specified in the URL already exists, then this call acts as an update. + + This operation is Idempotent. + + Create a new group with specified settings. If group with the name provided already exists, + then the existing group is updated. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param machines: List of machine names that are part of this group. + :type machines: list[str] + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Group or Group or the result of cls(response) + :rtype: ~azure_migrate.models.Group or ~azure_migrate.models.Group + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.Group"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + group = models.Group(e_tag=e_tag, machines=machines) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + if group is not None: + body_content = self._serialize.body(group, 'Group') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Group', pipeline_response) + + if response.status_code == 201: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Group', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}'} + + async def delete( + self, + resource_group_name: str, + project_name: str, + group_name: str, + **kwargs + ) -> None: + """Delete the group from the project. The machines remain in the project. Deleting a non-existent group results in a no-operation. + + A group is an aggregation mechanism for machines in a project. Therefore, deleting group does not delete machines in it. + + Delete the group. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type 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_migrate.models.CloudErrorException: + """ + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_location_operations_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_location_operations_async.py new file mode 100644 index 00000000000..573a0960637 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_location_operations_async.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LocationOperations: + """LocationOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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 check_name_availability( + self, + location_name: str, + name: str, + **kwargs + ) -> "models.CheckNameAvailabilityResult": + """Checks whether the project name is available in the specified region. + + :param location_name: The desired region for the name check. + :type location_name: str + :param name: The name to check for availability. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult or the result of cls(response) + :rtype: ~azure_migrate.models.CheckNameAvailabilityResult + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.CheckNameAvailabilityResult"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + parameters = models.CheckNameAvailabilityParameters(name=name) + api_version = "2018-02-02" + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 models.CloudErrorException.from_response(response, self._deserialize) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/locations/{locationName}/checkNameAvailability'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_machine_operations_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_machine_operations_async.py new file mode 100644 index 00000000000..50c5bb21285 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_machine_operations_async.py @@ -0,0 +1,179 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MachineOperations: + """MachineOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_project( + self, + resource_group_name: str, + project_name: str, + **kwargs + ) -> "models.MachineResultList": + """Get data of all the machines available in the project. Returns a json array of objects of type 'machine' defined in Models section. + + Get all machines in the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MachineResultList or the result of cls(response) + :rtype: ~azure_migrate.models.MachineResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.MachineResultList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_project.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('MachineResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_project.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines'} + + async def get( + self, + resource_group_name: str, + project_name: str, + machine_name: str, + **kwargs + ) -> "models.Machine": + """Get the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + + Get a specific machine. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param machine_name: Unique name of a machine in private datacenter. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Machine or the result of cls(response) + :rtype: ~azure_migrate.models.Machine + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.Machine"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Machine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines/{machineName}'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_operation_operations_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_operation_operations_async.py new file mode 100644 index 00000000000..75bb42e59e3 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_operation_operations_async.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +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 directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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.OperationResultList": + """Get a list of REST API supported by Microsoft.Migrate provider. + + Get list of operations supported in the API. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultList or the result of cls(response) + :rtype: ~azure_migrate.models.OperationResultList + :raises: ~azure.core.HttpResponseError + """ + cls: ClsType["models.OperationResultList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + 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: Dict[str, Any] = {} + + # Construct headers + header_parameters: 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('OperationResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Migrate/operations'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_project_operations_async.py b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_project_operations_async.py new file mode 100644 index 00000000000..44761174ef7 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/aio/operations_async/_project_operations_async.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. +# -------------------------------------------------------------------------- +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 map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProjectOperations: + """ProjectOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_subscription( + self, + **kwargs + ) -> "models.ProjectResultList": + """Get all the projects in the subscription. + + Get all projects. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProjectResultList or the result of cls(response) + :rtype: ~azure_migrate.models.ProjectResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.ProjectResultList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.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: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('ProjectResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/projects'} + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> "models.ProjectResultList": + """Get all the projects in the resource group. + + Get all projects. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProjectResultList or the result of cls(response) + :rtype: ~azure_migrate.models.ProjectResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.ProjectResultList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('ProjectResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects'} + + async def get( + self, + resource_group_name: str, + project_name: str, + **kwargs + ) -> "models.Project": + """Get the project with the specified name. + + Get the specified project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Project or the result of cls(response) + :rtype: ~azure_migrate.models.Project + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.Project"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Project', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}'} + + async def create( + self, + resource_group_name: str, + project_name: str, + e_tag: Optional[str] = None, + location: Optional[str] = None, + tags: Optional["models.ProjectTags"] = None, + customer_workspace_id: Optional[str] = None, + customer_workspace_location: Optional[str] = None, + provisioning_state: Optional[Union[str, "models.ProvisioningState"]] = None, + **kwargs + ) -> "models.Project": + """Create a project with specified name. If a project already exists, update it. + + Create or update project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :param location: Azure location in which project is created. + :type location: str + :param tags: Tags provided by Azure Tagging service. + :type tags: ~azure_migrate.models.ProjectTags + :param customer_workspace_id: ARM ID of the Service Map workspace created by user. + :type customer_workspace_id: str + :param customer_workspace_location: Location of the Service Map workspace created by user. + :type customer_workspace_location: str + :param provisioning_state: Provisioning state of the project. + :type provisioning_state: str or ~azure_migrate.models.ProvisioningState + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Project or Project or the result of cls(response) + :rtype: ~azure_migrate.models.Project or ~azure_migrate.models.Project + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.Project"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + project = models.Project(e_tag=e_tag, location=location, tags=tags, customer_workspace_id=customer_workspace_id, customer_workspace_location=customer_workspace_location, provisioning_state=provisioning_state) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + if project is not None: + body_content = self._serialize.body(project, 'Project') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Project', pipeline_response) + + if response.status_code == 201: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Project', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}'} + + async def update( + self, + resource_group_name: str, + project_name: str, + e_tag: Optional[str] = None, + location: Optional[str] = None, + tags: Optional["models.ProjectTags"] = None, + customer_workspace_id: Optional[str] = None, + customer_workspace_location: Optional[str] = None, + provisioning_state: Optional[Union[str, "models.ProvisioningState"]] = None, + **kwargs + ) -> "models.Project": + """Update a project with specified name. Supports partial updates, for example only tags can be provided. + + Update project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :param location: Azure location in which project is created. + :type location: str + :param tags: Tags provided by Azure Tagging service. + :type tags: ~azure_migrate.models.ProjectTags + :param customer_workspace_id: ARM ID of the Service Map workspace created by user. + :type customer_workspace_id: str + :param customer_workspace_location: Location of the Service Map workspace created by user. + :type customer_workspace_location: str + :param provisioning_state: Provisioning state of the project. + :type provisioning_state: str or ~azure_migrate.models.ProvisioningState + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Project or the result of cls(response) + :rtype: ~azure_migrate.models.Project + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.Project"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + project = models.Project(e_tag=e_tag, location=location, tags=tags, customer_workspace_id=customer_workspace_id, customer_workspace_location=customer_workspace_location, provisioning_state=provisioning_state) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + if project is not None: + body_content = self._serialize.body(project, 'Project') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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 models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Project', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}'} + + async def delete( + self, + resource_group_name: str, + project_name: str, + **kwargs + ) -> None: + """Delete the project. Deleting non-existent project is a no-operation. + + Delete the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_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_migrate.models.CloudErrorException: + """ + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}'} + + async def get_key( + self, + resource_group_name: str, + project_name: str, + **kwargs + ) -> "models.ProjectKey": + """Gets the Log Analytics Workspace ID and Primary Key for the specified project. + + Get shared keys for the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProjectKey or the result of cls(response) + :rtype: ~azure_migrate.models.ProjectKey + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls: ClsType["models.ProjectKey"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # Construct URL + url = self.get_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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('ProjectKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/keys'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/models/__init__.py b/src/migrate/azext_migrate/vendored_sdks/migrate/models/__init__.py new file mode 100644 index 00000000000..47dceec806c --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/models/__init__.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 AssessedDisk + from ._models_py3 import AssessedMachine + from ._models_py3 import AssessedMachineProperties + from ._models_py3 import AssessedMachineResultList + from ._models_py3 import AssessedNetworkAdapter + from ._models_py3 import Assessment + from ._models_py3 import AssessmentOptionsResultList + from ._models_py3 import AssessmentProperties + from ._models_py3 import AssessmentResultList + from ._models_py3 import CheckNameAvailabilityParameters + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CloudError, CloudErrorException + from ._models_py3 import CloudErrorBody + from ._models_py3 import Disk + from ._models_py3 import DownloadUrl + from ._models_py3 import Group + from ._models_py3 import GroupProperties + from ._models_py3 import GroupResultList + from ._models_py3 import Machine + from ._models_py3 import MachineProperties + from ._models_py3 import MachineResultList + from ._models_py3 import NetworkAdapter + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationResultList + from ._models_py3 import Project + from ._models_py3 import ProjectKey + from ._models_py3 import ProjectProperties + from ._models_py3 import ProjectResultList + from ._models_py3 import ProjectTags + from ._models_py3 import VmFamily +except (SyntaxError, ImportError): + from ._models import AssessedDisk # type: ignore + from ._models import AssessedMachine # type: ignore + from ._models import AssessedMachineProperties # type: ignore + from ._models import AssessedMachineResultList # type: ignore + from ._models import AssessedNetworkAdapter # type: ignore + from ._models import Assessment # type: ignore + from ._models import AssessmentOptionsResultList # type: ignore + from ._models import AssessmentProperties # type: ignore + from ._models import AssessmentResultList # type: ignore + from ._models import CheckNameAvailabilityParameters # type: ignore + from ._models import CheckNameAvailabilityResult # type: ignore + from ._models import CloudError, CloudErrorException # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import Disk # type: ignore + from ._models import DownloadUrl # type: ignore + from ._models import Group # type: ignore + from ._models import GroupProperties # type: ignore + from ._models import GroupResultList # type: ignore + from ._models import Machine # type: ignore + from ._models import MachineProperties # type: ignore + from ._models import MachineResultList # type: ignore + from ._models import NetworkAdapter # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationResultList # type: ignore + from ._models import Project # type: ignore + from ._models import ProjectKey # type: ignore + from ._models import ProjectProperties # type: ignore + from ._models import ProjectResultList # type: ignore + from ._models import ProjectTags # type: ignore + from ._models import VmFamily # type: ignore +from ._azure_migrate_enums import ( + AssessmentSizingCriterion, + AssessmentStage, + AssessmentStatus, + AzureDiskSize, + AzureDiskSuitabilityExplanation, + AzureDiskType, + AzureHybridUseBenefit, + AzureLocation, + AzureNetworkAdapterSuitabilityExplanation, + AzureOfferCode, + AzurePricingTier, + AzureStorageRedundancy, + AzureVmSize, + AzureVmSuitabilityExplanation, + CloudSuitability, + Currency, + DiscoveryStatus, + MachineBootType, + NameAvailabilityReason, + Percentile, + ProvisioningState, + TimeRange, +) + +__all__ = [ + 'AssessedDisk', + 'AssessedMachine', + 'AssessedMachineProperties', + 'AssessedMachineResultList', + 'AssessedNetworkAdapter', + 'Assessment', + 'AssessmentOptionsResultList', + 'AssessmentProperties', + 'AssessmentResultList', + 'CheckNameAvailabilityParameters', + 'CheckNameAvailabilityResult', + 'CloudError', 'CloudErrorException', + 'CloudErrorBody', + 'Disk', + 'DownloadUrl', + 'Group', + 'GroupProperties', + 'GroupResultList', + 'Machine', + 'MachineProperties', + 'MachineResultList', + 'NetworkAdapter', + 'Operation', + 'OperationDisplay', + 'OperationResultList', + 'Project', + 'ProjectKey', + 'ProjectProperties', + 'ProjectResultList', + 'ProjectTags', + 'VmFamily', + 'AssessmentSizingCriterion', + 'AssessmentStage', + 'AssessmentStatus', + 'AzureDiskSize', + 'AzureDiskSuitabilityExplanation', + 'AzureDiskType', + 'AzureHybridUseBenefit', + 'AzureLocation', + 'AzureNetworkAdapterSuitabilityExplanation', + 'AzureOfferCode', + 'AzurePricingTier', + 'AzureStorageRedundancy', + 'AzureVmSize', + 'AzureVmSuitabilityExplanation', + 'CloudSuitability', + 'Currency', + 'DiscoveryStatus', + 'MachineBootType', + 'NameAvailabilityReason', + 'Percentile', + 'ProvisioningState', + 'TimeRange', +] diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/models/_azure_migrate_enums.py b/src/migrate/azext_migrate/vendored_sdks/migrate/models/_azure_migrate_enums.py new file mode 100644 index 00000000000..b5bb02bd4e2 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/models/_azure_migrate_enums.py @@ -0,0 +1,374 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + +class DiscoveryStatus(str, Enum): + + unknown = "Unknown" + not_started = "NotStarted" + in_progress = "InProgress" + completed = "Completed" + +class ProvisioningState(str, Enum): + + accepted = "Accepted" + creating = "Creating" + deleting = "Deleting" + failed = "Failed" + moving = "Moving" + succeeded = "Succeeded" + +class MachineBootType(str, Enum): + + unknown = "Unknown" + efi = "EFI" + bios = "BIOS" + +class AzureLocation(str, Enum): + + unknown = "Unknown" + east_asia = "EastAsia" + southeast_asia = "SoutheastAsia" + australia_east = "AustraliaEast" + australia_southeast = "AustraliaSoutheast" + brazil_south = "BrazilSouth" + canada_central = "CanadaCentral" + canada_east = "CanadaEast" + west_europe = "WestEurope" + north_europe = "NorthEurope" + central_india = "CentralIndia" + south_india = "SouthIndia" + west_india = "WestIndia" + japan_east = "JapanEast" + japan_west = "JapanWest" + korea_central = "KoreaCentral" + korea_south = "KoreaSouth" + uk_west = "UkWest" + uk_south = "UkSouth" + north_central_us = "NorthCentralUs" + east_us = "EastUs" + west_us2 = "WestUs2" + south_central_us = "SouthCentralUs" + central_us = "CentralUs" + east_us2 = "EastUs2" + west_us = "WestUs" + west_central_us = "WestCentralUs" + germany_central = "GermanyCentral" + germany_northeast = "GermanyNortheast" + china_north = "ChinaNorth" + china_east = "ChinaEast" + +class AzureOfferCode(str, Enum): + + unknown = "Unknown" + msazr0003_p = "MSAZR0003P" + msazr0044_p = "MSAZR0044P" + msazr0059_p = "MSAZR0059P" + msazr0060_p = "MSAZR0060P" + msazr0062_p = "MSAZR0062P" + msazr0063_p = "MSAZR0063P" + msazr0064_p = "MSAZR0064P" + msazr0029_p = "MSAZR0029P" + msazr0022_p = "MSAZR0022P" + msazr0023_p = "MSAZR0023P" + msazr0148_p = "MSAZR0148P" + msazr0025_p = "MSAZR0025P" + msazr0036_p = "MSAZR0036P" + msazr0120_p = "MSAZR0120P" + msazr0121_p = "MSAZR0121P" + msazr0122_p = "MSAZR0122P" + msazr0123_p = "MSAZR0123P" + msazr0124_p = "MSAZR0124P" + msazr0125_p = "MSAZR0125P" + msazr0126_p = "MSAZR0126P" + msazr0127_p = "MSAZR0127P" + msazr0128_p = "MSAZR0128P" + msazr0129_p = "MSAZR0129P" + msazr0130_p = "MSAZR0130P" + msazr0111_p = "MSAZR0111P" + msazr0144_p = "MSAZR0144P" + msazr0149_p = "MSAZR0149P" + msmcazr0044_p = "MSMCAZR0044P" + msmcazr0059_p = "MSMCAZR0059P" + msmcazr0060_p = "MSMCAZR0060P" + msmcazr0063_p = "MSMCAZR0063P" + msmcazr0120_p = "MSMCAZR0120P" + msmcazr0121_p = "MSMCAZR0121P" + msmcazr0125_p = "MSMCAZR0125P" + msmcazr0128_p = "MSMCAZR0128P" + msazrde0003_p = "MSAZRDE0003P" + msazrde0044_p = "MSAZRDE0044P" + +class AzurePricingTier(str, Enum): + + standard = "Standard" + basic = "Basic" + +class AzureStorageRedundancy(str, Enum): + + unknown = "Unknown" + locally_redundant = "LocallyRedundant" + zone_redundant = "ZoneRedundant" + geo_redundant = "GeoRedundant" + read_access_geo_redundant = "ReadAccessGeoRedundant" + +class Percentile(str, Enum): + + percentile50 = "Percentile50" + percentile90 = "Percentile90" + percentile95 = "Percentile95" + percentile99 = "Percentile99" + +class TimeRange(str, Enum): + + day = "Day" + week = "Week" + month = "Month" + +class AssessmentStage(str, Enum): + + in_progress = "InProgress" + under_review = "UnderReview" + approved = "Approved" + +class Currency(str, Enum): + + unknown = "Unknown" + usd = "USD" + dkk = "DKK" + cad = "CAD" + idr = "IDR" + jpy = "JPY" + krw = "KRW" + nzd = "NZD" + nok = "NOK" + rub = "RUB" + sar = "SAR" + zar = "ZAR" + sek = "SEK" + try_enum = "TRY" + gbp = "GBP" + mxn = "MXN" + myr = "MYR" + inr = "INR" + hkd = "HKD" + brl = "BRL" + twd = "TWD" + eur = "EUR" + chf = "CHF" + ars = "ARS" + aud = "AUD" + cny = "CNY" + +class AzureHybridUseBenefit(str, Enum): + + unknown = "Unknown" + yes = "Yes" + no = "No" + +class AssessmentSizingCriterion(str, Enum): + + performance_based = "PerformanceBased" + as_on_premises = "AsOnPremises" + +class AssessmentStatus(str, Enum): + + created = "Created" + updated = "Updated" + running = "Running" + completed = "Completed" + invalid = "Invalid" + +class AzureDiskType(str, Enum): + + unknown = "Unknown" + standard = "Standard" + premium = "Premium" + +class AzureDiskSize(str, Enum): + + unknown = "Unknown" + standard_s4 = "Standard_S4" + standard_s6 = "Standard_S6" + standard_s10 = "Standard_S10" + standard_s20 = "Standard_S20" + standard_s30 = "Standard_S30" + standard_s40 = "Standard_S40" + standard_s50 = "Standard_S50" + premium_p4 = "Premium_P4" + premium_p6 = "Premium_P6" + premium_p10 = "Premium_P10" + premium_p20 = "Premium_P20" + premium_p30 = "Premium_P30" + premium_p40 = "Premium_P40" + premium_p50 = "Premium_P50" + +class CloudSuitability(str, Enum): + + unknown = "Unknown" + not_suitable = "NotSuitable" + suitable = "Suitable" + conditionally_suitable = "ConditionallySuitable" + readiness_unknown = "ReadinessUnknown" + +class AzureDiskSuitabilityExplanation(str, Enum): + + unknown = "Unknown" + not_applicable = "NotApplicable" + disk_size_greater_than_supported = "DiskSizeGreaterThanSupported" + no_suitable_disk_size_for_iops = "NoSuitableDiskSizeForIops" + no_suitable_disk_size_for_throughput = "NoSuitableDiskSizeForThroughput" + no_disk_size_found_in_selected_location = "NoDiskSizeFoundInSelectedLocation" + no_disk_size_found_for_selected_redundancy = "NoDiskSizeFoundForSelectedRedundancy" + internal_error_occurred_for_disk_evaluation = "InternalErrorOccurredForDiskEvaluation" + +class AzureNetworkAdapterSuitabilityExplanation(str, Enum): + + unknown = "Unknown" + not_applicable = "NotApplicable" + internal_error_occured = "InternalErrorOccured" + +class AzureVmSize(str, Enum): + + unknown = "Unknown" + basic_a0 = "Basic_A0" + basic_a1 = "Basic_A1" + basic_a2 = "Basic_A2" + basic_a3 = "Basic_A3" + basic_a4 = "Basic_A4" + standard_a0 = "Standard_A0" + standard_a1 = "Standard_A1" + standard_a2 = "Standard_A2" + standard_a3 = "Standard_A3" + standard_a4 = "Standard_A4" + standard_a5 = "Standard_A5" + standard_a6 = "Standard_A6" + standard_a7 = "Standard_A7" + standard_a8 = "Standard_A8" + standard_a9 = "Standard_A9" + standard_a10 = "Standard_A10" + standard_a11 = "Standard_A11" + standard_a1_v2 = "Standard_A1_v2" + standard_a2_v2 = "Standard_A2_v2" + standard_a4_v2 = "Standard_A4_v2" + standard_a8_v2 = "Standard_A8_v2" + standard_a2_mv2 = "Standard_A2m_v2" + standard_a4_mv2 = "Standard_A4m_v2" + standard_a8_mv2 = "Standard_A8m_v2" + standard_d1 = "Standard_D1" + standard_d2 = "Standard_D2" + standard_d3 = "Standard_D3" + standard_d4 = "Standard_D4" + standard_d11 = "Standard_D11" + standard_d12 = "Standard_D12" + standard_d13 = "Standard_D13" + standard_d14 = "Standard_D14" + standard_d1_v2 = "Standard_D1_v2" + standard_d2_v2 = "Standard_D2_v2" + standard_d3_v2 = "Standard_D3_v2" + standard_d4_v2 = "Standard_D4_v2" + standard_d5_v2 = "Standard_D5_v2" + standard_d11_v2 = "Standard_D11_v2" + standard_d12_v2 = "Standard_D12_v2" + standard_d13_v2 = "Standard_D13_v2" + standard_d14_v2 = "Standard_D14_v2" + standard_d15_v2 = "Standard_D15_v2" + standard_ds1 = "Standard_DS1" + standard_ds2 = "Standard_DS2" + standard_ds3 = "Standard_DS3" + standard_ds4 = "Standard_DS4" + standard_ds11 = "Standard_DS11" + standard_ds12 = "Standard_DS12" + standard_ds13 = "Standard_DS13" + standard_ds14 = "Standard_DS14" + standard_ds1_v2 = "Standard_DS1_v2" + standard_ds2_v2 = "Standard_DS2_v2" + standard_ds3_v2 = "Standard_DS3_v2" + standard_ds4_v2 = "Standard_DS4_v2" + standard_ds5_v2 = "Standard_DS5_v2" + standard_ds11_v2 = "Standard_DS11_v2" + standard_ds12_v2 = "Standard_DS12_v2" + standard_ds13_v2 = "Standard_DS13_v2" + standard_ds14_v2 = "Standard_DS14_v2" + standard_ds15_v2 = "Standard_DS15_v2" + standard_f1 = "Standard_F1" + standard_f2 = "Standard_F2" + standard_f4 = "Standard_F4" + standard_f8 = "Standard_F8" + standard_f16 = "Standard_F16" + standard_f1_s = "Standard_F1s" + standard_f2_s = "Standard_F2s" + standard_f4_s = "Standard_F4s" + standard_f8_s = "Standard_F8s" + standard_f16_s = "Standard_F16s" + standard_g1 = "Standard_G1" + standard_g2 = "Standard_G2" + standard_g3 = "Standard_G3" + standard_g4 = "Standard_G4" + standard_g5 = "Standard_G5" + standard_gs1 = "Standard_GS1" + standard_gs2 = "Standard_GS2" + standard_gs3 = "Standard_GS3" + standard_gs4 = "Standard_GS4" + standard_gs5 = "Standard_GS5" + standard_h8 = "Standard_H8" + standard_h16 = "Standard_H16" + standard_h8_m = "Standard_H8m" + standard_h16_m = "Standard_H16m" + standard_h16_r = "Standard_H16r" + standard_h16_mr = "Standard_H16mr" + standard_l4_s = "Standard_L4s" + standard_l8_s = "Standard_L8s" + standard_l16_s = "Standard_L16s" + standard_l32_s = "Standard_L32s" + +class AzureVmSuitabilityExplanation(str, Enum): + + unknown = "Unknown" + not_applicable = "NotApplicable" + guest_operating_system_architecture_not_supported = "GuestOperatingSystemArchitectureNotSupported" + guest_operating_system_not_supported = "GuestOperatingSystemNotSupported" + boot_type_not_supported = "BootTypeNotSupported" + more_disks_than_supported = "MoreDisksThanSupported" + no_suitable_vm_size_found = "NoSuitableVmSizeFound" + one_or_more_disks_not_suitable = "OneOrMoreDisksNotSuitable" + one_or_more_adapters_not_suitable = "OneOrMoreAdaptersNotSuitable" + internal_error_occured_during_compute_evaluation = "InternalErrorOccuredDuringComputeEvaluation" + internal_error_occured_during_storage_evaluation = "InternalErrorOccuredDuringStorageEvaluation" + internal_error_occured_during_network_evaluation = "InternalErrorOccuredDuringNetworkEvaluation" + no_vm_size_supports_storage_performance = "NoVmSizeSupportsStoragePerformance" + no_vm_size_supports_network_performance = "NoVmSizeSupportsNetworkPerformance" + no_vm_size_for_selected_pricing_tier = "NoVmSizeForSelectedPricingTier" + no_vm_size_for_selected_azure_location = "NoVmSizeForSelectedAzureLocation" + check_red_hat_linux_version = "CheckRedHatLinuxVersion" + check_open_suse_linux_version = "CheckOpenSuseLinuxVersion" + check_windows_server2008_r2_version = "CheckWindowsServer2008R2Version" + check_cent_os_version = "CheckCentOsVersion" + check_debian_linux_version = "CheckDebianLinuxVersion" + check_suse_linux_version = "CheckSuseLinuxVersion" + check_oracle_linux_version = "CheckOracleLinuxVersion" + check_ubuntu_linux_version = "CheckUbuntuLinuxVersion" + check_core_os_linux_version = "CheckCoreOsLinuxVersion" + windows_server_version_conditionally_supported = "WindowsServerVersionConditionallySupported" + no_guest_operating_system_conditionally_supported = "NoGuestOperatingSystemConditionallySupported" + windows_client_versions_conditionally_supported = "WindowsClientVersionsConditionallySupported" + boot_type_unknown = "BootTypeUnknown" + guest_operating_system_unknown = "GuestOperatingSystemUnknown" + windows_server_versions_supported_with_caveat = "WindowsServerVersionsSupportedWithCaveat" + windows_os_no_longer_under_ms_support = "WindowsOSNoLongerUnderMSSupport" + endorsed_with_conditions_linux_distributions = "EndorsedWithConditionsLinuxDistributions" + unendorsed_linux_distributions = "UnendorsedLinuxDistributions" + no_vm_size_for_standard_pricing_tier = "NoVmSizeForStandardPricingTier" + no_vm_size_for_basic_pricing_tier = "NoVmSizeForBasicPricingTier" + +class NameAvailabilityReason(str, Enum): + + available = "Available" + invalid = "Invalid" + already_exists = "AlreadyExists" diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/models/_models.py b/src/migrate/azext_migrate/vendored_sdks/migrate/models/_models.py new file mode 100644 index 00000000000..fa140729c44 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/models/_models.py @@ -0,0 +1,2146 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 AssessedDisk(msrest.serialization.Model): + """A disk assessed for an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the assessed disk. + :vartype name: str + :ivar gigabytes_provisioned: Gigabytes of storage provisioned for this disk. + :vartype gigabytes_provisioned: float + :ivar gigabytes_consumed: Gigabytes of storage consumed by this disk. + :vartype gigabytes_consumed: float + :ivar megabytes_per_second_of_read: Disk throughput in MegaBytes per second. + :vartype megabytes_per_second_of_read: float + :ivar megabytes_per_second_of_read_data_points_expected: Expected data points for MegaBytes per + second of read. + :vartype megabytes_per_second_of_read_data_points_expected: int + :ivar megabytes_per_second_of_read_data_points_received: Received data points for MegaBytes per + second of read. + :vartype megabytes_per_second_of_read_data_points_received: int + :ivar megabytes_per_second_of_write: Disk throughput in MegaBytes per second. + :vartype megabytes_per_second_of_write: float + :ivar megabytes_per_second_of_write_data_points_expected: Expected data points for MegaBytes + per second of write. + :vartype megabytes_per_second_of_write_data_points_expected: int + :ivar megabytes_per_second_of_write_data_points_received: Received data points for MegaBytes + per second of write. + :vartype megabytes_per_second_of_write_data_points_received: int + :ivar number_of_read_operations_per_second: Number of read operations per second for the disk. + :vartype number_of_read_operations_per_second: float + :ivar number_of_read_operations_per_second_data_points_expected: Expected number of data points + for read operations per second. + :vartype number_of_read_operations_per_second_data_points_expected: int + :ivar number_of_read_operations_per_second_data_points_received: Received number of data points + for read operations per second. + :vartype number_of_read_operations_per_second_data_points_received: int + :ivar number_of_write_operations_per_second: Number of read and write operations per second for + the disk. + :vartype number_of_write_operations_per_second: float + :ivar number_of_write_operations_per_second_data_points_expected: Expected number of data + points for write operations per second. + :vartype number_of_write_operations_per_second_data_points_expected: int + :ivar number_of_write_operations_per_second_data_points_received: Received number of data + points for write operations per second. + :vartype number_of_write_operations_per_second_data_points_received: int + :ivar monthly_storage_cost: Estimated aggregate storage cost for a 31-day month for this disk. + :vartype monthly_storage_cost: float + :ivar recommended_disk_type: Storage type selected for this disk. Possible values include: + 'Unknown', 'Standard', 'Premium'. + :vartype recommended_disk_type: str or ~azure_migrate.models.AzureDiskType + :ivar recommended_disk_size: Recommended Azure size for the disk, given utilization data and + preferences set on Assessment. Possible values include: 'Unknown', 'Standard_S4', + 'Standard_S6', 'Standard_S10', 'Standard_S20', 'Standard_S30', 'Standard_S40', 'Standard_S50', + 'Premium_P4', 'Premium_P6', 'Premium_P10', 'Premium_P20', 'Premium_P30', 'Premium_P40', + 'Premium_P50'. + :vartype recommended_disk_size: str or ~azure_migrate.models.AzureDiskSize + :ivar gigabytes_for_recommended_disk_size: Gigabytes of storage provided by the recommended + Azure disk size. + :vartype gigabytes_for_recommended_disk_size: int + :ivar suitability: Whether this disk is suitable for Azure. Possible values include: 'Unknown', + 'NotSuitable', 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown'. + :vartype suitability: str or ~azure_migrate.models.CloudSuitability + :ivar suitability_explanation: If disk is suitable, this explains the reasons and mitigation + steps. Possible values include: 'Unknown', 'NotApplicable', 'DiskSizeGreaterThanSupported', + 'NoSuitableDiskSizeForIops', 'NoSuitableDiskSizeForThroughput', + 'NoDiskSizeFoundInSelectedLocation', 'NoDiskSizeFoundForSelectedRedundancy', + 'InternalErrorOccurredForDiskEvaluation'. + :vartype suitability_explanation: str or ~azure_migrate.models.AzureDiskSuitabilityExplanation + """ + + _validation = { + 'name': {'readonly': True}, + 'gigabytes_provisioned': {'readonly': True}, + 'gigabytes_consumed': {'readonly': True}, + 'megabytes_per_second_of_read': {'readonly': True}, + 'megabytes_per_second_of_read_data_points_expected': {'readonly': True}, + 'megabytes_per_second_of_read_data_points_received': {'readonly': True}, + 'megabytes_per_second_of_write': {'readonly': True}, + 'megabytes_per_second_of_write_data_points_expected': {'readonly': True}, + 'megabytes_per_second_of_write_data_points_received': {'readonly': True}, + 'number_of_read_operations_per_second': {'readonly': True}, + 'number_of_read_operations_per_second_data_points_expected': {'readonly': True}, + 'number_of_read_operations_per_second_data_points_received': {'readonly': True}, + 'number_of_write_operations_per_second': {'readonly': True}, + 'number_of_write_operations_per_second_data_points_expected': {'readonly': True}, + 'number_of_write_operations_per_second_data_points_received': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'recommended_disk_type': {'readonly': True}, + 'recommended_disk_size': {'readonly': True}, + 'gigabytes_for_recommended_disk_size': {'readonly': True}, + 'suitability': {'readonly': True}, + 'suitability_explanation': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'gigabytes_provisioned': {'key': 'gigabytesProvisioned', 'type': 'float'}, + 'gigabytes_consumed': {'key': 'gigabytesConsumed', 'type': 'float'}, + 'megabytes_per_second_of_read': {'key': 'megabytesPerSecondOfRead', 'type': 'float'}, + 'megabytes_per_second_of_read_data_points_expected': {'key': 'megabytesPerSecondOfReadDataPointsExpected', 'type': 'int'}, + 'megabytes_per_second_of_read_data_points_received': {'key': 'megabytesPerSecondOfReadDataPointsReceived', 'type': 'int'}, + 'megabytes_per_second_of_write': {'key': 'megabytesPerSecondOfWrite', 'type': 'float'}, + 'megabytes_per_second_of_write_data_points_expected': {'key': 'megabytesPerSecondOfWriteDataPointsExpected', 'type': 'int'}, + 'megabytes_per_second_of_write_data_points_received': {'key': 'megabytesPerSecondOfWriteDataPointsReceived', 'type': 'int'}, + 'number_of_read_operations_per_second': {'key': 'numberOfReadOperationsPerSecond', 'type': 'float'}, + 'number_of_read_operations_per_second_data_points_expected': {'key': 'numberOfReadOperationsPerSecondDataPointsExpected', 'type': 'int'}, + 'number_of_read_operations_per_second_data_points_received': {'key': 'numberOfReadOperationsPerSecondDataPointsReceived', 'type': 'int'}, + 'number_of_write_operations_per_second': {'key': 'numberOfWriteOperationsPerSecond', 'type': 'float'}, + 'number_of_write_operations_per_second_data_points_expected': {'key': 'numberOfWriteOperationsPerSecondDataPointsExpected', 'type': 'int'}, + 'number_of_write_operations_per_second_data_points_received': {'key': 'numberOfWriteOperationsPerSecondDataPointsReceived', 'type': 'int'}, + 'monthly_storage_cost': {'key': 'monthlyStorageCost', 'type': 'float'}, + 'recommended_disk_type': {'key': 'recommendedDiskType', 'type': 'str'}, + 'recommended_disk_size': {'key': 'recommendedDiskSize', 'type': 'str'}, + 'gigabytes_for_recommended_disk_size': {'key': 'gigabytesForRecommendedDiskSize', 'type': 'int'}, + 'suitability': {'key': 'suitability', 'type': 'str'}, + 'suitability_explanation': {'key': 'suitabilityExplanation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessedDisk, self).__init__(**kwargs) + self.name = None + self.gigabytes_provisioned = None + self.gigabytes_consumed = None + self.megabytes_per_second_of_read = None + self.megabytes_per_second_of_read_data_points_expected = None + self.megabytes_per_second_of_read_data_points_received = None + self.megabytes_per_second_of_write = None + self.megabytes_per_second_of_write_data_points_expected = None + self.megabytes_per_second_of_write_data_points_received = None + self.number_of_read_operations_per_second = None + self.number_of_read_operations_per_second_data_points_expected = None + self.number_of_read_operations_per_second_data_points_received = None + self.number_of_write_operations_per_second = None + self.number_of_write_operations_per_second_data_points_expected = None + self.number_of_write_operations_per_second_data_points_received = None + self.monthly_storage_cost = None + self.recommended_disk_type = None + self.recommended_disk_size = None + self.gigabytes_for_recommended_disk_size = None + self.suitability = None + self.suitability_explanation = None + + +class AssessedMachine(msrest.serialization.Model): + """A machine evaluated as part of an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Path reference to this assessed machine. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}. + :vartype id: str + :ivar name: Name of the machine. + :vartype name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :ivar type: Type of the object = + [Microsoft.Migrate/projects/groups/assessments/assessedMachines]. + :vartype type: str + :ivar groups: List of references to the groups that the machine is member of. + :vartype groups: list[str] + :ivar discovered_timestamp: Time when this machine was discovered by Azure Migrate agent. Date- + Time represented in ISO-8601 format. + :vartype discovered_timestamp: ~datetime.datetime + :ivar boot_type: Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS'. + :vartype boot_type: str or ~azure_migrate.models.MachineBootType + :ivar datacenter_container: Container defined in the management solution that this machine is + part of in the datacenter. + :vartype datacenter_container: str + :ivar datacenter_management_server: Name of the server hosting the datacenter management + solution. + :vartype datacenter_management_server: str + :ivar datacenter_machine_id: ID of the machine as tracked by the datacenter management + solution. + :vartype datacenter_machine_id: str + :ivar datacenter_management_server_id: ID of the server hosting the datacenter management + solution. + :vartype datacenter_management_server_id: str + :ivar description: Description of the machine. + :vartype description: str + :ivar display_name: User readable name of the machine as defined by the user in their private + datacenter. + :vartype display_name: str + :ivar megabytes_of_memory: Memory in Megabytes. + :vartype megabytes_of_memory: float + :ivar number_of_cores: Processor count. + :vartype number_of_cores: int + :ivar operating_system: Operating System of the machine. + :vartype operating_system: str + :ivar monthly_bandwidth_cost: Monthly network cost estimate for the network adapters that are + attached to this machine as a group, for a 31-day month. + :vartype monthly_bandwidth_cost: float + :ivar monthly_storage_cost: Monthly storage cost estimate for the disks that are attached to + this machine as a group, for a 31-day month. + :vartype monthly_storage_cost: float + :ivar disks: Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk + object. + :vartype disks: dict[str, ~azure_migrate.models.AssessedDisk] + :ivar network_adapters: Dictionary of network adapters attached to the machine. Key is name of + the adapter. Value is a network adapter object. + :vartype network_adapters: dict[str, ~azure_migrate.models.AssessedNetworkAdapter] + :ivar recommended_size: Recommended Azure size for this machine. Possible values include: + 'Unknown', 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', + 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', + 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', + 'Standard_A8m_v2', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', + 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', + 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', + 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', + 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_F1', 'Standard_F2', 'Standard_F4', + 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', + 'Standard_F16s', 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_H8', + 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', + 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s'. + :vartype recommended_size: str or ~azure_migrate.models.AzureVmSize + :ivar number_of_cores_for_recommended_size: Number of CPU cores in the Recommended Azure VM + Size. + :vartype number_of_cores_for_recommended_size: int + :ivar megabytes_of_memory_for_recommended_size: Megabytes of memory in the Recommended Azure VM + Size. + :vartype megabytes_of_memory_for_recommended_size: float + :ivar monthly_compute_cost_for_recommended_size: Compute Cost for a 31-day month, if the + machine is migrated to Azure with the Recommended Size. + :vartype monthly_compute_cost_for_recommended_size: float + :ivar percentage_cores_utilization: Utilization percentage of the processor core as observed in + the private data center, in the Time Range selected on Assessment, reported as the Percentile + value based on the percentile number selected in assessment. + :vartype percentage_cores_utilization: float + :ivar percentage_memory_utilization: Utilization percentage of the memory as observed in the + private data center, in the Time Range selected on Assessment, reported as the Percentile value + based on the percentile number selected in assessment. + :vartype percentage_memory_utilization: float + :ivar percentage_cores_utilization_data_points_expected: Expected data points for percentage of + cores utilization. + :vartype percentage_cores_utilization_data_points_expected: int + :ivar percentage_cores_utilization_data_points_received: Received data points for percentage of + cores utilization. + :vartype percentage_cores_utilization_data_points_received: int + :ivar percentage_memory_utilization_data_points_expected: Expected data points for percentage + of memory utilization. + :vartype percentage_memory_utilization_data_points_expected: int + :ivar percentage_memory_utilization_data_points_received: Received data points for percentage + of memory utilization. + :vartype percentage_memory_utilization_data_points_received: int + :ivar suitability: Whether this disk is suitable for Azure. Possible values include: 'Unknown', + 'NotSuitable', 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown'. + :vartype suitability: str or ~azure_migrate.models.CloudSuitability + :ivar suitability_explanation: If machine is not ready to be migrated, this explains the + reasons and mitigation steps. Possible values include: 'Unknown', 'NotApplicable', + 'GuestOperatingSystemArchitectureNotSupported', 'GuestOperatingSystemNotSupported', + 'BootTypeNotSupported', 'MoreDisksThanSupported', 'NoSuitableVmSizeFound', + 'OneOrMoreDisksNotSuitable', 'OneOrMoreAdaptersNotSuitable', + 'InternalErrorOccuredDuringComputeEvaluation', 'InternalErrorOccuredDuringStorageEvaluation', + 'InternalErrorOccuredDuringNetworkEvaluation', 'NoVmSizeSupportsStoragePerformance', + 'NoVmSizeSupportsNetworkPerformance', 'NoVmSizeForSelectedPricingTier', + 'NoVmSizeForSelectedAzureLocation', 'CheckRedHatLinuxVersion', 'CheckOpenSuseLinuxVersion', + 'CheckWindowsServer2008R2Version', 'CheckCentOsVersion', 'CheckDebianLinuxVersion', + 'CheckSuseLinuxVersion', 'CheckOracleLinuxVersion', 'CheckUbuntuLinuxVersion', + 'CheckCoreOsLinuxVersion', 'WindowsServerVersionConditionallySupported', + 'NoGuestOperatingSystemConditionallySupported', 'WindowsClientVersionsConditionallySupported', + 'BootTypeUnknown', 'GuestOperatingSystemUnknown', 'WindowsServerVersionsSupportedWithCaveat', + 'WindowsOSNoLongerUnderMSSupport', 'EndorsedWithConditionsLinuxDistributions', + 'UnendorsedLinuxDistributions', 'NoVmSizeForStandardPricingTier', + 'NoVmSizeForBasicPricingTier'. + :vartype suitability_explanation: str or ~azure_migrate.models.AzureVmSuitabilityExplanation + :ivar created_timestamp: Time when this machine was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this machine was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'groups': {'readonly': True}, + 'discovered_timestamp': {'readonly': True}, + 'boot_type': {'readonly': True}, + 'datacenter_container': {'readonly': True}, + 'datacenter_management_server': {'readonly': True}, + 'datacenter_machine_id': {'readonly': True}, + 'datacenter_management_server_id': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'megabytes_of_memory': {'readonly': True}, + 'number_of_cores': {'readonly': True}, + 'operating_system': {'readonly': True}, + 'monthly_bandwidth_cost': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'disks': {'readonly': True}, + 'network_adapters': {'readonly': True}, + 'recommended_size': {'readonly': True}, + 'number_of_cores_for_recommended_size': {'readonly': True}, + 'megabytes_of_memory_for_recommended_size': {'readonly': True}, + 'monthly_compute_cost_for_recommended_size': {'readonly': True}, + 'percentage_cores_utilization': {'readonly': True}, + 'percentage_memory_utilization': {'readonly': True}, + 'percentage_cores_utilization_data_points_expected': {'readonly': True}, + 'percentage_cores_utilization_data_points_received': {'readonly': True}, + 'percentage_memory_utilization_data_points_expected': {'readonly': True}, + 'percentage_memory_utilization_data_points_received': {'readonly': True}, + 'suitability': {'readonly': True}, + 'suitability_explanation': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'groups': {'key': 'properties.groups', 'type': '[str]'}, + 'discovered_timestamp': {'key': 'properties.discoveredTimestamp', 'type': 'iso-8601'}, + 'boot_type': {'key': 'properties.bootType', 'type': 'str'}, + 'datacenter_container': {'key': 'properties.datacenterContainer', 'type': 'str'}, + 'datacenter_management_server': {'key': 'properties.datacenterManagementServer', 'type': 'str'}, + 'datacenter_machine_id': {'key': 'properties.datacenterMachineId', 'type': 'str'}, + 'datacenter_management_server_id': {'key': 'properties.datacenterManagementServerId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'megabytes_of_memory': {'key': 'properties.megabytesOfMemory', 'type': 'float'}, + 'number_of_cores': {'key': 'properties.numberOfCores', 'type': 'int'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'monthly_bandwidth_cost': {'key': 'properties.monthlyBandwidthCost', 'type': 'float'}, + 'monthly_storage_cost': {'key': 'properties.monthlyStorageCost', 'type': 'float'}, + 'disks': {'key': 'properties.disks', 'type': '{AssessedDisk}'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '{AssessedNetworkAdapter}'}, + 'recommended_size': {'key': 'properties.recommendedSize', 'type': 'str'}, + 'number_of_cores_for_recommended_size': {'key': 'properties.numberOfCoresForRecommendedSize', 'type': 'int'}, + 'megabytes_of_memory_for_recommended_size': {'key': 'properties.megabytesOfMemoryForRecommendedSize', 'type': 'float'}, + 'monthly_compute_cost_for_recommended_size': {'key': 'properties.monthlyComputeCostForRecommendedSize', 'type': 'float'}, + 'percentage_cores_utilization': {'key': 'properties.percentageCoresUtilization', 'type': 'float'}, + 'percentage_memory_utilization': {'key': 'properties.percentageMemoryUtilization', 'type': 'float'}, + 'percentage_cores_utilization_data_points_expected': {'key': 'properties.percentageCoresUtilizationDataPointsExpected', 'type': 'int'}, + 'percentage_cores_utilization_data_points_received': {'key': 'properties.percentageCoresUtilizationDataPointsReceived', 'type': 'int'}, + 'percentage_memory_utilization_data_points_expected': {'key': 'properties.percentageMemoryUtilizationDataPointsExpected', 'type': 'int'}, + 'percentage_memory_utilization_data_points_received': {'key': 'properties.percentageMemoryUtilizationDataPointsReceived', 'type': 'int'}, + 'suitability': {'key': 'properties.suitability', 'type': 'str'}, + 'suitability_explanation': {'key': 'properties.suitabilityExplanation', 'type': 'str'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessedMachine, self).__init__(**kwargs) + self.id = None + self.name = None + self.e_tag = kwargs.get('e_tag', None) + self.type = None + self.groups = None + self.discovered_timestamp = None + self.boot_type = None + self.datacenter_container = None + self.datacenter_management_server = None + self.datacenter_machine_id = None + self.datacenter_management_server_id = None + self.description = None + self.display_name = None + self.megabytes_of_memory = None + self.number_of_cores = None + self.operating_system = None + self.monthly_bandwidth_cost = None + self.monthly_storage_cost = None + self.disks = None + self.network_adapters = None + self.recommended_size = None + self.number_of_cores_for_recommended_size = None + self.megabytes_of_memory_for_recommended_size = None + self.monthly_compute_cost_for_recommended_size = None + self.percentage_cores_utilization = None + self.percentage_memory_utilization = None + self.percentage_cores_utilization_data_points_expected = None + self.percentage_cores_utilization_data_points_received = None + self.percentage_memory_utilization_data_points_expected = None + self.percentage_memory_utilization_data_points_received = None + self.suitability = None + self.suitability_explanation = None + self.created_timestamp = None + self.updated_timestamp = None + + +class AssessedMachineProperties(msrest.serialization.Model): + """Properties of an assessed machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar groups: List of references to the groups that the machine is member of. + :vartype groups: list[str] + :ivar discovered_timestamp: Time when this machine was discovered by Azure Migrate agent. Date- + Time represented in ISO-8601 format. + :vartype discovered_timestamp: ~datetime.datetime + :ivar boot_type: Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS'. + :vartype boot_type: str or ~azure_migrate.models.MachineBootType + :ivar datacenter_container: Container defined in the management solution that this machine is + part of in the datacenter. + :vartype datacenter_container: str + :ivar datacenter_management_server: Name of the server hosting the datacenter management + solution. + :vartype datacenter_management_server: str + :ivar datacenter_machine_id: ID of the machine as tracked by the datacenter management + solution. + :vartype datacenter_machine_id: str + :ivar datacenter_management_server_id: ID of the server hosting the datacenter management + solution. + :vartype datacenter_management_server_id: str + :ivar description: Description of the machine. + :vartype description: str + :ivar display_name: User readable name of the machine as defined by the user in their private + datacenter. + :vartype display_name: str + :ivar megabytes_of_memory: Memory in Megabytes. + :vartype megabytes_of_memory: float + :ivar number_of_cores: Processor count. + :vartype number_of_cores: int + :ivar operating_system: Operating System of the machine. + :vartype operating_system: str + :ivar monthly_bandwidth_cost: Monthly network cost estimate for the network adapters that are + attached to this machine as a group, for a 31-day month. + :vartype monthly_bandwidth_cost: float + :ivar monthly_storage_cost: Monthly storage cost estimate for the disks that are attached to + this machine as a group, for a 31-day month. + :vartype monthly_storage_cost: float + :ivar disks: Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk + object. + :vartype disks: dict[str, ~azure_migrate.models.AssessedDisk] + :ivar network_adapters: Dictionary of network adapters attached to the machine. Key is name of + the adapter. Value is a network adapter object. + :vartype network_adapters: dict[str, ~azure_migrate.models.AssessedNetworkAdapter] + :ivar recommended_size: Recommended Azure size for this machine. Possible values include: + 'Unknown', 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', + 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', + 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', + 'Standard_A8m_v2', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', + 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', + 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', + 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', + 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_F1', 'Standard_F2', 'Standard_F4', + 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', + 'Standard_F16s', 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_H8', + 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', + 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s'. + :vartype recommended_size: str or ~azure_migrate.models.AzureVmSize + :ivar number_of_cores_for_recommended_size: Number of CPU cores in the Recommended Azure VM + Size. + :vartype number_of_cores_for_recommended_size: int + :ivar megabytes_of_memory_for_recommended_size: Megabytes of memory in the Recommended Azure VM + Size. + :vartype megabytes_of_memory_for_recommended_size: float + :ivar monthly_compute_cost_for_recommended_size: Compute Cost for a 31-day month, if the + machine is migrated to Azure with the Recommended Size. + :vartype monthly_compute_cost_for_recommended_size: float + :ivar percentage_cores_utilization: Utilization percentage of the processor core as observed in + the private data center, in the Time Range selected on Assessment, reported as the Percentile + value based on the percentile number selected in assessment. + :vartype percentage_cores_utilization: float + :ivar percentage_memory_utilization: Utilization percentage of the memory as observed in the + private data center, in the Time Range selected on Assessment, reported as the Percentile value + based on the percentile number selected in assessment. + :vartype percentage_memory_utilization: float + :ivar percentage_cores_utilization_data_points_expected: Expected data points for percentage of + cores utilization. + :vartype percentage_cores_utilization_data_points_expected: int + :ivar percentage_cores_utilization_data_points_received: Received data points for percentage of + cores utilization. + :vartype percentage_cores_utilization_data_points_received: int + :ivar percentage_memory_utilization_data_points_expected: Expected data points for percentage + of memory utilization. + :vartype percentage_memory_utilization_data_points_expected: int + :ivar percentage_memory_utilization_data_points_received: Received data points for percentage + of memory utilization. + :vartype percentage_memory_utilization_data_points_received: int + :ivar suitability: Whether this disk is suitable for Azure. Possible values include: 'Unknown', + 'NotSuitable', 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown'. + :vartype suitability: str or ~azure_migrate.models.CloudSuitability + :ivar suitability_explanation: If machine is not ready to be migrated, this explains the + reasons and mitigation steps. Possible values include: 'Unknown', 'NotApplicable', + 'GuestOperatingSystemArchitectureNotSupported', 'GuestOperatingSystemNotSupported', + 'BootTypeNotSupported', 'MoreDisksThanSupported', 'NoSuitableVmSizeFound', + 'OneOrMoreDisksNotSuitable', 'OneOrMoreAdaptersNotSuitable', + 'InternalErrorOccuredDuringComputeEvaluation', 'InternalErrorOccuredDuringStorageEvaluation', + 'InternalErrorOccuredDuringNetworkEvaluation', 'NoVmSizeSupportsStoragePerformance', + 'NoVmSizeSupportsNetworkPerformance', 'NoVmSizeForSelectedPricingTier', + 'NoVmSizeForSelectedAzureLocation', 'CheckRedHatLinuxVersion', 'CheckOpenSuseLinuxVersion', + 'CheckWindowsServer2008R2Version', 'CheckCentOsVersion', 'CheckDebianLinuxVersion', + 'CheckSuseLinuxVersion', 'CheckOracleLinuxVersion', 'CheckUbuntuLinuxVersion', + 'CheckCoreOsLinuxVersion', 'WindowsServerVersionConditionallySupported', + 'NoGuestOperatingSystemConditionallySupported', 'WindowsClientVersionsConditionallySupported', + 'BootTypeUnknown', 'GuestOperatingSystemUnknown', 'WindowsServerVersionsSupportedWithCaveat', + 'WindowsOSNoLongerUnderMSSupport', 'EndorsedWithConditionsLinuxDistributions', + 'UnendorsedLinuxDistributions', 'NoVmSizeForStandardPricingTier', + 'NoVmSizeForBasicPricingTier'. + :vartype suitability_explanation: str or ~azure_migrate.models.AzureVmSuitabilityExplanation + :ivar created_timestamp: Time when this machine was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this machine was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + """ + + _validation = { + 'groups': {'readonly': True}, + 'discovered_timestamp': {'readonly': True}, + 'boot_type': {'readonly': True}, + 'datacenter_container': {'readonly': True}, + 'datacenter_management_server': {'readonly': True}, + 'datacenter_machine_id': {'readonly': True}, + 'datacenter_management_server_id': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'megabytes_of_memory': {'readonly': True}, + 'number_of_cores': {'readonly': True}, + 'operating_system': {'readonly': True}, + 'monthly_bandwidth_cost': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'disks': {'readonly': True}, + 'network_adapters': {'readonly': True}, + 'recommended_size': {'readonly': True}, + 'number_of_cores_for_recommended_size': {'readonly': True}, + 'megabytes_of_memory_for_recommended_size': {'readonly': True}, + 'monthly_compute_cost_for_recommended_size': {'readonly': True}, + 'percentage_cores_utilization': {'readonly': True}, + 'percentage_memory_utilization': {'readonly': True}, + 'percentage_cores_utilization_data_points_expected': {'readonly': True}, + 'percentage_cores_utilization_data_points_received': {'readonly': True}, + 'percentage_memory_utilization_data_points_expected': {'readonly': True}, + 'percentage_memory_utilization_data_points_received': {'readonly': True}, + 'suitability': {'readonly': True}, + 'suitability_explanation': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'groups': {'key': 'groups', 'type': '[str]'}, + 'discovered_timestamp': {'key': 'discoveredTimestamp', 'type': 'iso-8601'}, + 'boot_type': {'key': 'bootType', 'type': 'str'}, + 'datacenter_container': {'key': 'datacenterContainer', 'type': 'str'}, + 'datacenter_management_server': {'key': 'datacenterManagementServer', 'type': 'str'}, + 'datacenter_machine_id': {'key': 'datacenterMachineId', 'type': 'str'}, + 'datacenter_management_server_id': {'key': 'datacenterManagementServerId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'megabytes_of_memory': {'key': 'megabytesOfMemory', 'type': 'float'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'operating_system': {'key': 'operatingSystem', 'type': 'str'}, + 'monthly_bandwidth_cost': {'key': 'monthlyBandwidthCost', 'type': 'float'}, + 'monthly_storage_cost': {'key': 'monthlyStorageCost', 'type': 'float'}, + 'disks': {'key': 'disks', 'type': '{AssessedDisk}'}, + 'network_adapters': {'key': 'networkAdapters', 'type': '{AssessedNetworkAdapter}'}, + 'recommended_size': {'key': 'recommendedSize', 'type': 'str'}, + 'number_of_cores_for_recommended_size': {'key': 'numberOfCoresForRecommendedSize', 'type': 'int'}, + 'megabytes_of_memory_for_recommended_size': {'key': 'megabytesOfMemoryForRecommendedSize', 'type': 'float'}, + 'monthly_compute_cost_for_recommended_size': {'key': 'monthlyComputeCostForRecommendedSize', 'type': 'float'}, + 'percentage_cores_utilization': {'key': 'percentageCoresUtilization', 'type': 'float'}, + 'percentage_memory_utilization': {'key': 'percentageMemoryUtilization', 'type': 'float'}, + 'percentage_cores_utilization_data_points_expected': {'key': 'percentageCoresUtilizationDataPointsExpected', 'type': 'int'}, + 'percentage_cores_utilization_data_points_received': {'key': 'percentageCoresUtilizationDataPointsReceived', 'type': 'int'}, + 'percentage_memory_utilization_data_points_expected': {'key': 'percentageMemoryUtilizationDataPointsExpected', 'type': 'int'}, + 'percentage_memory_utilization_data_points_received': {'key': 'percentageMemoryUtilizationDataPointsReceived', 'type': 'int'}, + 'suitability': {'key': 'suitability', 'type': 'str'}, + 'suitability_explanation': {'key': 'suitabilityExplanation', 'type': 'str'}, + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessedMachineProperties, self).__init__(**kwargs) + self.groups = None + self.discovered_timestamp = None + self.boot_type = None + self.datacenter_container = None + self.datacenter_management_server = None + self.datacenter_machine_id = None + self.datacenter_management_server_id = None + self.description = None + self.display_name = None + self.megabytes_of_memory = None + self.number_of_cores = None + self.operating_system = None + self.monthly_bandwidth_cost = None + self.monthly_storage_cost = None + self.disks = None + self.network_adapters = None + self.recommended_size = None + self.number_of_cores_for_recommended_size = None + self.megabytes_of_memory_for_recommended_size = None + self.monthly_compute_cost_for_recommended_size = None + self.percentage_cores_utilization = None + self.percentage_memory_utilization = None + self.percentage_cores_utilization_data_points_expected = None + self.percentage_cores_utilization_data_points_received = None + self.percentage_memory_utilization_data_points_expected = None + self.percentage_memory_utilization_data_points_received = None + self.suitability = None + self.suitability_explanation = None + self.created_timestamp = None + self.updated_timestamp = None + + +class AssessedMachineResultList(msrest.serialization.Model): + """List of assessed machines. + + :param value: List of assessed machines. + :type value: list[~azure_migrate.models.AssessedMachine] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AssessedMachine]'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessedMachineResultList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class AssessedNetworkAdapter(msrest.serialization.Model): + """A network adapter assessed for an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar mac_address: MAC Address of the network adapter. + :vartype mac_address: str + :ivar ip_addresses: List of IP Addresses on the network adapter. + :vartype ip_addresses: list[str] + :ivar monthly_bandwidth_costs: Monthly cost estimate for network bandwidth used by this network + adapter. + :vartype monthly_bandwidth_costs: float + :ivar megabytes_per_second_received: Adapter throughput for incoming traffic in MegaBytes per + second. + :vartype megabytes_per_second_received: float + :ivar megabytes_per_second_received_data_points_expected: Expected data points for incoming + traffic in MegaBytes per second. + :vartype megabytes_per_second_received_data_points_expected: int + :ivar megabytes_per_second_of_read_data_points_received: Received data points for incoming + traffic in MegaBytes per second. + :vartype megabytes_per_second_of_read_data_points_received: int + :ivar megabytes_per_second_transmitted: Adapter throughput for outgoing traffic in MegaBytes + per second. + :vartype megabytes_per_second_transmitted: float + :ivar megabytes_per_second_transmitted_data_points_expected: Expected data points for outgoing + traffic in MegaBytes per second. + :vartype megabytes_per_second_transmitted_data_points_expected: int + :ivar megabytes_per_second_transmitted_data_points_received: Received data points for outgoing + traffic in MegaBytes per second. + :vartype megabytes_per_second_transmitted_data_points_received: int + :param net_gigabytes_transmitted_per_month: Gigabytes transmitted through this adapter each + month. + :type net_gigabytes_transmitted_per_month: float + :ivar suitability: Whether this disk is suitable for Azure. Possible values include: 'Unknown', + 'NotSuitable', 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown'. + :vartype suitability: str or ~azure_migrate.models.CloudSuitability + :ivar suitability_explanation: If network adapter is suitable, this explains the reasons and + mitigation steps. Possible values include: 'Unknown', 'NotApplicable', 'InternalErrorOccured'. + :vartype suitability_explanation: str or + ~azure_migrate.models.AzureNetworkAdapterSuitabilityExplanation + """ + + _validation = { + 'mac_address': {'readonly': True}, + 'ip_addresses': {'readonly': True}, + 'monthly_bandwidth_costs': {'readonly': True}, + 'megabytes_per_second_received': {'readonly': True}, + 'megabytes_per_second_received_data_points_expected': {'readonly': True}, + 'megabytes_per_second_of_read_data_points_received': {'readonly': True}, + 'megabytes_per_second_transmitted': {'readonly': True}, + 'megabytes_per_second_transmitted_data_points_expected': {'readonly': True}, + 'megabytes_per_second_transmitted_data_points_received': {'readonly': True}, + 'suitability': {'readonly': True}, + 'suitability_explanation': {'readonly': True}, + } + + _attribute_map = { + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'monthly_bandwidth_costs': {'key': 'monthlyBandwidthCosts', 'type': 'float'}, + 'megabytes_per_second_received': {'key': 'megabytesPerSecondReceived', 'type': 'float'}, + 'megabytes_per_second_received_data_points_expected': {'key': 'megabytesPerSecondReceivedDataPointsExpected', 'type': 'int'}, + 'megabytes_per_second_of_read_data_points_received': {'key': 'megabytesPerSecondOfReadDataPointsReceived', 'type': 'int'}, + 'megabytes_per_second_transmitted': {'key': 'megabytesPerSecondTransmitted', 'type': 'float'}, + 'megabytes_per_second_transmitted_data_points_expected': {'key': 'megabytesPerSecondTransmittedDataPointsExpected', 'type': 'int'}, + 'megabytes_per_second_transmitted_data_points_received': {'key': 'megabytesPerSecondTransmittedDataPointsReceived', 'type': 'int'}, + 'net_gigabytes_transmitted_per_month': {'key': 'netGigabytesTransmittedPerMonth', 'type': 'float'}, + 'suitability': {'key': 'suitability', 'type': 'str'}, + 'suitability_explanation': {'key': 'suitabilityExplanation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessedNetworkAdapter, self).__init__(**kwargs) + self.mac_address = None + self.ip_addresses = None + self.monthly_bandwidth_costs = None + self.megabytes_per_second_received = None + self.megabytes_per_second_received_data_points_expected = None + self.megabytes_per_second_of_read_data_points_received = None + self.megabytes_per_second_transmitted = None + self.megabytes_per_second_transmitted_data_points_expected = None + self.megabytes_per_second_transmitted_data_points_received = None + self.net_gigabytes_transmitted_per_month = kwargs.get('net_gigabytes_transmitted_per_month', None) + self.suitability = None + self.suitability_explanation = None + + +class Assessment(msrest.serialization.Model): + """An assessment created for a group in the Migration project. + + 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 id: Path reference to this assessment. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessment/{assessmentName}. + :vartype id: str + :ivar name: Unique name of an assessment. + :vartype name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :ivar type: Type of the object = [Microsoft.Migrate/projects/groups/assessments]. + :vartype type: str + :param azure_location: Required. Target Azure location for which the machines should be + assessed. These enums are the same as used by Compute API. Possible values include: 'Unknown', + 'EastAsia', 'SoutheastAsia', 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth', + 'CanadaCentral', 'CanadaEast', 'WestEurope', 'NorthEurope', 'CentralIndia', 'SouthIndia', + 'WestIndia', 'JapanEast', 'JapanWest', 'KoreaCentral', 'KoreaSouth', 'UkWest', 'UkSouth', + 'NorthCentralUs', 'EastUs', 'WestUs2', 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', + 'WestCentralUs', 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast'. + :type azure_location: str or ~azure_migrate.models.AzureLocation + :param azure_offer_code: Required. Offer code according to which cost estimation is done. + Possible values include: 'Unknown', 'MSAZR0003P', 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', + 'MSAZR0062P', 'MSAZR0063P', 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P', + 'MSAZR0148P', 'MSAZR0025P', 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P', 'MSAZR0122P', + 'MSAZR0123P', 'MSAZR0124P', 'MSAZR0125P', 'MSAZR0126P', 'MSAZR0127P', 'MSAZR0128P', + 'MSAZR0129P', 'MSAZR0130P', 'MSAZR0111P', 'MSAZR0144P', 'MSAZR0149P', 'MSMCAZR0044P', + 'MSMCAZR0059P', 'MSMCAZR0060P', 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P', + 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P'. + :type azure_offer_code: str or ~azure_migrate.models.AzureOfferCode + :param azure_pricing_tier: Required. Pricing tier for Size evaluation. Possible values include: + 'Standard', 'Basic'. + :type azure_pricing_tier: str or ~azure_migrate.models.AzurePricingTier + :param azure_storage_redundancy: Required. Storage Redundancy type offered by Azure. Possible + values include: 'Unknown', 'LocallyRedundant', 'ZoneRedundant', 'GeoRedundant', + 'ReadAccessGeoRedundant'. + :type azure_storage_redundancy: str or ~azure_migrate.models.AzureStorageRedundancy + :param scaling_factor: Required. Scaling factor used over utilization data to add a performance + buffer for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = + 1.3. + :type scaling_factor: float + :param percentile: Required. Percentile of performance data used to recommend Azure size. + Possible values include: 'Percentile50', 'Percentile90', 'Percentile95', 'Percentile99'. + :type percentile: str or ~azure_migrate.models.Percentile + :param time_range: Required. Time range of performance data used to recommend a size. Possible + values include: 'Day', 'Week', 'Month'. + :type time_range: str or ~azure_migrate.models.TimeRange + :param stage: Required. User configurable setting that describes the status of the assessment. + Possible values include: 'InProgress', 'UnderReview', 'Approved'. + :type stage: str or ~azure_migrate.models.AssessmentStage + :param currency: Required. Currency to report prices in. Possible values include: 'Unknown', + 'USD', 'DKK', 'CAD', 'IDR', 'JPY', 'KRW', 'NZD', 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', + 'GBP', 'MXN', 'MYR', 'INR', 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY'. + :type currency: str or ~azure_migrate.models.Currency + :param azure_hybrid_use_benefit: Required. AHUB discount on windows virtual machines. Possible + values include: 'Unknown', 'Yes', 'No'. + :type azure_hybrid_use_benefit: str or ~azure_migrate.models.AzureHybridUseBenefit + :param discount_percentage: Required. Custom discount percentage to be applied on final costs. + Can be in the range [0, 100]. + :type discount_percentage: float + :ivar confidence_rating_in_percentage: Confidence rating percentage for assessment. Can be in + the range [0, 100]. + :vartype confidence_rating_in_percentage: float + :param sizing_criterion: Required. Assessment sizing criterion. Possible values include: + 'PerformanceBased', 'AsOnPremises'. + :type sizing_criterion: str or ~azure_migrate.models.AssessmentSizingCriterion + :ivar prices_timestamp: Time when the Azure Prices were queried. Date-Time represented in + ISO-8601 format. + :vartype prices_timestamp: ~datetime.datetime + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar monthly_compute_cost: Monthly compute cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_compute_cost: float + :ivar monthly_bandwidth_cost: Monthly network cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_bandwidth_cost: float + :ivar monthly_storage_cost: Monthly storage cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_storage_cost: float + :ivar status: Whether the assessment has been created and is valid. Possible values include: + 'Created', 'Updated', 'Running', 'Completed', 'Invalid'. + :vartype status: str or ~azure_migrate.models.AssessmentStatus + :ivar number_of_machines: Number of assessed machines part of this assessment. + :vartype number_of_machines: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'azure_location': {'required': True}, + 'azure_offer_code': {'required': True}, + 'azure_pricing_tier': {'required': True}, + 'azure_storage_redundancy': {'required': True}, + 'scaling_factor': {'required': True}, + 'percentile': {'required': True}, + 'time_range': {'required': True}, + 'stage': {'required': True}, + 'currency': {'required': True}, + 'azure_hybrid_use_benefit': {'required': True}, + 'discount_percentage': {'required': True}, + 'confidence_rating_in_percentage': {'readonly': True}, + 'sizing_criterion': {'required': True}, + 'prices_timestamp': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'monthly_compute_cost': {'readonly': True}, + 'monthly_bandwidth_cost': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'status': {'readonly': True}, + 'number_of_machines': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azure_location': {'key': 'properties.azureLocation', 'type': 'str'}, + 'azure_offer_code': {'key': 'properties.azureOfferCode', 'type': 'str'}, + 'azure_pricing_tier': {'key': 'properties.azurePricingTier', 'type': 'str'}, + 'azure_storage_redundancy': {'key': 'properties.azureStorageRedundancy', 'type': 'str'}, + 'scaling_factor': {'key': 'properties.scalingFactor', 'type': 'float'}, + 'percentile': {'key': 'properties.percentile', 'type': 'str'}, + 'time_range': {'key': 'properties.timeRange', 'type': 'str'}, + 'stage': {'key': 'properties.stage', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'azure_hybrid_use_benefit': {'key': 'properties.azureHybridUseBenefit', 'type': 'str'}, + 'discount_percentage': {'key': 'properties.discountPercentage', 'type': 'float'}, + 'confidence_rating_in_percentage': {'key': 'properties.confidenceRatingInPercentage', 'type': 'float'}, + 'sizing_criterion': {'key': 'properties.sizingCriterion', 'type': 'str'}, + 'prices_timestamp': {'key': 'properties.pricesTimestamp', 'type': 'iso-8601'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + 'monthly_compute_cost': {'key': 'properties.monthlyComputeCost', 'type': 'float'}, + 'monthly_bandwidth_cost': {'key': 'properties.monthlyBandwidthCost', 'type': 'float'}, + 'monthly_storage_cost': {'key': 'properties.monthlyStorageCost', 'type': 'float'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'number_of_machines': {'key': 'properties.numberOfMachines', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(Assessment, self).__init__(**kwargs) + self.id = None + self.name = None + self.e_tag = kwargs.get('e_tag', None) + self.type = None + self.azure_location = kwargs.get('azure_location', None) + self.azure_offer_code = kwargs.get('azure_offer_code', None) + self.azure_pricing_tier = kwargs.get('azure_pricing_tier', None) + self.azure_storage_redundancy = kwargs.get('azure_storage_redundancy', None) + self.scaling_factor = kwargs.get('scaling_factor', None) + self.percentile = kwargs.get('percentile', None) + self.time_range = kwargs.get('time_range', None) + self.stage = kwargs.get('stage', None) + self.currency = kwargs.get('currency', None) + self.azure_hybrid_use_benefit = kwargs.get('azure_hybrid_use_benefit', None) + self.discount_percentage = kwargs.get('discount_percentage', None) + self.confidence_rating_in_percentage = None + self.sizing_criterion = kwargs.get('sizing_criterion', None) + self.prices_timestamp = None + self.created_timestamp = None + self.updated_timestamp = None + self.monthly_compute_cost = None + self.monthly_bandwidth_cost = None + self.monthly_storage_cost = None + self.status = None + self.number_of_machines = None + + +class AssessmentOptionsResultList(msrest.serialization.Model): + """List of assessment options. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vm_families: Dictionary of VM families grouped by vm family name describing the targeted + azure locations of VM family and the category of the family. + :vartype vm_families: list[~azure_migrate.models.VmFamily] + :ivar reserved_instance_vm_families: List of supported VM Families. + :vartype reserved_instance_vm_families: list[str] + """ + + _validation = { + 'vm_families': {'readonly': True}, + 'reserved_instance_vm_families': {'readonly': True}, + } + + _attribute_map = { + 'vm_families': {'key': 'vmFamilies', 'type': '[VmFamily]'}, + 'reserved_instance_vm_families': {'key': 'reservedInstanceVmFamilies', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessmentOptionsResultList, self).__init__(**kwargs) + self.vm_families = None + self.reserved_instance_vm_families = None + + +class AssessmentProperties(msrest.serialization.Model): + """Properties of an assessment. + + 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. + + :param azure_location: Required. Target Azure location for which the machines should be + assessed. These enums are the same as used by Compute API. Possible values include: 'Unknown', + 'EastAsia', 'SoutheastAsia', 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth', + 'CanadaCentral', 'CanadaEast', 'WestEurope', 'NorthEurope', 'CentralIndia', 'SouthIndia', + 'WestIndia', 'JapanEast', 'JapanWest', 'KoreaCentral', 'KoreaSouth', 'UkWest', 'UkSouth', + 'NorthCentralUs', 'EastUs', 'WestUs2', 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', + 'WestCentralUs', 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast'. + :type azure_location: str or ~azure_migrate.models.AzureLocation + :param azure_offer_code: Required. Offer code according to which cost estimation is done. + Possible values include: 'Unknown', 'MSAZR0003P', 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', + 'MSAZR0062P', 'MSAZR0063P', 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P', + 'MSAZR0148P', 'MSAZR0025P', 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P', 'MSAZR0122P', + 'MSAZR0123P', 'MSAZR0124P', 'MSAZR0125P', 'MSAZR0126P', 'MSAZR0127P', 'MSAZR0128P', + 'MSAZR0129P', 'MSAZR0130P', 'MSAZR0111P', 'MSAZR0144P', 'MSAZR0149P', 'MSMCAZR0044P', + 'MSMCAZR0059P', 'MSMCAZR0060P', 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P', + 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P'. + :type azure_offer_code: str or ~azure_migrate.models.AzureOfferCode + :param azure_pricing_tier: Required. Pricing tier for Size evaluation. Possible values include: + 'Standard', 'Basic'. + :type azure_pricing_tier: str or ~azure_migrate.models.AzurePricingTier + :param azure_storage_redundancy: Required. Storage Redundancy type offered by Azure. Possible + values include: 'Unknown', 'LocallyRedundant', 'ZoneRedundant', 'GeoRedundant', + 'ReadAccessGeoRedundant'. + :type azure_storage_redundancy: str or ~azure_migrate.models.AzureStorageRedundancy + :param scaling_factor: Required. Scaling factor used over utilization data to add a performance + buffer for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = + 1.3. + :type scaling_factor: float + :param percentile: Required. Percentile of performance data used to recommend Azure size. + Possible values include: 'Percentile50', 'Percentile90', 'Percentile95', 'Percentile99'. + :type percentile: str or ~azure_migrate.models.Percentile + :param time_range: Required. Time range of performance data used to recommend a size. Possible + values include: 'Day', 'Week', 'Month'. + :type time_range: str or ~azure_migrate.models.TimeRange + :param stage: Required. User configurable setting that describes the status of the assessment. + Possible values include: 'InProgress', 'UnderReview', 'Approved'. + :type stage: str or ~azure_migrate.models.AssessmentStage + :param currency: Required. Currency to report prices in. Possible values include: 'Unknown', + 'USD', 'DKK', 'CAD', 'IDR', 'JPY', 'KRW', 'NZD', 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', + 'GBP', 'MXN', 'MYR', 'INR', 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY'. + :type currency: str or ~azure_migrate.models.Currency + :param azure_hybrid_use_benefit: Required. AHUB discount on windows virtual machines. Possible + values include: 'Unknown', 'Yes', 'No'. + :type azure_hybrid_use_benefit: str or ~azure_migrate.models.AzureHybridUseBenefit + :param discount_percentage: Required. Custom discount percentage to be applied on final costs. + Can be in the range [0, 100]. + :type discount_percentage: float + :ivar confidence_rating_in_percentage: Confidence rating percentage for assessment. Can be in + the range [0, 100]. + :vartype confidence_rating_in_percentage: float + :param sizing_criterion: Required. Assessment sizing criterion. Possible values include: + 'PerformanceBased', 'AsOnPremises'. + :type sizing_criterion: str or ~azure_migrate.models.AssessmentSizingCriterion + :ivar prices_timestamp: Time when the Azure Prices were queried. Date-Time represented in + ISO-8601 format. + :vartype prices_timestamp: ~datetime.datetime + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar monthly_compute_cost: Monthly compute cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_compute_cost: float + :ivar monthly_bandwidth_cost: Monthly network cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_bandwidth_cost: float + :ivar monthly_storage_cost: Monthly storage cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_storage_cost: float + :ivar status: Whether the assessment has been created and is valid. Possible values include: + 'Created', 'Updated', 'Running', 'Completed', 'Invalid'. + :vartype status: str or ~azure_migrate.models.AssessmentStatus + :ivar number_of_machines: Number of assessed machines part of this assessment. + :vartype number_of_machines: int + """ + + _validation = { + 'azure_location': {'required': True}, + 'azure_offer_code': {'required': True}, + 'azure_pricing_tier': {'required': True}, + 'azure_storage_redundancy': {'required': True}, + 'scaling_factor': {'required': True}, + 'percentile': {'required': True}, + 'time_range': {'required': True}, + 'stage': {'required': True}, + 'currency': {'required': True}, + 'azure_hybrid_use_benefit': {'required': True}, + 'discount_percentage': {'required': True}, + 'confidence_rating_in_percentage': {'readonly': True}, + 'sizing_criterion': {'required': True}, + 'prices_timestamp': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'monthly_compute_cost': {'readonly': True}, + 'monthly_bandwidth_cost': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'status': {'readonly': True}, + 'number_of_machines': {'readonly': True}, + } + + _attribute_map = { + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + 'azure_offer_code': {'key': 'azureOfferCode', 'type': 'str'}, + 'azure_pricing_tier': {'key': 'azurePricingTier', 'type': 'str'}, + 'azure_storage_redundancy': {'key': 'azureStorageRedundancy', 'type': 'str'}, + 'scaling_factor': {'key': 'scalingFactor', 'type': 'float'}, + 'percentile': {'key': 'percentile', 'type': 'str'}, + 'time_range': {'key': 'timeRange', 'type': 'str'}, + 'stage': {'key': 'stage', 'type': 'str'}, + 'currency': {'key': 'currency', 'type': 'str'}, + 'azure_hybrid_use_benefit': {'key': 'azureHybridUseBenefit', 'type': 'str'}, + 'discount_percentage': {'key': 'discountPercentage', 'type': 'float'}, + 'confidence_rating_in_percentage': {'key': 'confidenceRatingInPercentage', 'type': 'float'}, + 'sizing_criterion': {'key': 'sizingCriterion', 'type': 'str'}, + 'prices_timestamp': {'key': 'pricesTimestamp', 'type': 'iso-8601'}, + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + 'monthly_compute_cost': {'key': 'monthlyComputeCost', 'type': 'float'}, + 'monthly_bandwidth_cost': {'key': 'monthlyBandwidthCost', 'type': 'float'}, + 'monthly_storage_cost': {'key': 'monthlyStorageCost', 'type': 'float'}, + 'status': {'key': 'status', 'type': 'str'}, + 'number_of_machines': {'key': 'numberOfMachines', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessmentProperties, self).__init__(**kwargs) + self.azure_location = kwargs.get('azure_location', None) + self.azure_offer_code = kwargs.get('azure_offer_code', None) + self.azure_pricing_tier = kwargs.get('azure_pricing_tier', None) + self.azure_storage_redundancy = kwargs.get('azure_storage_redundancy', None) + self.scaling_factor = kwargs.get('scaling_factor', None) + self.percentile = kwargs.get('percentile', None) + self.time_range = kwargs.get('time_range', None) + self.stage = kwargs.get('stage', None) + self.currency = kwargs.get('currency', None) + self.azure_hybrid_use_benefit = kwargs.get('azure_hybrid_use_benefit', None) + self.discount_percentage = kwargs.get('discount_percentage', None) + self.confidence_rating_in_percentage = None + self.sizing_criterion = kwargs.get('sizing_criterion', None) + self.prices_timestamp = None + self.created_timestamp = None + self.updated_timestamp = None + self.monthly_compute_cost = None + self.monthly_bandwidth_cost = None + self.monthly_storage_cost = None + self.status = None + self.number_of_machines = None + + +class AssessmentResultList(msrest.serialization.Model): + """List of assessments. + + :param value: List of assessments. + :type value: list[~azure_migrate.models.Assessment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Assessment]'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessmentResultList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class CheckNameAvailabilityParameters(msrest.serialization.Model): + """Parameters for a check name availability request. + + 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. + + :param name: Required. The name to check for availability. + :type name: str + :ivar type: Required. The resource type. Must be set to Microsoft.Migrate/projects. Default + value: "Microsoft.Migrate/projects". + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Migrate/projects" + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name is available for you + to use. If true, the name is available. If false, the name has already been taken or invalid + and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a project name could not be used. The Reason element is only + returned if NameAvailable is false. Possible values include: 'Available', 'Invalid', + 'AlreadyExists'. + :vartype reason: str or ~azure_migrate.models.NameAvailabilityReason + :ivar message: Gets an error message explaining the Reason value in more detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudErrorException(HttpResponseError): + """Server responded with exception of type: 'CloudError'. + + :param response: Server response to be deserialized. + :param error_model: A deserialized model of the response body as model. + """ + + def __init__(self, response, error_model): + self.error = error_model + super(CloudErrorException, self).__init__(response=response, error_model=error_model) + + @classmethod + def from_response(cls, response, deserialize): + """Deserialize this response as this exception, or a subclass of this exception. + + :param response: Server response to be deserialized. + :param deserialize: A deserializer + """ + model_name = 'CloudError' + error = deserialize(model_name, response) + if error is None: + error = deserialize.dependencies[model_name]() + return error._EXCEPTION_TYPE(response, error) + + +class CloudError(msrest.serialization.Model): + """An error response from the Azure Migrate service. + + :param error: An error response from the Azure Migrate service. + :type error: ~azure_migrate.models.CloudErrorBody + """ + _EXCEPTION_TYPE = CloudErrorException + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Azure Migrate service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure_migrate.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class Disk(msrest.serialization.Model): + """A disk discovered on a machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar gigabytes_allocated: Gigabytes of storage provisioned for this disk. + :vartype gigabytes_allocated: float + :ivar gigabytes_consumed: Gigabytes of storage consumed by this disk. + :vartype gigabytes_consumed: float + """ + + _validation = { + 'gigabytes_allocated': {'readonly': True}, + 'gigabytes_consumed': {'readonly': True}, + } + + _attribute_map = { + 'gigabytes_allocated': {'key': 'gigabytesAllocated', 'type': 'float'}, + 'gigabytes_consumed': {'key': 'gigabytesConsumed', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(Disk, self).__init__(**kwargs) + self.gigabytes_allocated = None + self.gigabytes_consumed = None + + +class DownloadUrl(msrest.serialization.Model): + """Download URL for assessment report. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar assessment_report_url: Hyperlink to download report. + :vartype assessment_report_url: str + :ivar expiration_time: Expiry date of download url. + :vartype expiration_time: ~datetime.datetime + """ + + _validation = { + 'assessment_report_url': {'readonly': True}, + 'expiration_time': {'readonly': True}, + } + + _attribute_map = { + 'assessment_report_url': {'key': 'assessmentReportUrl', 'type': 'str'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(DownloadUrl, self).__init__(**kwargs) + self.assessment_report_url = None + self.expiration_time = None + + +class Group(msrest.serialization.Model): + """A group created in a Migration project. + + 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 id: Path reference to this group. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}. + :vartype id: str + :ivar name: Name of the group. + :vartype name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :ivar type: Type of the object = [Microsoft.Migrate/projects/groups]. + :vartype type: str + :param machines: Required. List of machine names that are part of this group. + :type machines: list[str] + :ivar assessments: List of References to Assessments created on this group. + :vartype assessments: list[str] + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'machines': {'required': True}, + 'assessments': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'machines': {'key': 'properties.machines', 'type': '[str]'}, + 'assessments': {'key': 'properties.assessments', 'type': '[str]'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(Group, self).__init__(**kwargs) + self.id = None + self.name = None + self.e_tag = kwargs.get('e_tag', None) + self.type = None + self.machines = kwargs.get('machines', None) + self.assessments = None + self.created_timestamp = None + self.updated_timestamp = None + + +class GroupProperties(msrest.serialization.Model): + """Properties of group resource. + + 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. + + :param machines: Required. List of machine names that are part of this group. + :type machines: list[str] + :ivar assessments: List of References to Assessments created on this group. + :vartype assessments: list[str] + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + """ + + _validation = { + 'machines': {'required': True}, + 'assessments': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'machines': {'key': 'machines', 'type': '[str]'}, + 'assessments': {'key': 'assessments', 'type': '[str]'}, + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(GroupProperties, self).__init__(**kwargs) + self.machines = kwargs.get('machines', None) + self.assessments = None + self.created_timestamp = None + self.updated_timestamp = None + + +class GroupResultList(msrest.serialization.Model): + """List of groups. + + :param value: List of groups. + :type value: list[~azure_migrate.models.Group] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Group]'}, + } + + def __init__( + self, + **kwargs + ): + super(GroupResultList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Machine(msrest.serialization.Model): + """A machine in a migration project. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Path reference to this machine. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines/{machineName}. + :vartype id: str + :ivar name: Name of the machine. It is a GUID which is unique identifier of machine in private + data center. For user-readable name, we have a displayName property on this machine. + :vartype name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :ivar type: Type of the object = [Microsoft.Migrate/projects/machines]. + :vartype type: str + :ivar boot_type: Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS'. + :vartype boot_type: str or ~azure_migrate.models.MachineBootType + :ivar datacenter_container: Container defined in the management solution that this machine is + part of in the datacenter. + :vartype datacenter_container: str + :ivar datacenter_management_server: Name of the server hosting the datacenter management + solution. + :vartype datacenter_management_server: str + :ivar datacenter_machine_id: ID of the machine as tracked by the datacenter management + solution. + :vartype datacenter_machine_id: str + :ivar datacenter_management_server_id: ID of the server hosting the datacenter management + solution. + :vartype datacenter_management_server_id: str + :ivar description: Description of the machine. + :vartype description: str + :ivar display_name: User readable name of the machine as defined by the user in their private + datacenter. + :vartype display_name: str + :ivar megabytes_of_memory: Memory in Megabytes. + :vartype megabytes_of_memory: float + :ivar number_of_cores: Processor count. + :vartype number_of_cores: int + :ivar operating_system: Operating System of the machine. + :vartype operating_system: str + :ivar groups: List of references to the groups that the machine is member of. + :vartype groups: list[str] + :ivar created_timestamp: Time when this machine was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this machine was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar discovered_timestamp: Time when this machine was discovered by Azure Migrate agent. Date- + Time represented in ISO-8601 format. + :vartype discovered_timestamp: ~datetime.datetime + :ivar disks: Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk + object. + :vartype disks: dict[str, ~azure_migrate.models.Disk] + :ivar network_adapters: Dictionary of network adapters attached to the machine. Key is ID of + network adapter. Value is a network adapter object. + :vartype network_adapters: dict[str, ~azure_migrate.models.NetworkAdapter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'boot_type': {'readonly': True}, + 'datacenter_container': {'readonly': True}, + 'datacenter_management_server': {'readonly': True}, + 'datacenter_machine_id': {'readonly': True}, + 'datacenter_management_server_id': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'megabytes_of_memory': {'readonly': True}, + 'number_of_cores': {'readonly': True}, + 'operating_system': {'readonly': True}, + 'groups': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'discovered_timestamp': {'readonly': True}, + 'disks': {'readonly': True}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'boot_type': {'key': 'properties.bootType', 'type': 'str'}, + 'datacenter_container': {'key': 'properties.datacenterContainer', 'type': 'str'}, + 'datacenter_management_server': {'key': 'properties.datacenterManagementServer', 'type': 'str'}, + 'datacenter_machine_id': {'key': 'properties.datacenterMachineId', 'type': 'str'}, + 'datacenter_management_server_id': {'key': 'properties.datacenterManagementServerId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'megabytes_of_memory': {'key': 'properties.megabytesOfMemory', 'type': 'float'}, + 'number_of_cores': {'key': 'properties.numberOfCores', 'type': 'int'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'groups': {'key': 'properties.groups', 'type': '[str]'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + 'discovered_timestamp': {'key': 'properties.discoveredTimestamp', 'type': 'iso-8601'}, + 'disks': {'key': 'properties.disks', 'type': '{Disk}'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '{NetworkAdapter}'}, + } + + def __init__( + self, + **kwargs + ): + super(Machine, self).__init__(**kwargs) + self.id = None + self.name = None + self.e_tag = kwargs.get('e_tag', None) + self.type = None + self.boot_type = None + self.datacenter_container = None + self.datacenter_management_server = None + self.datacenter_machine_id = None + self.datacenter_management_server_id = None + self.description = None + self.display_name = None + self.megabytes_of_memory = None + self.number_of_cores = None + self.operating_system = None + self.groups = None + self.created_timestamp = None + self.updated_timestamp = None + self.discovered_timestamp = None + self.disks = None + self.network_adapters = None + + +class MachineProperties(msrest.serialization.Model): + """Properties of a machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar boot_type: Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS'. + :vartype boot_type: str or ~azure_migrate.models.MachineBootType + :ivar datacenter_container: Container defined in the management solution that this machine is + part of in the datacenter. + :vartype datacenter_container: str + :ivar datacenter_management_server: Name of the server hosting the datacenter management + solution. + :vartype datacenter_management_server: str + :ivar datacenter_machine_id: ID of the machine as tracked by the datacenter management + solution. + :vartype datacenter_machine_id: str + :ivar datacenter_management_server_id: ID of the server hosting the datacenter management + solution. + :vartype datacenter_management_server_id: str + :ivar description: Description of the machine. + :vartype description: str + :ivar display_name: User readable name of the machine as defined by the user in their private + datacenter. + :vartype display_name: str + :ivar megabytes_of_memory: Memory in Megabytes. + :vartype megabytes_of_memory: float + :ivar number_of_cores: Processor count. + :vartype number_of_cores: int + :ivar operating_system: Operating System of the machine. + :vartype operating_system: str + :ivar groups: List of references to the groups that the machine is member of. + :vartype groups: list[str] + :ivar created_timestamp: Time when this machine was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this machine was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar discovered_timestamp: Time when this machine was discovered by Azure Migrate agent. Date- + Time represented in ISO-8601 format. + :vartype discovered_timestamp: ~datetime.datetime + :ivar disks: Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk + object. + :vartype disks: dict[str, ~azure_migrate.models.Disk] + :ivar network_adapters: Dictionary of network adapters attached to the machine. Key is ID of + network adapter. Value is a network adapter object. + :vartype network_adapters: dict[str, ~azure_migrate.models.NetworkAdapter] + """ + + _validation = { + 'boot_type': {'readonly': True}, + 'datacenter_container': {'readonly': True}, + 'datacenter_management_server': {'readonly': True}, + 'datacenter_machine_id': {'readonly': True}, + 'datacenter_management_server_id': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'megabytes_of_memory': {'readonly': True}, + 'number_of_cores': {'readonly': True}, + 'operating_system': {'readonly': True}, + 'groups': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'discovered_timestamp': {'readonly': True}, + 'disks': {'readonly': True}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'boot_type': {'key': 'bootType', 'type': 'str'}, + 'datacenter_container': {'key': 'datacenterContainer', 'type': 'str'}, + 'datacenter_management_server': {'key': 'datacenterManagementServer', 'type': 'str'}, + 'datacenter_machine_id': {'key': 'datacenterMachineId', 'type': 'str'}, + 'datacenter_management_server_id': {'key': 'datacenterManagementServerId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'megabytes_of_memory': {'key': 'megabytesOfMemory', 'type': 'float'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'operating_system': {'key': 'operatingSystem', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[str]'}, + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + 'discovered_timestamp': {'key': 'discoveredTimestamp', 'type': 'iso-8601'}, + 'disks': {'key': 'disks', 'type': '{Disk}'}, + 'network_adapters': {'key': 'networkAdapters', 'type': '{NetworkAdapter}'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineProperties, self).__init__(**kwargs) + self.boot_type = None + self.datacenter_container = None + self.datacenter_management_server = None + self.datacenter_machine_id = None + self.datacenter_management_server_id = None + self.description = None + self.display_name = None + self.megabytes_of_memory = None + self.number_of_cores = None + self.operating_system = None + self.groups = None + self.created_timestamp = None + self.updated_timestamp = None + self.discovered_timestamp = None + self.disks = None + self.network_adapters = None + + +class MachineResultList(msrest.serialization.Model): + """List of machines. + + :param value: List of machines. + :type value: list[~azure_migrate.models.Machine] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Machine]'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineResultList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class NetworkAdapter(msrest.serialization.Model): + """A network adapter discovered on a machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar mac_address: MAC Address of the network adapter. + :vartype mac_address: str + :ivar ip_addresses: List of IP Addresses on the network adapter. + :vartype ip_addresses: list[str] + """ + + _validation = { + 'mac_address': {'readonly': True}, + 'ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAdapter, self).__init__(**kwargs) + self.mac_address = None + self.ip_addresses = None + + +class Operation(msrest.serialization.Model): + """A REST API operation supported by the provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the operation. + :vartype name: str + :param display: Displayable properties of the operation. + :type display: ~azure_migrate.models.OperationDisplay + :ivar origin: Origin of the operation. + :vartype origin: str + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + self.origin = None + + +class OperationDisplay(msrest.serialization.Model): + """Displayable properties of the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Provider of the operation. + :vartype provider: str + :ivar resource: Resource operated on by the operation. + :vartype resource: str + :ivar operation: Operation Type. + :vartype operation: str + :ivar description: Description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationResultList(msrest.serialization.Model): + """List of API operations. + + :param value: List of operations. + :type value: list[~azure_migrate.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResultList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Project(msrest.serialization.Model): + """Azure Migrate Project. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Path reference to this project + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}. + :vartype id: str + :ivar name: Name of the project. + :vartype name: str + :ivar type: Type of the object = [Microsoft.Migrate/projects]. + :vartype type: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :param location: Azure location in which project is created. + :type location: str + :param tags: A set of tags. Tags provided by Azure Tagging service. + :type tags: ~azure_migrate.models.ProjectTags + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar discovery_status: Reports whether project is under discovery. Possible values include: + 'Unknown', 'NotStarted', 'InProgress', 'Completed'. + :vartype discovery_status: str or ~azure_migrate.models.DiscoveryStatus + :param customer_workspace_id: ARM ID of the Service Map workspace created by user. + :type customer_workspace_id: str + :param customer_workspace_location: Location of the Service Map workspace created by user. + :type customer_workspace_location: str + :ivar last_discovery_timestamp: Time when this project was created. Date-Time represented in + ISO-8601 format. This value will be null until discovery is complete. + :vartype last_discovery_timestamp: ~datetime.datetime + :ivar last_discovery_session_id: Session id of the last discovery. + :vartype last_discovery_session_id: str + :ivar number_of_groups: Number of groups created in the project. + :vartype number_of_groups: int + :ivar number_of_machines: Number of machines in the project. + :vartype number_of_machines: int + :ivar number_of_assessments: Number of assessments created in the project. + :vartype number_of_assessments: int + :ivar last_assessment_timestamp: Time when last assessment was created. Date-Time represented + in ISO-8601 format. This value will be null until assessment is created. + :vartype last_assessment_timestamp: ~datetime.datetime + :param provisioning_state: Provisioning state of the project. Possible values include: + 'Accepted', 'Creating', 'Deleting', 'Failed', 'Moving', 'Succeeded'. + :type provisioning_state: str or ~azure_migrate.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'discovery_status': {'readonly': True}, + 'last_discovery_timestamp': {'readonly': True}, + 'last_discovery_session_id': {'readonly': True}, + 'number_of_groups': {'readonly': True}, + 'number_of_machines': {'readonly': True}, + 'number_of_assessments': {'readonly': True}, + 'last_assessment_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'ProjectTags'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + 'discovery_status': {'key': 'properties.discoveryStatus', 'type': 'str'}, + 'customer_workspace_id': {'key': 'properties.customerWorkspaceId', 'type': 'str'}, + 'customer_workspace_location': {'key': 'properties.customerWorkspaceLocation', 'type': 'str'}, + 'last_discovery_timestamp': {'key': 'properties.lastDiscoveryTimestamp', 'type': 'iso-8601'}, + 'last_discovery_session_id': {'key': 'properties.lastDiscoverySessionId', 'type': 'str'}, + 'number_of_groups': {'key': 'properties.numberOfGroups', 'type': 'int'}, + 'number_of_machines': {'key': 'properties.numberOfMachines', 'type': 'int'}, + 'number_of_assessments': {'key': 'properties.numberOfAssessments', 'type': 'int'}, + 'last_assessment_timestamp': {'key': 'properties.lastAssessmentTimestamp', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Project, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.e_tag = kwargs.get('e_tag', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.created_timestamp = None + self.updated_timestamp = None + self.discovery_status = None + self.customer_workspace_id = kwargs.get('customer_workspace_id', None) + self.customer_workspace_location = kwargs.get('customer_workspace_location', None) + self.last_discovery_timestamp = None + self.last_discovery_session_id = None + self.number_of_groups = None + self.number_of_machines = None + self.number_of_assessments = None + self.last_assessment_timestamp = None + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class ProjectKey(msrest.serialization.Model): + """ID and Key for Migration Project. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar workspace_id: ID of Migration Project. + :vartype workspace_id: str + :ivar workspace_key: Key of Migration Project. + :vartype workspace_key: str + """ + + _validation = { + 'workspace_id': {'readonly': True}, + 'workspace_key': {'readonly': True}, + } + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'workspace_key': {'key': 'workspaceKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProjectKey, self).__init__(**kwargs) + self.workspace_id = None + self.workspace_key = None + + +class ProjectProperties(msrest.serialization.Model): + """Properties of a project. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar discovery_status: Reports whether project is under discovery. Possible values include: + 'Unknown', 'NotStarted', 'InProgress', 'Completed'. + :vartype discovery_status: str or ~azure_migrate.models.DiscoveryStatus + :param customer_workspace_id: ARM ID of the Service Map workspace created by user. + :type customer_workspace_id: str + :param customer_workspace_location: Location of the Service Map workspace created by user. + :type customer_workspace_location: str + :ivar last_discovery_timestamp: Time when this project was created. Date-Time represented in + ISO-8601 format. This value will be null until discovery is complete. + :vartype last_discovery_timestamp: ~datetime.datetime + :ivar last_discovery_session_id: Session id of the last discovery. + :vartype last_discovery_session_id: str + :ivar number_of_groups: Number of groups created in the project. + :vartype number_of_groups: int + :ivar number_of_machines: Number of machines in the project. + :vartype number_of_machines: int + :ivar number_of_assessments: Number of assessments created in the project. + :vartype number_of_assessments: int + :ivar last_assessment_timestamp: Time when last assessment was created. Date-Time represented + in ISO-8601 format. This value will be null until assessment is created. + :vartype last_assessment_timestamp: ~datetime.datetime + :param provisioning_state: Provisioning state of the project. Possible values include: + 'Accepted', 'Creating', 'Deleting', 'Failed', 'Moving', 'Succeeded'. + :type provisioning_state: str or ~azure_migrate.models.ProvisioningState + """ + + _validation = { + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'discovery_status': {'readonly': True}, + 'last_discovery_timestamp': {'readonly': True}, + 'last_discovery_session_id': {'readonly': True}, + 'number_of_groups': {'readonly': True}, + 'number_of_machines': {'readonly': True}, + 'number_of_assessments': {'readonly': True}, + 'last_assessment_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'customer_workspace_id': {'key': 'customerWorkspaceId', 'type': 'str'}, + 'customer_workspace_location': {'key': 'customerWorkspaceLocation', 'type': 'str'}, + 'last_discovery_timestamp': {'key': 'lastDiscoveryTimestamp', 'type': 'iso-8601'}, + 'last_discovery_session_id': {'key': 'lastDiscoverySessionId', 'type': 'str'}, + 'number_of_groups': {'key': 'numberOfGroups', 'type': 'int'}, + 'number_of_machines': {'key': 'numberOfMachines', 'type': 'int'}, + 'number_of_assessments': {'key': 'numberOfAssessments', 'type': 'int'}, + 'last_assessment_timestamp': {'key': 'lastAssessmentTimestamp', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProjectProperties, self).__init__(**kwargs) + self.created_timestamp = None + self.updated_timestamp = None + self.discovery_status = None + self.customer_workspace_id = kwargs.get('customer_workspace_id', None) + self.customer_workspace_location = kwargs.get('customer_workspace_location', None) + self.last_discovery_timestamp = None + self.last_discovery_session_id = None + self.number_of_groups = None + self.number_of_machines = None + self.number_of_assessments = None + self.last_assessment_timestamp = None + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class ProjectResultList(msrest.serialization.Model): + """List of projects. + + :param value: List of projects. + :type value: list[~azure_migrate.models.Project] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Project]'}, + } + + def __init__( + self, + **kwargs + ): + super(ProjectResultList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ProjectTags(msrest.serialization.Model): + """Tags provided by Azure Tagging service. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(ProjectTags, self).__init__(**kwargs) + + +class VmFamily(msrest.serialization.Model): + """VM family name, the list of targeted azure locations and the category of the family. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar family_name: Name of the VM family. + :vartype family_name: str + :ivar target_locations: List of Azure regions. + :vartype target_locations: list[str] + :ivar category: Category of the VM family. + :vartype category: list[str] + """ + + _validation = { + 'family_name': {'readonly': True}, + 'target_locations': {'readonly': True}, + 'category': {'readonly': True}, + } + + _attribute_map = { + 'family_name': {'key': 'familyName', 'type': 'str'}, + 'target_locations': {'key': 'targetLocations', 'type': '[str]'}, + 'category': {'key': 'category', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VmFamily, self).__init__(**kwargs) + self.family_name = None + self.target_locations = None + self.category = None diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/models/_models_py3.py b/src/migrate/azext_migrate/vendored_sdks/migrate/models/_models_py3.py new file mode 100644 index 00000000000..675b53acd66 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/models/_models_py3.py @@ -0,0 +1,2220 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AssessedDisk(msrest.serialization.Model): + """A disk assessed for an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the assessed disk. + :vartype name: str + :ivar gigabytes_provisioned: Gigabytes of storage provisioned for this disk. + :vartype gigabytes_provisioned: float + :ivar gigabytes_consumed: Gigabytes of storage consumed by this disk. + :vartype gigabytes_consumed: float + :ivar megabytes_per_second_of_read: Disk throughput in MegaBytes per second. + :vartype megabytes_per_second_of_read: float + :ivar megabytes_per_second_of_read_data_points_expected: Expected data points for MegaBytes per + second of read. + :vartype megabytes_per_second_of_read_data_points_expected: int + :ivar megabytes_per_second_of_read_data_points_received: Received data points for MegaBytes per + second of read. + :vartype megabytes_per_second_of_read_data_points_received: int + :ivar megabytes_per_second_of_write: Disk throughput in MegaBytes per second. + :vartype megabytes_per_second_of_write: float + :ivar megabytes_per_second_of_write_data_points_expected: Expected data points for MegaBytes + per second of write. + :vartype megabytes_per_second_of_write_data_points_expected: int + :ivar megabytes_per_second_of_write_data_points_received: Received data points for MegaBytes + per second of write. + :vartype megabytes_per_second_of_write_data_points_received: int + :ivar number_of_read_operations_per_second: Number of read operations per second for the disk. + :vartype number_of_read_operations_per_second: float + :ivar number_of_read_operations_per_second_data_points_expected: Expected number of data points + for read operations per second. + :vartype number_of_read_operations_per_second_data_points_expected: int + :ivar number_of_read_operations_per_second_data_points_received: Received number of data points + for read operations per second. + :vartype number_of_read_operations_per_second_data_points_received: int + :ivar number_of_write_operations_per_second: Number of read and write operations per second for + the disk. + :vartype number_of_write_operations_per_second: float + :ivar number_of_write_operations_per_second_data_points_expected: Expected number of data + points for write operations per second. + :vartype number_of_write_operations_per_second_data_points_expected: int + :ivar number_of_write_operations_per_second_data_points_received: Received number of data + points for write operations per second. + :vartype number_of_write_operations_per_second_data_points_received: int + :ivar monthly_storage_cost: Estimated aggregate storage cost for a 31-day month for this disk. + :vartype monthly_storage_cost: float + :ivar recommended_disk_type: Storage type selected for this disk. Possible values include: + 'Unknown', 'Standard', 'Premium'. + :vartype recommended_disk_type: str or ~azure_migrate.models.AzureDiskType + :ivar recommended_disk_size: Recommended Azure size for the disk, given utilization data and + preferences set on Assessment. Possible values include: 'Unknown', 'Standard_S4', + 'Standard_S6', 'Standard_S10', 'Standard_S20', 'Standard_S30', 'Standard_S40', 'Standard_S50', + 'Premium_P4', 'Premium_P6', 'Premium_P10', 'Premium_P20', 'Premium_P30', 'Premium_P40', + 'Premium_P50'. + :vartype recommended_disk_size: str or ~azure_migrate.models.AzureDiskSize + :ivar gigabytes_for_recommended_disk_size: Gigabytes of storage provided by the recommended + Azure disk size. + :vartype gigabytes_for_recommended_disk_size: int + :ivar suitability: Whether this disk is suitable for Azure. Possible values include: 'Unknown', + 'NotSuitable', 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown'. + :vartype suitability: str or ~azure_migrate.models.CloudSuitability + :ivar suitability_explanation: If disk is suitable, this explains the reasons and mitigation + steps. Possible values include: 'Unknown', 'NotApplicable', 'DiskSizeGreaterThanSupported', + 'NoSuitableDiskSizeForIops', 'NoSuitableDiskSizeForThroughput', + 'NoDiskSizeFoundInSelectedLocation', 'NoDiskSizeFoundForSelectedRedundancy', + 'InternalErrorOccurredForDiskEvaluation'. + :vartype suitability_explanation: str or ~azure_migrate.models.AzureDiskSuitabilityExplanation + """ + + _validation = { + 'name': {'readonly': True}, + 'gigabytes_provisioned': {'readonly': True}, + 'gigabytes_consumed': {'readonly': True}, + 'megabytes_per_second_of_read': {'readonly': True}, + 'megabytes_per_second_of_read_data_points_expected': {'readonly': True}, + 'megabytes_per_second_of_read_data_points_received': {'readonly': True}, + 'megabytes_per_second_of_write': {'readonly': True}, + 'megabytes_per_second_of_write_data_points_expected': {'readonly': True}, + 'megabytes_per_second_of_write_data_points_received': {'readonly': True}, + 'number_of_read_operations_per_second': {'readonly': True}, + 'number_of_read_operations_per_second_data_points_expected': {'readonly': True}, + 'number_of_read_operations_per_second_data_points_received': {'readonly': True}, + 'number_of_write_operations_per_second': {'readonly': True}, + 'number_of_write_operations_per_second_data_points_expected': {'readonly': True}, + 'number_of_write_operations_per_second_data_points_received': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'recommended_disk_type': {'readonly': True}, + 'recommended_disk_size': {'readonly': True}, + 'gigabytes_for_recommended_disk_size': {'readonly': True}, + 'suitability': {'readonly': True}, + 'suitability_explanation': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'gigabytes_provisioned': {'key': 'gigabytesProvisioned', 'type': 'float'}, + 'gigabytes_consumed': {'key': 'gigabytesConsumed', 'type': 'float'}, + 'megabytes_per_second_of_read': {'key': 'megabytesPerSecondOfRead', 'type': 'float'}, + 'megabytes_per_second_of_read_data_points_expected': {'key': 'megabytesPerSecondOfReadDataPointsExpected', 'type': 'int'}, + 'megabytes_per_second_of_read_data_points_received': {'key': 'megabytesPerSecondOfReadDataPointsReceived', 'type': 'int'}, + 'megabytes_per_second_of_write': {'key': 'megabytesPerSecondOfWrite', 'type': 'float'}, + 'megabytes_per_second_of_write_data_points_expected': {'key': 'megabytesPerSecondOfWriteDataPointsExpected', 'type': 'int'}, + 'megabytes_per_second_of_write_data_points_received': {'key': 'megabytesPerSecondOfWriteDataPointsReceived', 'type': 'int'}, + 'number_of_read_operations_per_second': {'key': 'numberOfReadOperationsPerSecond', 'type': 'float'}, + 'number_of_read_operations_per_second_data_points_expected': {'key': 'numberOfReadOperationsPerSecondDataPointsExpected', 'type': 'int'}, + 'number_of_read_operations_per_second_data_points_received': {'key': 'numberOfReadOperationsPerSecondDataPointsReceived', 'type': 'int'}, + 'number_of_write_operations_per_second': {'key': 'numberOfWriteOperationsPerSecond', 'type': 'float'}, + 'number_of_write_operations_per_second_data_points_expected': {'key': 'numberOfWriteOperationsPerSecondDataPointsExpected', 'type': 'int'}, + 'number_of_write_operations_per_second_data_points_received': {'key': 'numberOfWriteOperationsPerSecondDataPointsReceived', 'type': 'int'}, + 'monthly_storage_cost': {'key': 'monthlyStorageCost', 'type': 'float'}, + 'recommended_disk_type': {'key': 'recommendedDiskType', 'type': 'str'}, + 'recommended_disk_size': {'key': 'recommendedDiskSize', 'type': 'str'}, + 'gigabytes_for_recommended_disk_size': {'key': 'gigabytesForRecommendedDiskSize', 'type': 'int'}, + 'suitability': {'key': 'suitability', 'type': 'str'}, + 'suitability_explanation': {'key': 'suitabilityExplanation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessedDisk, self).__init__(**kwargs) + self.name = None + self.gigabytes_provisioned = None + self.gigabytes_consumed = None + self.megabytes_per_second_of_read = None + self.megabytes_per_second_of_read_data_points_expected = None + self.megabytes_per_second_of_read_data_points_received = None + self.megabytes_per_second_of_write = None + self.megabytes_per_second_of_write_data_points_expected = None + self.megabytes_per_second_of_write_data_points_received = None + self.number_of_read_operations_per_second = None + self.number_of_read_operations_per_second_data_points_expected = None + self.number_of_read_operations_per_second_data_points_received = None + self.number_of_write_operations_per_second = None + self.number_of_write_operations_per_second_data_points_expected = None + self.number_of_write_operations_per_second_data_points_received = None + self.monthly_storage_cost = None + self.recommended_disk_type = None + self.recommended_disk_size = None + self.gigabytes_for_recommended_disk_size = None + self.suitability = None + self.suitability_explanation = None + + +class AssessedMachine(msrest.serialization.Model): + """A machine evaluated as part of an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Path reference to this assessed machine. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}. + :vartype id: str + :ivar name: Name of the machine. + :vartype name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :ivar type: Type of the object = + [Microsoft.Migrate/projects/groups/assessments/assessedMachines]. + :vartype type: str + :ivar groups: List of references to the groups that the machine is member of. + :vartype groups: list[str] + :ivar discovered_timestamp: Time when this machine was discovered by Azure Migrate agent. Date- + Time represented in ISO-8601 format. + :vartype discovered_timestamp: ~datetime.datetime + :ivar boot_type: Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS'. + :vartype boot_type: str or ~azure_migrate.models.MachineBootType + :ivar datacenter_container: Container defined in the management solution that this machine is + part of in the datacenter. + :vartype datacenter_container: str + :ivar datacenter_management_server: Name of the server hosting the datacenter management + solution. + :vartype datacenter_management_server: str + :ivar datacenter_machine_id: ID of the machine as tracked by the datacenter management + solution. + :vartype datacenter_machine_id: str + :ivar datacenter_management_server_id: ID of the server hosting the datacenter management + solution. + :vartype datacenter_management_server_id: str + :ivar description: Description of the machine. + :vartype description: str + :ivar display_name: User readable name of the machine as defined by the user in their private + datacenter. + :vartype display_name: str + :ivar megabytes_of_memory: Memory in Megabytes. + :vartype megabytes_of_memory: float + :ivar number_of_cores: Processor count. + :vartype number_of_cores: int + :ivar operating_system: Operating System of the machine. + :vartype operating_system: str + :ivar monthly_bandwidth_cost: Monthly network cost estimate for the network adapters that are + attached to this machine as a group, for a 31-day month. + :vartype monthly_bandwidth_cost: float + :ivar monthly_storage_cost: Monthly storage cost estimate for the disks that are attached to + this machine as a group, for a 31-day month. + :vartype monthly_storage_cost: float + :ivar disks: Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk + object. + :vartype disks: dict[str, ~azure_migrate.models.AssessedDisk] + :ivar network_adapters: Dictionary of network adapters attached to the machine. Key is name of + the adapter. Value is a network adapter object. + :vartype network_adapters: dict[str, ~azure_migrate.models.AssessedNetworkAdapter] + :ivar recommended_size: Recommended Azure size for this machine. Possible values include: + 'Unknown', 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', + 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', + 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', + 'Standard_A8m_v2', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', + 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', + 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', + 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', + 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_F1', 'Standard_F2', 'Standard_F4', + 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', + 'Standard_F16s', 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_H8', + 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', + 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s'. + :vartype recommended_size: str or ~azure_migrate.models.AzureVmSize + :ivar number_of_cores_for_recommended_size: Number of CPU cores in the Recommended Azure VM + Size. + :vartype number_of_cores_for_recommended_size: int + :ivar megabytes_of_memory_for_recommended_size: Megabytes of memory in the Recommended Azure VM + Size. + :vartype megabytes_of_memory_for_recommended_size: float + :ivar monthly_compute_cost_for_recommended_size: Compute Cost for a 31-day month, if the + machine is migrated to Azure with the Recommended Size. + :vartype monthly_compute_cost_for_recommended_size: float + :ivar percentage_cores_utilization: Utilization percentage of the processor core as observed in + the private data center, in the Time Range selected on Assessment, reported as the Percentile + value based on the percentile number selected in assessment. + :vartype percentage_cores_utilization: float + :ivar percentage_memory_utilization: Utilization percentage of the memory as observed in the + private data center, in the Time Range selected on Assessment, reported as the Percentile value + based on the percentile number selected in assessment. + :vartype percentage_memory_utilization: float + :ivar percentage_cores_utilization_data_points_expected: Expected data points for percentage of + cores utilization. + :vartype percentage_cores_utilization_data_points_expected: int + :ivar percentage_cores_utilization_data_points_received: Received data points for percentage of + cores utilization. + :vartype percentage_cores_utilization_data_points_received: int + :ivar percentage_memory_utilization_data_points_expected: Expected data points for percentage + of memory utilization. + :vartype percentage_memory_utilization_data_points_expected: int + :ivar percentage_memory_utilization_data_points_received: Received data points for percentage + of memory utilization. + :vartype percentage_memory_utilization_data_points_received: int + :ivar suitability: Whether this disk is suitable for Azure. Possible values include: 'Unknown', + 'NotSuitable', 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown'. + :vartype suitability: str or ~azure_migrate.models.CloudSuitability + :ivar suitability_explanation: If machine is not ready to be migrated, this explains the + reasons and mitigation steps. Possible values include: 'Unknown', 'NotApplicable', + 'GuestOperatingSystemArchitectureNotSupported', 'GuestOperatingSystemNotSupported', + 'BootTypeNotSupported', 'MoreDisksThanSupported', 'NoSuitableVmSizeFound', + 'OneOrMoreDisksNotSuitable', 'OneOrMoreAdaptersNotSuitable', + 'InternalErrorOccuredDuringComputeEvaluation', 'InternalErrorOccuredDuringStorageEvaluation', + 'InternalErrorOccuredDuringNetworkEvaluation', 'NoVmSizeSupportsStoragePerformance', + 'NoVmSizeSupportsNetworkPerformance', 'NoVmSizeForSelectedPricingTier', + 'NoVmSizeForSelectedAzureLocation', 'CheckRedHatLinuxVersion', 'CheckOpenSuseLinuxVersion', + 'CheckWindowsServer2008R2Version', 'CheckCentOsVersion', 'CheckDebianLinuxVersion', + 'CheckSuseLinuxVersion', 'CheckOracleLinuxVersion', 'CheckUbuntuLinuxVersion', + 'CheckCoreOsLinuxVersion', 'WindowsServerVersionConditionallySupported', + 'NoGuestOperatingSystemConditionallySupported', 'WindowsClientVersionsConditionallySupported', + 'BootTypeUnknown', 'GuestOperatingSystemUnknown', 'WindowsServerVersionsSupportedWithCaveat', + 'WindowsOSNoLongerUnderMSSupport', 'EndorsedWithConditionsLinuxDistributions', + 'UnendorsedLinuxDistributions', 'NoVmSizeForStandardPricingTier', + 'NoVmSizeForBasicPricingTier'. + :vartype suitability_explanation: str or ~azure_migrate.models.AzureVmSuitabilityExplanation + :ivar created_timestamp: Time when this machine was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this machine was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'groups': {'readonly': True}, + 'discovered_timestamp': {'readonly': True}, + 'boot_type': {'readonly': True}, + 'datacenter_container': {'readonly': True}, + 'datacenter_management_server': {'readonly': True}, + 'datacenter_machine_id': {'readonly': True}, + 'datacenter_management_server_id': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'megabytes_of_memory': {'readonly': True}, + 'number_of_cores': {'readonly': True}, + 'operating_system': {'readonly': True}, + 'monthly_bandwidth_cost': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'disks': {'readonly': True}, + 'network_adapters': {'readonly': True}, + 'recommended_size': {'readonly': True}, + 'number_of_cores_for_recommended_size': {'readonly': True}, + 'megabytes_of_memory_for_recommended_size': {'readonly': True}, + 'monthly_compute_cost_for_recommended_size': {'readonly': True}, + 'percentage_cores_utilization': {'readonly': True}, + 'percentage_memory_utilization': {'readonly': True}, + 'percentage_cores_utilization_data_points_expected': {'readonly': True}, + 'percentage_cores_utilization_data_points_received': {'readonly': True}, + 'percentage_memory_utilization_data_points_expected': {'readonly': True}, + 'percentage_memory_utilization_data_points_received': {'readonly': True}, + 'suitability': {'readonly': True}, + 'suitability_explanation': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'groups': {'key': 'properties.groups', 'type': '[str]'}, + 'discovered_timestamp': {'key': 'properties.discoveredTimestamp', 'type': 'iso-8601'}, + 'boot_type': {'key': 'properties.bootType', 'type': 'str'}, + 'datacenter_container': {'key': 'properties.datacenterContainer', 'type': 'str'}, + 'datacenter_management_server': {'key': 'properties.datacenterManagementServer', 'type': 'str'}, + 'datacenter_machine_id': {'key': 'properties.datacenterMachineId', 'type': 'str'}, + 'datacenter_management_server_id': {'key': 'properties.datacenterManagementServerId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'megabytes_of_memory': {'key': 'properties.megabytesOfMemory', 'type': 'float'}, + 'number_of_cores': {'key': 'properties.numberOfCores', 'type': 'int'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'monthly_bandwidth_cost': {'key': 'properties.monthlyBandwidthCost', 'type': 'float'}, + 'monthly_storage_cost': {'key': 'properties.monthlyStorageCost', 'type': 'float'}, + 'disks': {'key': 'properties.disks', 'type': '{AssessedDisk}'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '{AssessedNetworkAdapter}'}, + 'recommended_size': {'key': 'properties.recommendedSize', 'type': 'str'}, + 'number_of_cores_for_recommended_size': {'key': 'properties.numberOfCoresForRecommendedSize', 'type': 'int'}, + 'megabytes_of_memory_for_recommended_size': {'key': 'properties.megabytesOfMemoryForRecommendedSize', 'type': 'float'}, + 'monthly_compute_cost_for_recommended_size': {'key': 'properties.monthlyComputeCostForRecommendedSize', 'type': 'float'}, + 'percentage_cores_utilization': {'key': 'properties.percentageCoresUtilization', 'type': 'float'}, + 'percentage_memory_utilization': {'key': 'properties.percentageMemoryUtilization', 'type': 'float'}, + 'percentage_cores_utilization_data_points_expected': {'key': 'properties.percentageCoresUtilizationDataPointsExpected', 'type': 'int'}, + 'percentage_cores_utilization_data_points_received': {'key': 'properties.percentageCoresUtilizationDataPointsReceived', 'type': 'int'}, + 'percentage_memory_utilization_data_points_expected': {'key': 'properties.percentageMemoryUtilizationDataPointsExpected', 'type': 'int'}, + 'percentage_memory_utilization_data_points_received': {'key': 'properties.percentageMemoryUtilizationDataPointsReceived', 'type': 'int'}, + 'suitability': {'key': 'properties.suitability', 'type': 'str'}, + 'suitability_explanation': {'key': 'properties.suitabilityExplanation', 'type': 'str'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + e_tag: Optional[str] = None, + **kwargs + ): + super(AssessedMachine, self).__init__(**kwargs) + self.id = None + self.name = None + self.e_tag = e_tag + self.type = None + self.groups = None + self.discovered_timestamp = None + self.boot_type = None + self.datacenter_container = None + self.datacenter_management_server = None + self.datacenter_machine_id = None + self.datacenter_management_server_id = None + self.description = None + self.display_name = None + self.megabytes_of_memory = None + self.number_of_cores = None + self.operating_system = None + self.monthly_bandwidth_cost = None + self.monthly_storage_cost = None + self.disks = None + self.network_adapters = None + self.recommended_size = None + self.number_of_cores_for_recommended_size = None + self.megabytes_of_memory_for_recommended_size = None + self.monthly_compute_cost_for_recommended_size = None + self.percentage_cores_utilization = None + self.percentage_memory_utilization = None + self.percentage_cores_utilization_data_points_expected = None + self.percentage_cores_utilization_data_points_received = None + self.percentage_memory_utilization_data_points_expected = None + self.percentage_memory_utilization_data_points_received = None + self.suitability = None + self.suitability_explanation = None + self.created_timestamp = None + self.updated_timestamp = None + + +class AssessedMachineProperties(msrest.serialization.Model): + """Properties of an assessed machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar groups: List of references to the groups that the machine is member of. + :vartype groups: list[str] + :ivar discovered_timestamp: Time when this machine was discovered by Azure Migrate agent. Date- + Time represented in ISO-8601 format. + :vartype discovered_timestamp: ~datetime.datetime + :ivar boot_type: Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS'. + :vartype boot_type: str or ~azure_migrate.models.MachineBootType + :ivar datacenter_container: Container defined in the management solution that this machine is + part of in the datacenter. + :vartype datacenter_container: str + :ivar datacenter_management_server: Name of the server hosting the datacenter management + solution. + :vartype datacenter_management_server: str + :ivar datacenter_machine_id: ID of the machine as tracked by the datacenter management + solution. + :vartype datacenter_machine_id: str + :ivar datacenter_management_server_id: ID of the server hosting the datacenter management + solution. + :vartype datacenter_management_server_id: str + :ivar description: Description of the machine. + :vartype description: str + :ivar display_name: User readable name of the machine as defined by the user in their private + datacenter. + :vartype display_name: str + :ivar megabytes_of_memory: Memory in Megabytes. + :vartype megabytes_of_memory: float + :ivar number_of_cores: Processor count. + :vartype number_of_cores: int + :ivar operating_system: Operating System of the machine. + :vartype operating_system: str + :ivar monthly_bandwidth_cost: Monthly network cost estimate for the network adapters that are + attached to this machine as a group, for a 31-day month. + :vartype monthly_bandwidth_cost: float + :ivar monthly_storage_cost: Monthly storage cost estimate for the disks that are attached to + this machine as a group, for a 31-day month. + :vartype monthly_storage_cost: float + :ivar disks: Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk + object. + :vartype disks: dict[str, ~azure_migrate.models.AssessedDisk] + :ivar network_adapters: Dictionary of network adapters attached to the machine. Key is name of + the adapter. Value is a network adapter object. + :vartype network_adapters: dict[str, ~azure_migrate.models.AssessedNetworkAdapter] + :ivar recommended_size: Recommended Azure size for this machine. Possible values include: + 'Unknown', 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', + 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', + 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', + 'Standard_A8m_v2', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', + 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', + 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', + 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', + 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_F1', 'Standard_F2', 'Standard_F4', + 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', + 'Standard_F16s', 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_H8', + 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', + 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s'. + :vartype recommended_size: str or ~azure_migrate.models.AzureVmSize + :ivar number_of_cores_for_recommended_size: Number of CPU cores in the Recommended Azure VM + Size. + :vartype number_of_cores_for_recommended_size: int + :ivar megabytes_of_memory_for_recommended_size: Megabytes of memory in the Recommended Azure VM + Size. + :vartype megabytes_of_memory_for_recommended_size: float + :ivar monthly_compute_cost_for_recommended_size: Compute Cost for a 31-day month, if the + machine is migrated to Azure with the Recommended Size. + :vartype monthly_compute_cost_for_recommended_size: float + :ivar percentage_cores_utilization: Utilization percentage of the processor core as observed in + the private data center, in the Time Range selected on Assessment, reported as the Percentile + value based on the percentile number selected in assessment. + :vartype percentage_cores_utilization: float + :ivar percentage_memory_utilization: Utilization percentage of the memory as observed in the + private data center, in the Time Range selected on Assessment, reported as the Percentile value + based on the percentile number selected in assessment. + :vartype percentage_memory_utilization: float + :ivar percentage_cores_utilization_data_points_expected: Expected data points for percentage of + cores utilization. + :vartype percentage_cores_utilization_data_points_expected: int + :ivar percentage_cores_utilization_data_points_received: Received data points for percentage of + cores utilization. + :vartype percentage_cores_utilization_data_points_received: int + :ivar percentage_memory_utilization_data_points_expected: Expected data points for percentage + of memory utilization. + :vartype percentage_memory_utilization_data_points_expected: int + :ivar percentage_memory_utilization_data_points_received: Received data points for percentage + of memory utilization. + :vartype percentage_memory_utilization_data_points_received: int + :ivar suitability: Whether this disk is suitable for Azure. Possible values include: 'Unknown', + 'NotSuitable', 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown'. + :vartype suitability: str or ~azure_migrate.models.CloudSuitability + :ivar suitability_explanation: If machine is not ready to be migrated, this explains the + reasons and mitigation steps. Possible values include: 'Unknown', 'NotApplicable', + 'GuestOperatingSystemArchitectureNotSupported', 'GuestOperatingSystemNotSupported', + 'BootTypeNotSupported', 'MoreDisksThanSupported', 'NoSuitableVmSizeFound', + 'OneOrMoreDisksNotSuitable', 'OneOrMoreAdaptersNotSuitable', + 'InternalErrorOccuredDuringComputeEvaluation', 'InternalErrorOccuredDuringStorageEvaluation', + 'InternalErrorOccuredDuringNetworkEvaluation', 'NoVmSizeSupportsStoragePerformance', + 'NoVmSizeSupportsNetworkPerformance', 'NoVmSizeForSelectedPricingTier', + 'NoVmSizeForSelectedAzureLocation', 'CheckRedHatLinuxVersion', 'CheckOpenSuseLinuxVersion', + 'CheckWindowsServer2008R2Version', 'CheckCentOsVersion', 'CheckDebianLinuxVersion', + 'CheckSuseLinuxVersion', 'CheckOracleLinuxVersion', 'CheckUbuntuLinuxVersion', + 'CheckCoreOsLinuxVersion', 'WindowsServerVersionConditionallySupported', + 'NoGuestOperatingSystemConditionallySupported', 'WindowsClientVersionsConditionallySupported', + 'BootTypeUnknown', 'GuestOperatingSystemUnknown', 'WindowsServerVersionsSupportedWithCaveat', + 'WindowsOSNoLongerUnderMSSupport', 'EndorsedWithConditionsLinuxDistributions', + 'UnendorsedLinuxDistributions', 'NoVmSizeForStandardPricingTier', + 'NoVmSizeForBasicPricingTier'. + :vartype suitability_explanation: str or ~azure_migrate.models.AzureVmSuitabilityExplanation + :ivar created_timestamp: Time when this machine was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this machine was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + """ + + _validation = { + 'groups': {'readonly': True}, + 'discovered_timestamp': {'readonly': True}, + 'boot_type': {'readonly': True}, + 'datacenter_container': {'readonly': True}, + 'datacenter_management_server': {'readonly': True}, + 'datacenter_machine_id': {'readonly': True}, + 'datacenter_management_server_id': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'megabytes_of_memory': {'readonly': True}, + 'number_of_cores': {'readonly': True}, + 'operating_system': {'readonly': True}, + 'monthly_bandwidth_cost': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'disks': {'readonly': True}, + 'network_adapters': {'readonly': True}, + 'recommended_size': {'readonly': True}, + 'number_of_cores_for_recommended_size': {'readonly': True}, + 'megabytes_of_memory_for_recommended_size': {'readonly': True}, + 'monthly_compute_cost_for_recommended_size': {'readonly': True}, + 'percentage_cores_utilization': {'readonly': True}, + 'percentage_memory_utilization': {'readonly': True}, + 'percentage_cores_utilization_data_points_expected': {'readonly': True}, + 'percentage_cores_utilization_data_points_received': {'readonly': True}, + 'percentage_memory_utilization_data_points_expected': {'readonly': True}, + 'percentage_memory_utilization_data_points_received': {'readonly': True}, + 'suitability': {'readonly': True}, + 'suitability_explanation': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'groups': {'key': 'groups', 'type': '[str]'}, + 'discovered_timestamp': {'key': 'discoveredTimestamp', 'type': 'iso-8601'}, + 'boot_type': {'key': 'bootType', 'type': 'str'}, + 'datacenter_container': {'key': 'datacenterContainer', 'type': 'str'}, + 'datacenter_management_server': {'key': 'datacenterManagementServer', 'type': 'str'}, + 'datacenter_machine_id': {'key': 'datacenterMachineId', 'type': 'str'}, + 'datacenter_management_server_id': {'key': 'datacenterManagementServerId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'megabytes_of_memory': {'key': 'megabytesOfMemory', 'type': 'float'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'operating_system': {'key': 'operatingSystem', 'type': 'str'}, + 'monthly_bandwidth_cost': {'key': 'monthlyBandwidthCost', 'type': 'float'}, + 'monthly_storage_cost': {'key': 'monthlyStorageCost', 'type': 'float'}, + 'disks': {'key': 'disks', 'type': '{AssessedDisk}'}, + 'network_adapters': {'key': 'networkAdapters', 'type': '{AssessedNetworkAdapter}'}, + 'recommended_size': {'key': 'recommendedSize', 'type': 'str'}, + 'number_of_cores_for_recommended_size': {'key': 'numberOfCoresForRecommendedSize', 'type': 'int'}, + 'megabytes_of_memory_for_recommended_size': {'key': 'megabytesOfMemoryForRecommendedSize', 'type': 'float'}, + 'monthly_compute_cost_for_recommended_size': {'key': 'monthlyComputeCostForRecommendedSize', 'type': 'float'}, + 'percentage_cores_utilization': {'key': 'percentageCoresUtilization', 'type': 'float'}, + 'percentage_memory_utilization': {'key': 'percentageMemoryUtilization', 'type': 'float'}, + 'percentage_cores_utilization_data_points_expected': {'key': 'percentageCoresUtilizationDataPointsExpected', 'type': 'int'}, + 'percentage_cores_utilization_data_points_received': {'key': 'percentageCoresUtilizationDataPointsReceived', 'type': 'int'}, + 'percentage_memory_utilization_data_points_expected': {'key': 'percentageMemoryUtilizationDataPointsExpected', 'type': 'int'}, + 'percentage_memory_utilization_data_points_received': {'key': 'percentageMemoryUtilizationDataPointsReceived', 'type': 'int'}, + 'suitability': {'key': 'suitability', 'type': 'str'}, + 'suitability_explanation': {'key': 'suitabilityExplanation', 'type': 'str'}, + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessedMachineProperties, self).__init__(**kwargs) + self.groups = None + self.discovered_timestamp = None + self.boot_type = None + self.datacenter_container = None + self.datacenter_management_server = None + self.datacenter_machine_id = None + self.datacenter_management_server_id = None + self.description = None + self.display_name = None + self.megabytes_of_memory = None + self.number_of_cores = None + self.operating_system = None + self.monthly_bandwidth_cost = None + self.monthly_storage_cost = None + self.disks = None + self.network_adapters = None + self.recommended_size = None + self.number_of_cores_for_recommended_size = None + self.megabytes_of_memory_for_recommended_size = None + self.monthly_compute_cost_for_recommended_size = None + self.percentage_cores_utilization = None + self.percentage_memory_utilization = None + self.percentage_cores_utilization_data_points_expected = None + self.percentage_cores_utilization_data_points_received = None + self.percentage_memory_utilization_data_points_expected = None + self.percentage_memory_utilization_data_points_received = None + self.suitability = None + self.suitability_explanation = None + self.created_timestamp = None + self.updated_timestamp = None + + +class AssessedMachineResultList(msrest.serialization.Model): + """List of assessed machines. + + :param value: List of assessed machines. + :type value: list[~azure_migrate.models.AssessedMachine] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AssessedMachine]'}, + } + + def __init__( + self, + *, + value: Optional[List["AssessedMachine"]] = None, + **kwargs + ): + super(AssessedMachineResultList, self).__init__(**kwargs) + self.value = value + + +class AssessedNetworkAdapter(msrest.serialization.Model): + """A network adapter assessed for an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar mac_address: MAC Address of the network adapter. + :vartype mac_address: str + :ivar ip_addresses: List of IP Addresses on the network adapter. + :vartype ip_addresses: list[str] + :ivar monthly_bandwidth_costs: Monthly cost estimate for network bandwidth used by this network + adapter. + :vartype monthly_bandwidth_costs: float + :ivar megabytes_per_second_received: Adapter throughput for incoming traffic in MegaBytes per + second. + :vartype megabytes_per_second_received: float + :ivar megabytes_per_second_received_data_points_expected: Expected data points for incoming + traffic in MegaBytes per second. + :vartype megabytes_per_second_received_data_points_expected: int + :ivar megabytes_per_second_of_read_data_points_received: Received data points for incoming + traffic in MegaBytes per second. + :vartype megabytes_per_second_of_read_data_points_received: int + :ivar megabytes_per_second_transmitted: Adapter throughput for outgoing traffic in MegaBytes + per second. + :vartype megabytes_per_second_transmitted: float + :ivar megabytes_per_second_transmitted_data_points_expected: Expected data points for outgoing + traffic in MegaBytes per second. + :vartype megabytes_per_second_transmitted_data_points_expected: int + :ivar megabytes_per_second_transmitted_data_points_received: Received data points for outgoing + traffic in MegaBytes per second. + :vartype megabytes_per_second_transmitted_data_points_received: int + :param net_gigabytes_transmitted_per_month: Gigabytes transmitted through this adapter each + month. + :type net_gigabytes_transmitted_per_month: float + :ivar suitability: Whether this disk is suitable for Azure. Possible values include: 'Unknown', + 'NotSuitable', 'Suitable', 'ConditionallySuitable', 'ReadinessUnknown'. + :vartype suitability: str or ~azure_migrate.models.CloudSuitability + :ivar suitability_explanation: If network adapter is suitable, this explains the reasons and + mitigation steps. Possible values include: 'Unknown', 'NotApplicable', 'InternalErrorOccured'. + :vartype suitability_explanation: str or + ~azure_migrate.models.AzureNetworkAdapterSuitabilityExplanation + """ + + _validation = { + 'mac_address': {'readonly': True}, + 'ip_addresses': {'readonly': True}, + 'monthly_bandwidth_costs': {'readonly': True}, + 'megabytes_per_second_received': {'readonly': True}, + 'megabytes_per_second_received_data_points_expected': {'readonly': True}, + 'megabytes_per_second_of_read_data_points_received': {'readonly': True}, + 'megabytes_per_second_transmitted': {'readonly': True}, + 'megabytes_per_second_transmitted_data_points_expected': {'readonly': True}, + 'megabytes_per_second_transmitted_data_points_received': {'readonly': True}, + 'suitability': {'readonly': True}, + 'suitability_explanation': {'readonly': True}, + } + + _attribute_map = { + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'monthly_bandwidth_costs': {'key': 'monthlyBandwidthCosts', 'type': 'float'}, + 'megabytes_per_second_received': {'key': 'megabytesPerSecondReceived', 'type': 'float'}, + 'megabytes_per_second_received_data_points_expected': {'key': 'megabytesPerSecondReceivedDataPointsExpected', 'type': 'int'}, + 'megabytes_per_second_of_read_data_points_received': {'key': 'megabytesPerSecondOfReadDataPointsReceived', 'type': 'int'}, + 'megabytes_per_second_transmitted': {'key': 'megabytesPerSecondTransmitted', 'type': 'float'}, + 'megabytes_per_second_transmitted_data_points_expected': {'key': 'megabytesPerSecondTransmittedDataPointsExpected', 'type': 'int'}, + 'megabytes_per_second_transmitted_data_points_received': {'key': 'megabytesPerSecondTransmittedDataPointsReceived', 'type': 'int'}, + 'net_gigabytes_transmitted_per_month': {'key': 'netGigabytesTransmittedPerMonth', 'type': 'float'}, + 'suitability': {'key': 'suitability', 'type': 'str'}, + 'suitability_explanation': {'key': 'suitabilityExplanation', 'type': 'str'}, + } + + def __init__( + self, + *, + net_gigabytes_transmitted_per_month: Optional[float] = None, + **kwargs + ): + super(AssessedNetworkAdapter, self).__init__(**kwargs) + self.mac_address = None + self.ip_addresses = None + self.monthly_bandwidth_costs = None + self.megabytes_per_second_received = None + self.megabytes_per_second_received_data_points_expected = None + self.megabytes_per_second_of_read_data_points_received = None + self.megabytes_per_second_transmitted = None + self.megabytes_per_second_transmitted_data_points_expected = None + self.megabytes_per_second_transmitted_data_points_received = None + self.net_gigabytes_transmitted_per_month = net_gigabytes_transmitted_per_month + self.suitability = None + self.suitability_explanation = None + + +class Assessment(msrest.serialization.Model): + """An assessment created for a group in the Migration project. + + 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 id: Path reference to this assessment. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessment/{assessmentName}. + :vartype id: str + :ivar name: Unique name of an assessment. + :vartype name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :ivar type: Type of the object = [Microsoft.Migrate/projects/groups/assessments]. + :vartype type: str + :param azure_location: Required. Target Azure location for which the machines should be + assessed. These enums are the same as used by Compute API. Possible values include: 'Unknown', + 'EastAsia', 'SoutheastAsia', 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth', + 'CanadaCentral', 'CanadaEast', 'WestEurope', 'NorthEurope', 'CentralIndia', 'SouthIndia', + 'WestIndia', 'JapanEast', 'JapanWest', 'KoreaCentral', 'KoreaSouth', 'UkWest', 'UkSouth', + 'NorthCentralUs', 'EastUs', 'WestUs2', 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', + 'WestCentralUs', 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast'. + :type azure_location: str or ~azure_migrate.models.AzureLocation + :param azure_offer_code: Required. Offer code according to which cost estimation is done. + Possible values include: 'Unknown', 'MSAZR0003P', 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', + 'MSAZR0062P', 'MSAZR0063P', 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P', + 'MSAZR0148P', 'MSAZR0025P', 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P', 'MSAZR0122P', + 'MSAZR0123P', 'MSAZR0124P', 'MSAZR0125P', 'MSAZR0126P', 'MSAZR0127P', 'MSAZR0128P', + 'MSAZR0129P', 'MSAZR0130P', 'MSAZR0111P', 'MSAZR0144P', 'MSAZR0149P', 'MSMCAZR0044P', + 'MSMCAZR0059P', 'MSMCAZR0060P', 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P', + 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P'. + :type azure_offer_code: str or ~azure_migrate.models.AzureOfferCode + :param azure_pricing_tier: Required. Pricing tier for Size evaluation. Possible values include: + 'Standard', 'Basic'. + :type azure_pricing_tier: str or ~azure_migrate.models.AzurePricingTier + :param azure_storage_redundancy: Required. Storage Redundancy type offered by Azure. Possible + values include: 'Unknown', 'LocallyRedundant', 'ZoneRedundant', 'GeoRedundant', + 'ReadAccessGeoRedundant'. + :type azure_storage_redundancy: str or ~azure_migrate.models.AzureStorageRedundancy + :param scaling_factor: Required. Scaling factor used over utilization data to add a performance + buffer for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = + 1.3. + :type scaling_factor: float + :param percentile: Required. Percentile of performance data used to recommend Azure size. + Possible values include: 'Percentile50', 'Percentile90', 'Percentile95', 'Percentile99'. + :type percentile: str or ~azure_migrate.models.Percentile + :param time_range: Required. Time range of performance data used to recommend a size. Possible + values include: 'Day', 'Week', 'Month'. + :type time_range: str or ~azure_migrate.models.TimeRange + :param stage: Required. User configurable setting that describes the status of the assessment. + Possible values include: 'InProgress', 'UnderReview', 'Approved'. + :type stage: str or ~azure_migrate.models.AssessmentStage + :param currency: Required. Currency to report prices in. Possible values include: 'Unknown', + 'USD', 'DKK', 'CAD', 'IDR', 'JPY', 'KRW', 'NZD', 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', + 'GBP', 'MXN', 'MYR', 'INR', 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY'. + :type currency: str or ~azure_migrate.models.Currency + :param azure_hybrid_use_benefit: Required. AHUB discount on windows virtual machines. Possible + values include: 'Unknown', 'Yes', 'No'. + :type azure_hybrid_use_benefit: str or ~azure_migrate.models.AzureHybridUseBenefit + :param discount_percentage: Required. Custom discount percentage to be applied on final costs. + Can be in the range [0, 100]. + :type discount_percentage: float + :ivar confidence_rating_in_percentage: Confidence rating percentage for assessment. Can be in + the range [0, 100]. + :vartype confidence_rating_in_percentage: float + :param sizing_criterion: Required. Assessment sizing criterion. Possible values include: + 'PerformanceBased', 'AsOnPremises'. + :type sizing_criterion: str or ~azure_migrate.models.AssessmentSizingCriterion + :ivar prices_timestamp: Time when the Azure Prices were queried. Date-Time represented in + ISO-8601 format. + :vartype prices_timestamp: ~datetime.datetime + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar monthly_compute_cost: Monthly compute cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_compute_cost: float + :ivar monthly_bandwidth_cost: Monthly network cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_bandwidth_cost: float + :ivar monthly_storage_cost: Monthly storage cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_storage_cost: float + :ivar status: Whether the assessment has been created and is valid. Possible values include: + 'Created', 'Updated', 'Running', 'Completed', 'Invalid'. + :vartype status: str or ~azure_migrate.models.AssessmentStatus + :ivar number_of_machines: Number of assessed machines part of this assessment. + :vartype number_of_machines: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'azure_location': {'required': True}, + 'azure_offer_code': {'required': True}, + 'azure_pricing_tier': {'required': True}, + 'azure_storage_redundancy': {'required': True}, + 'scaling_factor': {'required': True}, + 'percentile': {'required': True}, + 'time_range': {'required': True}, + 'stage': {'required': True}, + 'currency': {'required': True}, + 'azure_hybrid_use_benefit': {'required': True}, + 'discount_percentage': {'required': True}, + 'confidence_rating_in_percentage': {'readonly': True}, + 'sizing_criterion': {'required': True}, + 'prices_timestamp': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'monthly_compute_cost': {'readonly': True}, + 'monthly_bandwidth_cost': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'status': {'readonly': True}, + 'number_of_machines': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azure_location': {'key': 'properties.azureLocation', 'type': 'str'}, + 'azure_offer_code': {'key': 'properties.azureOfferCode', 'type': 'str'}, + 'azure_pricing_tier': {'key': 'properties.azurePricingTier', 'type': 'str'}, + 'azure_storage_redundancy': {'key': 'properties.azureStorageRedundancy', 'type': 'str'}, + 'scaling_factor': {'key': 'properties.scalingFactor', 'type': 'float'}, + 'percentile': {'key': 'properties.percentile', 'type': 'str'}, + 'time_range': {'key': 'properties.timeRange', 'type': 'str'}, + 'stage': {'key': 'properties.stage', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'azure_hybrid_use_benefit': {'key': 'properties.azureHybridUseBenefit', 'type': 'str'}, + 'discount_percentage': {'key': 'properties.discountPercentage', 'type': 'float'}, + 'confidence_rating_in_percentage': {'key': 'properties.confidenceRatingInPercentage', 'type': 'float'}, + 'sizing_criterion': {'key': 'properties.sizingCriterion', 'type': 'str'}, + 'prices_timestamp': {'key': 'properties.pricesTimestamp', 'type': 'iso-8601'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + 'monthly_compute_cost': {'key': 'properties.monthlyComputeCost', 'type': 'float'}, + 'monthly_bandwidth_cost': {'key': 'properties.monthlyBandwidthCost', 'type': 'float'}, + 'monthly_storage_cost': {'key': 'properties.monthlyStorageCost', 'type': 'float'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'number_of_machines': {'key': 'properties.numberOfMachines', 'type': 'int'}, + } + + def __init__( + self, + *, + azure_location: Union[str, "AzureLocation"], + azure_offer_code: Union[str, "AzureOfferCode"], + azure_pricing_tier: Union[str, "AzurePricingTier"], + azure_storage_redundancy: Union[str, "AzureStorageRedundancy"], + scaling_factor: float, + percentile: Union[str, "Percentile"], + time_range: Union[str, "TimeRange"], + stage: Union[str, "AssessmentStage"], + currency: Union[str, "Currency"], + azure_hybrid_use_benefit: Union[str, "AzureHybridUseBenefit"], + discount_percentage: float, + sizing_criterion: Union[str, "AssessmentSizingCriterion"], + e_tag: Optional[str] = None, + **kwargs + ): + super(Assessment, self).__init__(**kwargs) + self.id = None + self.name = None + self.e_tag = e_tag + self.type = None + self.azure_location = azure_location + self.azure_offer_code = azure_offer_code + self.azure_pricing_tier = azure_pricing_tier + self.azure_storage_redundancy = azure_storage_redundancy + self.scaling_factor = scaling_factor + self.percentile = percentile + self.time_range = time_range + self.stage = stage + self.currency = currency + self.azure_hybrid_use_benefit = azure_hybrid_use_benefit + self.discount_percentage = discount_percentage + self.confidence_rating_in_percentage = None + self.sizing_criterion = sizing_criterion + self.prices_timestamp = None + self.created_timestamp = None + self.updated_timestamp = None + self.monthly_compute_cost = None + self.monthly_bandwidth_cost = None + self.monthly_storage_cost = None + self.status = None + self.number_of_machines = None + + +class AssessmentOptionsResultList(msrest.serialization.Model): + """List of assessment options. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vm_families: Dictionary of VM families grouped by vm family name describing the targeted + azure locations of VM family and the category of the family. + :vartype vm_families: list[~azure_migrate.models.VmFamily] + :ivar reserved_instance_vm_families: List of supported VM Families. + :vartype reserved_instance_vm_families: list[str] + """ + + _validation = { + 'vm_families': {'readonly': True}, + 'reserved_instance_vm_families': {'readonly': True}, + } + + _attribute_map = { + 'vm_families': {'key': 'vmFamilies', 'type': '[VmFamily]'}, + 'reserved_instance_vm_families': {'key': 'reservedInstanceVmFamilies', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessmentOptionsResultList, self).__init__(**kwargs) + self.vm_families = None + self.reserved_instance_vm_families = None + + +class AssessmentProperties(msrest.serialization.Model): + """Properties of an assessment. + + 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. + + :param azure_location: Required. Target Azure location for which the machines should be + assessed. These enums are the same as used by Compute API. Possible values include: 'Unknown', + 'EastAsia', 'SoutheastAsia', 'AustraliaEast', 'AustraliaSoutheast', 'BrazilSouth', + 'CanadaCentral', 'CanadaEast', 'WestEurope', 'NorthEurope', 'CentralIndia', 'SouthIndia', + 'WestIndia', 'JapanEast', 'JapanWest', 'KoreaCentral', 'KoreaSouth', 'UkWest', 'UkSouth', + 'NorthCentralUs', 'EastUs', 'WestUs2', 'SouthCentralUs', 'CentralUs', 'EastUs2', 'WestUs', + 'WestCentralUs', 'GermanyCentral', 'GermanyNortheast', 'ChinaNorth', 'ChinaEast'. + :type azure_location: str or ~azure_migrate.models.AzureLocation + :param azure_offer_code: Required. Offer code according to which cost estimation is done. + Possible values include: 'Unknown', 'MSAZR0003P', 'MSAZR0044P', 'MSAZR0059P', 'MSAZR0060P', + 'MSAZR0062P', 'MSAZR0063P', 'MSAZR0064P', 'MSAZR0029P', 'MSAZR0022P', 'MSAZR0023P', + 'MSAZR0148P', 'MSAZR0025P', 'MSAZR0036P', 'MSAZR0120P', 'MSAZR0121P', 'MSAZR0122P', + 'MSAZR0123P', 'MSAZR0124P', 'MSAZR0125P', 'MSAZR0126P', 'MSAZR0127P', 'MSAZR0128P', + 'MSAZR0129P', 'MSAZR0130P', 'MSAZR0111P', 'MSAZR0144P', 'MSAZR0149P', 'MSMCAZR0044P', + 'MSMCAZR0059P', 'MSMCAZR0060P', 'MSMCAZR0063P', 'MSMCAZR0120P', 'MSMCAZR0121P', 'MSMCAZR0125P', + 'MSMCAZR0128P', 'MSAZRDE0003P', 'MSAZRDE0044P'. + :type azure_offer_code: str or ~azure_migrate.models.AzureOfferCode + :param azure_pricing_tier: Required. Pricing tier for Size evaluation. Possible values include: + 'Standard', 'Basic'. + :type azure_pricing_tier: str or ~azure_migrate.models.AzurePricingTier + :param azure_storage_redundancy: Required. Storage Redundancy type offered by Azure. Possible + values include: 'Unknown', 'LocallyRedundant', 'ZoneRedundant', 'GeoRedundant', + 'ReadAccessGeoRedundant'. + :type azure_storage_redundancy: str or ~azure_migrate.models.AzureStorageRedundancy + :param scaling_factor: Required. Scaling factor used over utilization data to add a performance + buffer for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = + 1.3. + :type scaling_factor: float + :param percentile: Required. Percentile of performance data used to recommend Azure size. + Possible values include: 'Percentile50', 'Percentile90', 'Percentile95', 'Percentile99'. + :type percentile: str or ~azure_migrate.models.Percentile + :param time_range: Required. Time range of performance data used to recommend a size. Possible + values include: 'Day', 'Week', 'Month'. + :type time_range: str or ~azure_migrate.models.TimeRange + :param stage: Required. User configurable setting that describes the status of the assessment. + Possible values include: 'InProgress', 'UnderReview', 'Approved'. + :type stage: str or ~azure_migrate.models.AssessmentStage + :param currency: Required. Currency to report prices in. Possible values include: 'Unknown', + 'USD', 'DKK', 'CAD', 'IDR', 'JPY', 'KRW', 'NZD', 'NOK', 'RUB', 'SAR', 'ZAR', 'SEK', 'TRY', + 'GBP', 'MXN', 'MYR', 'INR', 'HKD', 'BRL', 'TWD', 'EUR', 'CHF', 'ARS', 'AUD', 'CNY'. + :type currency: str or ~azure_migrate.models.Currency + :param azure_hybrid_use_benefit: Required. AHUB discount on windows virtual machines. Possible + values include: 'Unknown', 'Yes', 'No'. + :type azure_hybrid_use_benefit: str or ~azure_migrate.models.AzureHybridUseBenefit + :param discount_percentage: Required. Custom discount percentage to be applied on final costs. + Can be in the range [0, 100]. + :type discount_percentage: float + :ivar confidence_rating_in_percentage: Confidence rating percentage for assessment. Can be in + the range [0, 100]. + :vartype confidence_rating_in_percentage: float + :param sizing_criterion: Required. Assessment sizing criterion. Possible values include: + 'PerformanceBased', 'AsOnPremises'. + :type sizing_criterion: str or ~azure_migrate.models.AssessmentSizingCriterion + :ivar prices_timestamp: Time when the Azure Prices were queried. Date-Time represented in + ISO-8601 format. + :vartype prices_timestamp: ~datetime.datetime + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar monthly_compute_cost: Monthly compute cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_compute_cost: float + :ivar monthly_bandwidth_cost: Monthly network cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_bandwidth_cost: float + :ivar monthly_storage_cost: Monthly storage cost estimate for the machines that are part of + this assessment as a group, for a 31-day month. + :vartype monthly_storage_cost: float + :ivar status: Whether the assessment has been created and is valid. Possible values include: + 'Created', 'Updated', 'Running', 'Completed', 'Invalid'. + :vartype status: str or ~azure_migrate.models.AssessmentStatus + :ivar number_of_machines: Number of assessed machines part of this assessment. + :vartype number_of_machines: int + """ + + _validation = { + 'azure_location': {'required': True}, + 'azure_offer_code': {'required': True}, + 'azure_pricing_tier': {'required': True}, + 'azure_storage_redundancy': {'required': True}, + 'scaling_factor': {'required': True}, + 'percentile': {'required': True}, + 'time_range': {'required': True}, + 'stage': {'required': True}, + 'currency': {'required': True}, + 'azure_hybrid_use_benefit': {'required': True}, + 'discount_percentage': {'required': True}, + 'confidence_rating_in_percentage': {'readonly': True}, + 'sizing_criterion': {'required': True}, + 'prices_timestamp': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'monthly_compute_cost': {'readonly': True}, + 'monthly_bandwidth_cost': {'readonly': True}, + 'monthly_storage_cost': {'readonly': True}, + 'status': {'readonly': True}, + 'number_of_machines': {'readonly': True}, + } + + _attribute_map = { + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + 'azure_offer_code': {'key': 'azureOfferCode', 'type': 'str'}, + 'azure_pricing_tier': {'key': 'azurePricingTier', 'type': 'str'}, + 'azure_storage_redundancy': {'key': 'azureStorageRedundancy', 'type': 'str'}, + 'scaling_factor': {'key': 'scalingFactor', 'type': 'float'}, + 'percentile': {'key': 'percentile', 'type': 'str'}, + 'time_range': {'key': 'timeRange', 'type': 'str'}, + 'stage': {'key': 'stage', 'type': 'str'}, + 'currency': {'key': 'currency', 'type': 'str'}, + 'azure_hybrid_use_benefit': {'key': 'azureHybridUseBenefit', 'type': 'str'}, + 'discount_percentage': {'key': 'discountPercentage', 'type': 'float'}, + 'confidence_rating_in_percentage': {'key': 'confidenceRatingInPercentage', 'type': 'float'}, + 'sizing_criterion': {'key': 'sizingCriterion', 'type': 'str'}, + 'prices_timestamp': {'key': 'pricesTimestamp', 'type': 'iso-8601'}, + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + 'monthly_compute_cost': {'key': 'monthlyComputeCost', 'type': 'float'}, + 'monthly_bandwidth_cost': {'key': 'monthlyBandwidthCost', 'type': 'float'}, + 'monthly_storage_cost': {'key': 'monthlyStorageCost', 'type': 'float'}, + 'status': {'key': 'status', 'type': 'str'}, + 'number_of_machines': {'key': 'numberOfMachines', 'type': 'int'}, + } + + def __init__( + self, + *, + azure_location: Union[str, "AzureLocation"], + azure_offer_code: Union[str, "AzureOfferCode"], + azure_pricing_tier: Union[str, "AzurePricingTier"], + azure_storage_redundancy: Union[str, "AzureStorageRedundancy"], + scaling_factor: float, + percentile: Union[str, "Percentile"], + time_range: Union[str, "TimeRange"], + stage: Union[str, "AssessmentStage"], + currency: Union[str, "Currency"], + azure_hybrid_use_benefit: Union[str, "AzureHybridUseBenefit"], + discount_percentage: float, + sizing_criterion: Union[str, "AssessmentSizingCriterion"], + **kwargs + ): + super(AssessmentProperties, self).__init__(**kwargs) + self.azure_location = azure_location + self.azure_offer_code = azure_offer_code + self.azure_pricing_tier = azure_pricing_tier + self.azure_storage_redundancy = azure_storage_redundancy + self.scaling_factor = scaling_factor + self.percentile = percentile + self.time_range = time_range + self.stage = stage + self.currency = currency + self.azure_hybrid_use_benefit = azure_hybrid_use_benefit + self.discount_percentage = discount_percentage + self.confidence_rating_in_percentage = None + self.sizing_criterion = sizing_criterion + self.prices_timestamp = None + self.created_timestamp = None + self.updated_timestamp = None + self.monthly_compute_cost = None + self.monthly_bandwidth_cost = None + self.monthly_storage_cost = None + self.status = None + self.number_of_machines = None + + +class AssessmentResultList(msrest.serialization.Model): + """List of assessments. + + :param value: List of assessments. + :type value: list[~azure_migrate.models.Assessment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Assessment]'}, + } + + def __init__( + self, + *, + value: Optional[List["Assessment"]] = None, + **kwargs + ): + super(AssessmentResultList, self).__init__(**kwargs) + self.value = value + + +class CheckNameAvailabilityParameters(msrest.serialization.Model): + """Parameters for a check name availability request. + + 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. + + :param name: Required. The name to check for availability. + :type name: str + :ivar type: Required. The resource type. Must be set to Microsoft.Migrate/projects. Default + value: "Microsoft.Migrate/projects". + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Migrate/projects" + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name is available for you + to use. If true, the name is available. If false, the name has already been taken or invalid + and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a project name could not be used. The Reason element is only + returned if NameAvailable is false. Possible values include: 'Available', 'Invalid', + 'AlreadyExists'. + :vartype reason: str or ~azure_migrate.models.NameAvailabilityReason + :ivar message: Gets an error message explaining the Reason value in more detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudErrorException(HttpResponseError): + """Server responded with exception of type: 'CloudError'. + + :param response: Server response to be deserialized. + :param error_model: A deserialized model of the response body as model. + """ + + def __init__(self, response, error_model): + self.error = error_model + super(CloudErrorException, self).__init__(response=response, error_model=error_model) + + @classmethod + def from_response(cls, response, deserialize): + """Deserialize this response as this exception, or a subclass of this exception. + + :param response: Server response to be deserialized. + :param deserialize: A deserializer + """ + model_name = 'CloudError' + error = deserialize(model_name, response) + if error is None: + error = deserialize.dependencies[model_name]() + return error._EXCEPTION_TYPE(response, error) + + +class CloudError(msrest.serialization.Model): + """An error response from the Azure Migrate service. + + :param error: An error response from the Azure Migrate service. + :type error: ~azure_migrate.models.CloudErrorBody + """ + _EXCEPTION_TYPE = CloudErrorException + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__( + self, + *, + error: Optional["CloudErrorBody"] = None, + **kwargs + ): + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Azure Migrate service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure_migrate.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class Disk(msrest.serialization.Model): + """A disk discovered on a machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar gigabytes_allocated: Gigabytes of storage provisioned for this disk. + :vartype gigabytes_allocated: float + :ivar gigabytes_consumed: Gigabytes of storage consumed by this disk. + :vartype gigabytes_consumed: float + """ + + _validation = { + 'gigabytes_allocated': {'readonly': True}, + 'gigabytes_consumed': {'readonly': True}, + } + + _attribute_map = { + 'gigabytes_allocated': {'key': 'gigabytesAllocated', 'type': 'float'}, + 'gigabytes_consumed': {'key': 'gigabytesConsumed', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(Disk, self).__init__(**kwargs) + self.gigabytes_allocated = None + self.gigabytes_consumed = None + + +class DownloadUrl(msrest.serialization.Model): + """Download URL for assessment report. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar assessment_report_url: Hyperlink to download report. + :vartype assessment_report_url: str + :ivar expiration_time: Expiry date of download url. + :vartype expiration_time: ~datetime.datetime + """ + + _validation = { + 'assessment_report_url': {'readonly': True}, + 'expiration_time': {'readonly': True}, + } + + _attribute_map = { + 'assessment_report_url': {'key': 'assessmentReportUrl', 'type': 'str'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(DownloadUrl, self).__init__(**kwargs) + self.assessment_report_url = None + self.expiration_time = None + + +class Group(msrest.serialization.Model): + """A group created in a Migration project. + + 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 id: Path reference to this group. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}. + :vartype id: str + :ivar name: Name of the group. + :vartype name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :ivar type: Type of the object = [Microsoft.Migrate/projects/groups]. + :vartype type: str + :param machines: Required. List of machine names that are part of this group. + :type machines: list[str] + :ivar assessments: List of References to Assessments created on this group. + :vartype assessments: list[str] + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'machines': {'required': True}, + 'assessments': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'machines': {'key': 'properties.machines', 'type': '[str]'}, + 'assessments': {'key': 'properties.assessments', 'type': '[str]'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + machines: List[str], + e_tag: Optional[str] = None, + **kwargs + ): + super(Group, self).__init__(**kwargs) + self.id = None + self.name = None + self.e_tag = e_tag + self.type = None + self.machines = machines + self.assessments = None + self.created_timestamp = None + self.updated_timestamp = None + + +class GroupProperties(msrest.serialization.Model): + """Properties of group resource. + + 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. + + :param machines: Required. List of machine names that are part of this group. + :type machines: list[str] + :ivar assessments: List of References to Assessments created on this group. + :vartype assessments: list[str] + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + """ + + _validation = { + 'machines': {'required': True}, + 'assessments': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'machines': {'key': 'machines', 'type': '[str]'}, + 'assessments': {'key': 'assessments', 'type': '[str]'}, + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + machines: List[str], + **kwargs + ): + super(GroupProperties, self).__init__(**kwargs) + self.machines = machines + self.assessments = None + self.created_timestamp = None + self.updated_timestamp = None + + +class GroupResultList(msrest.serialization.Model): + """List of groups. + + :param value: List of groups. + :type value: list[~azure_migrate.models.Group] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Group]'}, + } + + def __init__( + self, + *, + value: Optional[List["Group"]] = None, + **kwargs + ): + super(GroupResultList, self).__init__(**kwargs) + self.value = value + + +class Machine(msrest.serialization.Model): + """A machine in a migration project. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Path reference to this machine. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines/{machineName}. + :vartype id: str + :ivar name: Name of the machine. It is a GUID which is unique identifier of machine in private + data center. For user-readable name, we have a displayName property on this machine. + :vartype name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :ivar type: Type of the object = [Microsoft.Migrate/projects/machines]. + :vartype type: str + :ivar boot_type: Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS'. + :vartype boot_type: str or ~azure_migrate.models.MachineBootType + :ivar datacenter_container: Container defined in the management solution that this machine is + part of in the datacenter. + :vartype datacenter_container: str + :ivar datacenter_management_server: Name of the server hosting the datacenter management + solution. + :vartype datacenter_management_server: str + :ivar datacenter_machine_id: ID of the machine as tracked by the datacenter management + solution. + :vartype datacenter_machine_id: str + :ivar datacenter_management_server_id: ID of the server hosting the datacenter management + solution. + :vartype datacenter_management_server_id: str + :ivar description: Description of the machine. + :vartype description: str + :ivar display_name: User readable name of the machine as defined by the user in their private + datacenter. + :vartype display_name: str + :ivar megabytes_of_memory: Memory in Megabytes. + :vartype megabytes_of_memory: float + :ivar number_of_cores: Processor count. + :vartype number_of_cores: int + :ivar operating_system: Operating System of the machine. + :vartype operating_system: str + :ivar groups: List of references to the groups that the machine is member of. + :vartype groups: list[str] + :ivar created_timestamp: Time when this machine was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this machine was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar discovered_timestamp: Time when this machine was discovered by Azure Migrate agent. Date- + Time represented in ISO-8601 format. + :vartype discovered_timestamp: ~datetime.datetime + :ivar disks: Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk + object. + :vartype disks: dict[str, ~azure_migrate.models.Disk] + :ivar network_adapters: Dictionary of network adapters attached to the machine. Key is ID of + network adapter. Value is a network adapter object. + :vartype network_adapters: dict[str, ~azure_migrate.models.NetworkAdapter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'boot_type': {'readonly': True}, + 'datacenter_container': {'readonly': True}, + 'datacenter_management_server': {'readonly': True}, + 'datacenter_machine_id': {'readonly': True}, + 'datacenter_management_server_id': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'megabytes_of_memory': {'readonly': True}, + 'number_of_cores': {'readonly': True}, + 'operating_system': {'readonly': True}, + 'groups': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'discovered_timestamp': {'readonly': True}, + 'disks': {'readonly': True}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'boot_type': {'key': 'properties.bootType', 'type': 'str'}, + 'datacenter_container': {'key': 'properties.datacenterContainer', 'type': 'str'}, + 'datacenter_management_server': {'key': 'properties.datacenterManagementServer', 'type': 'str'}, + 'datacenter_machine_id': {'key': 'properties.datacenterMachineId', 'type': 'str'}, + 'datacenter_management_server_id': {'key': 'properties.datacenterManagementServerId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'megabytes_of_memory': {'key': 'properties.megabytesOfMemory', 'type': 'float'}, + 'number_of_cores': {'key': 'properties.numberOfCores', 'type': 'int'}, + 'operating_system': {'key': 'properties.operatingSystem', 'type': 'str'}, + 'groups': {'key': 'properties.groups', 'type': '[str]'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + 'discovered_timestamp': {'key': 'properties.discoveredTimestamp', 'type': 'iso-8601'}, + 'disks': {'key': 'properties.disks', 'type': '{Disk}'}, + 'network_adapters': {'key': 'properties.networkAdapters', 'type': '{NetworkAdapter}'}, + } + + def __init__( + self, + *, + e_tag: Optional[str] = None, + **kwargs + ): + super(Machine, self).__init__(**kwargs) + self.id = None + self.name = None + self.e_tag = e_tag + self.type = None + self.boot_type = None + self.datacenter_container = None + self.datacenter_management_server = None + self.datacenter_machine_id = None + self.datacenter_management_server_id = None + self.description = None + self.display_name = None + self.megabytes_of_memory = None + self.number_of_cores = None + self.operating_system = None + self.groups = None + self.created_timestamp = None + self.updated_timestamp = None + self.discovered_timestamp = None + self.disks = None + self.network_adapters = None + + +class MachineProperties(msrest.serialization.Model): + """Properties of a machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar boot_type: Boot type of the machine. Possible values include: 'Unknown', 'EFI', 'BIOS'. + :vartype boot_type: str or ~azure_migrate.models.MachineBootType + :ivar datacenter_container: Container defined in the management solution that this machine is + part of in the datacenter. + :vartype datacenter_container: str + :ivar datacenter_management_server: Name of the server hosting the datacenter management + solution. + :vartype datacenter_management_server: str + :ivar datacenter_machine_id: ID of the machine as tracked by the datacenter management + solution. + :vartype datacenter_machine_id: str + :ivar datacenter_management_server_id: ID of the server hosting the datacenter management + solution. + :vartype datacenter_management_server_id: str + :ivar description: Description of the machine. + :vartype description: str + :ivar display_name: User readable name of the machine as defined by the user in their private + datacenter. + :vartype display_name: str + :ivar megabytes_of_memory: Memory in Megabytes. + :vartype megabytes_of_memory: float + :ivar number_of_cores: Processor count. + :vartype number_of_cores: int + :ivar operating_system: Operating System of the machine. + :vartype operating_system: str + :ivar groups: List of references to the groups that the machine is member of. + :vartype groups: list[str] + :ivar created_timestamp: Time when this machine was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this machine was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar discovered_timestamp: Time when this machine was discovered by Azure Migrate agent. Date- + Time represented in ISO-8601 format. + :vartype discovered_timestamp: ~datetime.datetime + :ivar disks: Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk + object. + :vartype disks: dict[str, ~azure_migrate.models.Disk] + :ivar network_adapters: Dictionary of network adapters attached to the machine. Key is ID of + network adapter. Value is a network adapter object. + :vartype network_adapters: dict[str, ~azure_migrate.models.NetworkAdapter] + """ + + _validation = { + 'boot_type': {'readonly': True}, + 'datacenter_container': {'readonly': True}, + 'datacenter_management_server': {'readonly': True}, + 'datacenter_machine_id': {'readonly': True}, + 'datacenter_management_server_id': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'megabytes_of_memory': {'readonly': True}, + 'number_of_cores': {'readonly': True}, + 'operating_system': {'readonly': True}, + 'groups': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'discovered_timestamp': {'readonly': True}, + 'disks': {'readonly': True}, + 'network_adapters': {'readonly': True}, + } + + _attribute_map = { + 'boot_type': {'key': 'bootType', 'type': 'str'}, + 'datacenter_container': {'key': 'datacenterContainer', 'type': 'str'}, + 'datacenter_management_server': {'key': 'datacenterManagementServer', 'type': 'str'}, + 'datacenter_machine_id': {'key': 'datacenterMachineId', 'type': 'str'}, + 'datacenter_management_server_id': {'key': 'datacenterManagementServerId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'megabytes_of_memory': {'key': 'megabytesOfMemory', 'type': 'float'}, + 'number_of_cores': {'key': 'numberOfCores', 'type': 'int'}, + 'operating_system': {'key': 'operatingSystem', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[str]'}, + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + 'discovered_timestamp': {'key': 'discoveredTimestamp', 'type': 'iso-8601'}, + 'disks': {'key': 'disks', 'type': '{Disk}'}, + 'network_adapters': {'key': 'networkAdapters', 'type': '{NetworkAdapter}'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineProperties, self).__init__(**kwargs) + self.boot_type = None + self.datacenter_container = None + self.datacenter_management_server = None + self.datacenter_machine_id = None + self.datacenter_management_server_id = None + self.description = None + self.display_name = None + self.megabytes_of_memory = None + self.number_of_cores = None + self.operating_system = None + self.groups = None + self.created_timestamp = None + self.updated_timestamp = None + self.discovered_timestamp = None + self.disks = None + self.network_adapters = None + + +class MachineResultList(msrest.serialization.Model): + """List of machines. + + :param value: List of machines. + :type value: list[~azure_migrate.models.Machine] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Machine]'}, + } + + def __init__( + self, + *, + value: Optional[List["Machine"]] = None, + **kwargs + ): + super(MachineResultList, self).__init__(**kwargs) + self.value = value + + +class NetworkAdapter(msrest.serialization.Model): + """A network adapter discovered on a machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar mac_address: MAC Address of the network adapter. + :vartype mac_address: str + :ivar ip_addresses: List of IP Addresses on the network adapter. + :vartype ip_addresses: list[str] + """ + + _validation = { + 'mac_address': {'readonly': True}, + 'ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAdapter, self).__init__(**kwargs) + self.mac_address = None + self.ip_addresses = None + + +class Operation(msrest.serialization.Model): + """A REST API operation supported by the provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the operation. + :vartype name: str + :param display: Displayable properties of the operation. + :type display: ~azure_migrate.models.OperationDisplay + :ivar origin: Origin of the operation. + :vartype origin: str + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + *, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + self.origin = None + + +class OperationDisplay(msrest.serialization.Model): + """Displayable properties of the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Provider of the operation. + :vartype provider: str + :ivar resource: Resource operated on by the operation. + :vartype resource: str + :ivar operation: Operation Type. + :vartype operation: str + :ivar description: Description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class OperationResultList(msrest.serialization.Model): + """List of API operations. + + :param value: List of operations. + :type value: list[~azure_migrate.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + **kwargs + ): + super(OperationResultList, self).__init__(**kwargs) + self.value = value + + +class Project(msrest.serialization.Model): + """Azure Migrate Project. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Path reference to this project + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}. + :vartype id: str + :ivar name: Name of the project. + :vartype name: str + :ivar type: Type of the object = [Microsoft.Migrate/projects]. + :vartype type: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :param location: Azure location in which project is created. + :type location: str + :param tags: A set of tags. Tags provided by Azure Tagging service. + :type tags: ~azure_migrate.models.ProjectTags + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar discovery_status: Reports whether project is under discovery. Possible values include: + 'Unknown', 'NotStarted', 'InProgress', 'Completed'. + :vartype discovery_status: str or ~azure_migrate.models.DiscoveryStatus + :param customer_workspace_id: ARM ID of the Service Map workspace created by user. + :type customer_workspace_id: str + :param customer_workspace_location: Location of the Service Map workspace created by user. + :type customer_workspace_location: str + :ivar last_discovery_timestamp: Time when this project was created. Date-Time represented in + ISO-8601 format. This value will be null until discovery is complete. + :vartype last_discovery_timestamp: ~datetime.datetime + :ivar last_discovery_session_id: Session id of the last discovery. + :vartype last_discovery_session_id: str + :ivar number_of_groups: Number of groups created in the project. + :vartype number_of_groups: int + :ivar number_of_machines: Number of machines in the project. + :vartype number_of_machines: int + :ivar number_of_assessments: Number of assessments created in the project. + :vartype number_of_assessments: int + :ivar last_assessment_timestamp: Time when last assessment was created. Date-Time represented + in ISO-8601 format. This value will be null until assessment is created. + :vartype last_assessment_timestamp: ~datetime.datetime + :param provisioning_state: Provisioning state of the project. Possible values include: + 'Accepted', 'Creating', 'Deleting', 'Failed', 'Moving', 'Succeeded'. + :type provisioning_state: str or ~azure_migrate.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'discovery_status': {'readonly': True}, + 'last_discovery_timestamp': {'readonly': True}, + 'last_discovery_session_id': {'readonly': True}, + 'number_of_groups': {'readonly': True}, + 'number_of_machines': {'readonly': True}, + 'number_of_assessments': {'readonly': True}, + 'last_assessment_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'ProjectTags'}, + 'created_timestamp': {'key': 'properties.createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'properties.updatedTimestamp', 'type': 'iso-8601'}, + 'discovery_status': {'key': 'properties.discoveryStatus', 'type': 'str'}, + 'customer_workspace_id': {'key': 'properties.customerWorkspaceId', 'type': 'str'}, + 'customer_workspace_location': {'key': 'properties.customerWorkspaceLocation', 'type': 'str'}, + 'last_discovery_timestamp': {'key': 'properties.lastDiscoveryTimestamp', 'type': 'iso-8601'}, + 'last_discovery_session_id': {'key': 'properties.lastDiscoverySessionId', 'type': 'str'}, + 'number_of_groups': {'key': 'properties.numberOfGroups', 'type': 'int'}, + 'number_of_machines': {'key': 'properties.numberOfMachines', 'type': 'int'}, + 'number_of_assessments': {'key': 'properties.numberOfAssessments', 'type': 'int'}, + 'last_assessment_timestamp': {'key': 'properties.lastAssessmentTimestamp', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + e_tag: Optional[str] = None, + location: Optional[str] = None, + tags: Optional["ProjectTags"] = None, + customer_workspace_id: Optional[str] = None, + customer_workspace_location: Optional[str] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + **kwargs + ): + super(Project, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.e_tag = e_tag + self.location = location + self.tags = tags + self.created_timestamp = None + self.updated_timestamp = None + self.discovery_status = None + self.customer_workspace_id = customer_workspace_id + self.customer_workspace_location = customer_workspace_location + self.last_discovery_timestamp = None + self.last_discovery_session_id = None + self.number_of_groups = None + self.number_of_machines = None + self.number_of_assessments = None + self.last_assessment_timestamp = None + self.provisioning_state = provisioning_state + + +class ProjectKey(msrest.serialization.Model): + """ID and Key for Migration Project. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar workspace_id: ID of Migration Project. + :vartype workspace_id: str + :ivar workspace_key: Key of Migration Project. + :vartype workspace_key: str + """ + + _validation = { + 'workspace_id': {'readonly': True}, + 'workspace_key': {'readonly': True}, + } + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'workspace_key': {'key': 'workspaceKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProjectKey, self).__init__(**kwargs) + self.workspace_id = None + self.workspace_key = None + + +class ProjectProperties(msrest.serialization.Model): + """Properties of a project. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_timestamp: Time when this project was created. Date-Time represented in ISO-8601 + format. + :vartype created_timestamp: ~datetime.datetime + :ivar updated_timestamp: Time when this project was last updated. Date-Time represented in + ISO-8601 format. + :vartype updated_timestamp: ~datetime.datetime + :ivar discovery_status: Reports whether project is under discovery. Possible values include: + 'Unknown', 'NotStarted', 'InProgress', 'Completed'. + :vartype discovery_status: str or ~azure_migrate.models.DiscoveryStatus + :param customer_workspace_id: ARM ID of the Service Map workspace created by user. + :type customer_workspace_id: str + :param customer_workspace_location: Location of the Service Map workspace created by user. + :type customer_workspace_location: str + :ivar last_discovery_timestamp: Time when this project was created. Date-Time represented in + ISO-8601 format. This value will be null until discovery is complete. + :vartype last_discovery_timestamp: ~datetime.datetime + :ivar last_discovery_session_id: Session id of the last discovery. + :vartype last_discovery_session_id: str + :ivar number_of_groups: Number of groups created in the project. + :vartype number_of_groups: int + :ivar number_of_machines: Number of machines in the project. + :vartype number_of_machines: int + :ivar number_of_assessments: Number of assessments created in the project. + :vartype number_of_assessments: int + :ivar last_assessment_timestamp: Time when last assessment was created. Date-Time represented + in ISO-8601 format. This value will be null until assessment is created. + :vartype last_assessment_timestamp: ~datetime.datetime + :param provisioning_state: Provisioning state of the project. Possible values include: + 'Accepted', 'Creating', 'Deleting', 'Failed', 'Moving', 'Succeeded'. + :type provisioning_state: str or ~azure_migrate.models.ProvisioningState + """ + + _validation = { + 'created_timestamp': {'readonly': True}, + 'updated_timestamp': {'readonly': True}, + 'discovery_status': {'readonly': True}, + 'last_discovery_timestamp': {'readonly': True}, + 'last_discovery_session_id': {'readonly': True}, + 'number_of_groups': {'readonly': True}, + 'number_of_machines': {'readonly': True}, + 'number_of_assessments': {'readonly': True}, + 'last_assessment_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, + 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, + 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'customer_workspace_id': {'key': 'customerWorkspaceId', 'type': 'str'}, + 'customer_workspace_location': {'key': 'customerWorkspaceLocation', 'type': 'str'}, + 'last_discovery_timestamp': {'key': 'lastDiscoveryTimestamp', 'type': 'iso-8601'}, + 'last_discovery_session_id': {'key': 'lastDiscoverySessionId', 'type': 'str'}, + 'number_of_groups': {'key': 'numberOfGroups', 'type': 'int'}, + 'number_of_machines': {'key': 'numberOfMachines', 'type': 'int'}, + 'number_of_assessments': {'key': 'numberOfAssessments', 'type': 'int'}, + 'last_assessment_timestamp': {'key': 'lastAssessmentTimestamp', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + customer_workspace_id: Optional[str] = None, + customer_workspace_location: Optional[str] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + **kwargs + ): + super(ProjectProperties, self).__init__(**kwargs) + self.created_timestamp = None + self.updated_timestamp = None + self.discovery_status = None + self.customer_workspace_id = customer_workspace_id + self.customer_workspace_location = customer_workspace_location + self.last_discovery_timestamp = None + self.last_discovery_session_id = None + self.number_of_groups = None + self.number_of_machines = None + self.number_of_assessments = None + self.last_assessment_timestamp = None + self.provisioning_state = provisioning_state + + +class ProjectResultList(msrest.serialization.Model): + """List of projects. + + :param value: List of projects. + :type value: list[~azure_migrate.models.Project] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Project]'}, + } + + def __init__( + self, + *, + value: Optional[List["Project"]] = None, + **kwargs + ): + super(ProjectResultList, self).__init__(**kwargs) + self.value = value + + +class ProjectTags(msrest.serialization.Model): + """Tags provided by Azure Tagging service. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(ProjectTags, self).__init__(**kwargs) + + +class VmFamily(msrest.serialization.Model): + """VM family name, the list of targeted azure locations and the category of the family. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar family_name: Name of the VM family. + :vartype family_name: str + :ivar target_locations: List of Azure regions. + :vartype target_locations: list[str] + :ivar category: Category of the VM family. + :vartype category: list[str] + """ + + _validation = { + 'family_name': {'readonly': True}, + 'target_locations': {'readonly': True}, + 'category': {'readonly': True}, + } + + _attribute_map = { + 'family_name': {'key': 'familyName', 'type': 'str'}, + 'target_locations': {'key': 'targetLocations', 'type': '[str]'}, + 'category': {'key': 'category', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VmFamily, self).__init__(**kwargs) + self.family_name = None + self.target_locations = None + self.category = None diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/operations/__init__.py b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/__init__.py new file mode 100644 index 00000000000..e8d83732934 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._location_operations import LocationOperations +from ._assessment_option_operations import AssessmentOptionOperations +from ._project_operations import ProjectOperations +from ._machine_operations import MachineOperations +from ._group_operations import GroupOperations +from ._assessment_operations import AssessmentOperations +from ._assessed_machine_operations import AssessedMachineOperations +from ._operation_operations import OperationOperations + +__all__ = [ + 'LocationOperations', + 'AssessmentOptionOperations', + 'ProjectOperations', + 'MachineOperations', + 'GroupOperations', + 'AssessmentOperations', + 'AssessedMachineOperations', + 'OperationOperations', +] diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_assessed_machine_operations.py b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_assessed_machine_operations.py new file mode 100644 index 00000000000..36c10c83513 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_assessed_machine_operations.py @@ -0,0 +1,201 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AssessedMachineOperations(object): + """AssessedMachineOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_assessment( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + assessment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AssessedMachineResultList" + """Get list of machines that assessed as part of the specified assessment. Returns a json array of objects of type 'assessedMachine' as specified in the Models section. + + Whenever an assessment is created or updated, it goes under computation. During this phase, the 'status' field of Assessment object reports 'Computing'. + During the period when the assessment is under computation, the list of assessed machines is empty and no assessed machines are returned by this call. + + Get assessed machines for assessment. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessedMachineResultList or the result of cls(response) + :rtype: ~azure_migrate.models.AssessedMachineResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.AssessedMachineResultList"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_assessment.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('AssessedMachineResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_assessment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines'} + + def get( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + assessment_name, # type: str + assessed_machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AssessedMachine" + """Get an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + + Get an assessed machine. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :param assessed_machine_name: Unique name of an assessed machine evaluated as part of an + assessment. + :type assessed_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessedMachine or the result of cls(response) + :rtype: ~azure_migrate.models.AssessedMachine + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.AssessedMachine"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + 'assessedMachineName': self._serialize.url("assessed_machine_name", assessed_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('AssessedMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_assessment_operations.py b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_assessment_operations.py new file mode 100644 index 00000000000..07173669245 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_assessment_operations.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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AssessmentOperations(object): + """AssessmentOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_group( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AssessmentResultList" + """Get all assessments created for the specified group. + + Returns a json array of objects of type 'assessment' as specified in Models section. + + Get all assessments created for the specified group. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessmentResultList or the result of cls(response) + :rtype: ~azure_migrate.models.AssessmentResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.AssessmentResultList"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_group.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('AssessmentResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments'} + + def list_by_project( + self, + resource_group_name, # type: str + project_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AssessmentResultList" + """Get all assessments created in the project. + + Returns a json array of objects of type 'assessment' as specified in Models section. + + Get all assessments created in the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessmentResultList or the result of cls(response) + :rtype: ~azure_migrate.models.AssessmentResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.AssessmentResultList"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_project.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('AssessmentResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_project.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/assessments'} + + def get( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + assessment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Assessment" + """Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + + Get an assessment. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Assessment or the result of cls(response) + :rtype: ~azure_migrate.models.Assessment + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Assessment"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Assessment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}'} + + def create( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + assessment_name, # type: str + azure_location, # type: Union[str, "models.AzureLocation"] + azure_offer_code, # type: Union[str, "models.AzureOfferCode"] + azure_pricing_tier, # type: Union[str, "models.AzurePricingTier"] + azure_storage_redundancy, # type: Union[str, "models.AzureStorageRedundancy"] + scaling_factor, # type: float + percentile, # type: Union[str, "models.Percentile"] + time_range, # type: Union[str, "models.TimeRange"] + stage, # type: Union[str, "models.AssessmentStage"] + currency, # type: Union[str, "models.Currency"] + azure_hybrid_use_benefit, # type: Union[str, "models.AzureHybridUseBenefit"] + discount_percentage, # type: float + sizing_criterion, # type: Union[str, "models.AssessmentSizingCriterion"] + e_tag=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Assessment" + """Create a new assessment with the given name and the specified settings. Since name of an assessment in a project is a unique identifier, if an assessment with the name provided already exists, then the existing assessment is updated. + + Any PUT operation, resulting in either create or update on an assessment, will cause the assessment to go in a "InProgress" state. This will be indicated by the field 'computationState' on the Assessment object. During this time no other PUT operation will be allowed on that assessment object, nor will a Delete operation. Once the computation for the assessment is complete, the field 'computationState' will be updated to 'Ready', and then other PUT or DELETE operations can happen on the assessment. + + When assessment is under computation, any PUT will lead to a 400 - Bad Request error. + + Create or Update assessment. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :param azure_location: Target Azure location for which the machines should be assessed. These + enums are the same as used by Compute API. + :type azure_location: str or ~azure_migrate.models.AzureLocation + :param azure_offer_code: Offer code according to which cost estimation is done. + :type azure_offer_code: str or ~azure_migrate.models.AzureOfferCode + :param azure_pricing_tier: Pricing tier for Size evaluation. + :type azure_pricing_tier: str or ~azure_migrate.models.AzurePricingTier + :param azure_storage_redundancy: Storage Redundancy type offered by Azure. + :type azure_storage_redundancy: str or ~azure_migrate.models.AzureStorageRedundancy + :param scaling_factor: Scaling factor used over utilization data to add a performance buffer + for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3. + :type scaling_factor: float + :param percentile: Percentile of performance data used to recommend Azure size. + :type percentile: str or ~azure_migrate.models.Percentile + :param time_range: Time range of performance data used to recommend a size. + :type time_range: str or ~azure_migrate.models.TimeRange + :param stage: User configurable setting that describes the status of the assessment. + :type stage: str or ~azure_migrate.models.AssessmentStage + :param currency: Currency to report prices in. + :type currency: str or ~azure_migrate.models.Currency + :param azure_hybrid_use_benefit: AHUB discount on windows virtual machines. + :type azure_hybrid_use_benefit: str or ~azure_migrate.models.AzureHybridUseBenefit + :param discount_percentage: Custom discount percentage to be applied on final costs. Can be in + the range [0, 100]. + :type discount_percentage: float + :param sizing_criterion: Assessment sizing criterion. + :type sizing_criterion: str or ~azure_migrate.models.AssessmentSizingCriterion + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Assessment or Assessment or the result of cls(response) + :rtype: ~azure_migrate.models.Assessment or ~azure_migrate.models.Assessment + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Assessment"] + error_map = kwargs.pop('error_map', {}) + + assessment = models.Assessment(e_tag=e_tag, azure_location=azure_location, azure_offer_code=azure_offer_code, azure_pricing_tier=azure_pricing_tier, azure_storage_redundancy=azure_storage_redundancy, scaling_factor=scaling_factor, percentile=percentile, time_range=time_range, stage=stage, currency=currency, azure_hybrid_use_benefit=azure_hybrid_use_benefit, discount_percentage=discount_percentage, sizing_criterion=sizing_criterion) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + if assessment is not None: + body_content = self._serialize.body(assessment, 'Assessment') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Assessment', pipeline_response) + + if response.status_code == 201: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Assessment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}'} + + def delete( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + assessment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an assessment from the project. The machines remain in the assessment. Deleting a non-existent assessment results in a no-operation. + + When an assessment is under computation, as indicated by the 'computationState' field, it cannot be deleted. Any such attempt will return a 400 - Bad Request. + + Deletes an assessment from the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_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_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}'} + + def get_report_download_url( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + assessment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DownloadUrl" + """Get the URL for downloading the assessment in a report format. + + Get download URL for the assessment report. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param assessment_name: Unique name of an assessment within a project. + :type assessment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DownloadUrl or the result of cls(response) + :rtype: ~azure_migrate.models.DownloadUrl + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.DownloadUrl"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # Construct URL + url = self.get_report_download_url.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'assessmentName': self._serialize.url("assessment_name", assessment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('DownloadUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_report_download_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}/assessments/{assessmentName}/downloadUrl'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_assessment_option_operations.py b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_assessment_option_operations.py new file mode 100644 index 00000000000..7c64f7906c3 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_assessment_option_operations.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AssessmentOptionOperations(object): + """AssessmentOptionOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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, + location_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AssessmentOptionsResultList" + """Get the available options for the properties of an assessment. + + Get the assessment options. + + :param location_name: Azure region in which the project is created. + :type location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssessmentOptionsResultList or the result of cls(response) + :rtype: ~azure_migrate.models.AssessmentOptionsResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.AssessmentOptionsResultList"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + deserialized = self._deserialize('AssessmentOptionsResultList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/locations/{locationName}/assessmentOptions'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_group_operations.py b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_group_operations.py new file mode 100644 index 00000000000..05d36a7de66 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_group_operations.py @@ -0,0 +1,338 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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, List, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GroupOperations(object): + """GroupOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_project( + self, + resource_group_name, # type: str + project_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.GroupResultList" + """Get all groups created in the project. Returns a json array of objects of type 'group' as specified in the Models section. + + Get all groups. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GroupResultList or the result of cls(response) + :rtype: ~azure_migrate.models.GroupResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.GroupResultList"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_project.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('GroupResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_project.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups'} + + def get( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Group" + """Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + + Get a specific group. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Group or the result of cls(response) + :rtype: ~azure_migrate.models.Group + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Group"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Group', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}'} + + def create( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + machines, # type: List[str] + e_tag=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Group" + """Create a new group by sending a json object of type 'group' as given in Models section as part of the Request Body. The group name in a project is unique. Labels can be applied on a group as part of creation. + + If a group with the groupName specified in the URL already exists, then this call acts as an update. + + This operation is Idempotent. + + Create a new group with specified settings. If group with the name provided already exists, + then the existing group is updated. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type group_name: str + :param machines: List of machine names that are part of this group. + :type machines: list[str] + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Group or Group or the result of cls(response) + :rtype: ~azure_migrate.models.Group or ~azure_migrate.models.Group + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Group"] + error_map = kwargs.pop('error_map', {}) + + group = models.Group(e_tag=e_tag, machines=machines) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + if group is not None: + body_content = self._serialize.body(group, 'Group') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Group', pipeline_response) + + if response.status_code == 201: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Group', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}'} + + def delete( + self, + resource_group_name, # type: str + project_name, # type: str + group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the group from the project. The machines remain in the project. Deleting a non-existent group results in a no-operation. + + A group is an aggregation mechanism for machines in a project. Therefore, deleting group does not delete machines in it. + + Delete the group. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param group_name: Unique name of a group within a project. + :type 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_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/groups/{groupName}'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_location_operations.py b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_location_operations.py new file mode 100644 index 00000000000..bb829f0c3db --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_location_operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LocationOperations(object): + """LocationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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 check_name_availability( + self, + location_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameAvailabilityResult" + """Checks whether the project name is available in the specified region. + + :param location_name: The desired region for the name check. + :type location_name: str + :param name: The name to check for availability. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult or the result of cls(response) + :rtype: ~azure_migrate.models.CheckNameAvailabilityResult + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.CheckNameAvailabilityResult"] + error_map = kwargs.pop('error_map', {}) + + parameters = models.CheckNameAvailabilityParameters(name=name) + api_version = "2018-02-02" + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 models.CloudErrorException.from_response(response, self._deserialize) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/locations/{locationName}/checkNameAvailability'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_machine_operations.py b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_machine_operations.py new file mode 100644 index 00000000000..99e286f3e09 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_machine_operations.py @@ -0,0 +1,181 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MachineOperations(object): + """MachineOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_project( + self, + resource_group_name, # type: str + project_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.MachineResultList" + """Get data of all the machines available in the project. Returns a json array of objects of type 'machine' defined in Models section. + + Get all machines in the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MachineResultList or the result of cls(response) + :rtype: ~azure_migrate.models.MachineResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.MachineResultList"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_project.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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('MachineResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_project.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines'} + + def get( + self, + resource_group_name, # type: str + project_name, # type: str + machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Machine" + """Get the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + + Get a specific machine. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param machine_name: Unique name of a machine in private datacenter. + :type machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Machine or the result of cls(response) + :rtype: ~azure_migrate.models.Machine + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Machine"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + 'machineName': self._serialize.url("machine_name", machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Machine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/machines/{machineName}'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_operation_operations.py b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_operation_operations.py new file mode 100644 index 00000000000..35d19a8a49a --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_operation_operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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.OperationResultList" + """Get a list of REST API supported by Microsoft.Migrate provider. + + Get list of operations supported in the API. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultList or the result of cls(response) + :rtype: ~azure_migrate.models.OperationResultList + :raises: ~azure.core.HttpResponseError + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.OperationResultList"] + error_map = kwargs.pop('error_map', {}) + + 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 = {} + + # Construct headers + header_parameters = {} + 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('OperationResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Migrate/operations'} diff --git a/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_project_operations.py b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_project_operations.py new file mode 100644 index 00000000000..f9dbe24c565 --- /dev/null +++ b/src/migrate/azext_migrate/vendored_sdks/migrate/operations/_project_operations.py @@ -0,0 +1,545 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ProjectOperations(object): + """ProjectOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_migrate.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_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.ProjectResultList" + """Get all the projects in the subscription. + + Get all projects. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProjectResultList or the result of cls(response) + :rtype: ~azure_migrate.models.ProjectResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.ProjectResultList"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.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 = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('ProjectResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/projects'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ProjectResultList" + """Get all the projects in the resource group. + + Get all projects. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProjectResultList or the result of cls(response) + :rtype: ~azure_migrate.models.ProjectResultList + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.ProjectResultList"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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('ProjectResultList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects'} + + def get( + self, + resource_group_name, # type: str + project_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Project" + """Get the project with the specified name. + + Get the specified project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Project or the result of cls(response) + :rtype: ~azure_migrate.models.Project + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Project"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Project', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}'} + + def create( + self, + resource_group_name, # type: str + project_name, # type: str + e_tag=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional["models.ProjectTags"] + customer_workspace_id=None, # type: Optional[str] + customer_workspace_location=None, # type: Optional[str] + provisioning_state=None, # type: Optional[Union[str, "models.ProvisioningState"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Project" + """Create a project with specified name. If a project already exists, update it. + + Create or update project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :param location: Azure location in which project is created. + :type location: str + :param tags: Tags provided by Azure Tagging service. + :type tags: ~azure_migrate.models.ProjectTags + :param customer_workspace_id: ARM ID of the Service Map workspace created by user. + :type customer_workspace_id: str + :param customer_workspace_location: Location of the Service Map workspace created by user. + :type customer_workspace_location: str + :param provisioning_state: Provisioning state of the project. + :type provisioning_state: str or ~azure_migrate.models.ProvisioningState + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Project or Project or the result of cls(response) + :rtype: ~azure_migrate.models.Project or ~azure_migrate.models.Project + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Project"] + error_map = kwargs.pop('error_map', {}) + + project = models.Project(e_tag=e_tag, location=location, tags=tags, customer_workspace_id=customer_workspace_id, customer_workspace_location=customer_workspace_location, provisioning_state=provisioning_state) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + if project is not None: + body_content = self._serialize.body(project, 'Project') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Project', pipeline_response) + + if response.status_code == 201: + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Project', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}'} + + def update( + self, + resource_group_name, # type: str + project_name, # type: str + e_tag=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional["models.ProjectTags"] + customer_workspace_id=None, # type: Optional[str] + customer_workspace_location=None, # type: Optional[str] + provisioning_state=None, # type: Optional[Union[str, "models.ProvisioningState"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Project" + """Update a project with specified name. Supports partial updates, for example only tags can be provided. + + Update project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :param e_tag: For optimistic concurrency control. + :type e_tag: str + :param location: Azure location in which project is created. + :type location: str + :param tags: Tags provided by Azure Tagging service. + :type tags: ~azure_migrate.models.ProjectTags + :param customer_workspace_id: ARM ID of the Service Map workspace created by user. + :type customer_workspace_id: str + :param customer_workspace_location: Location of the Service Map workspace created by user. + :type customer_workspace_location: str + :param provisioning_state: Provisioning state of the project. + :type provisioning_state: str or ~azure_migrate.models.ProvisioningState + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Project or the result of cls(response) + :rtype: ~azure_migrate.models.Project + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Project"] + error_map = kwargs.pop('error_map', {}) + + project = models.Project(e_tag=e_tag, location=location, tags=tags, customer_workspace_id=customer_workspace_id, customer_workspace_location=customer_workspace_location, provisioning_state=provisioning_state) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + if project is not None: + body_content = self._serialize.body(project, 'Project') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + 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 models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('Project', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}'} + + def delete( + self, + resource_group_name, # type: str + project_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the project. Deleting non-existent project is a no-operation. + + Delete the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_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_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # 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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, '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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + + if cls: + return cls(pipeline_response, None, response_headers) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}'} + + def get_key( + self, + resource_group_name, # type: str + project_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ProjectKey" + """Gets the Log Analytics Workspace ID and Primary Key for the specified project. + + Get shared keys for the project. + + :param resource_group_name: Name of the Azure Resource Group that project is part of. + :type resource_group_name: str + :param project_name: Name of the Azure Migrate project. + :type project_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProjectKey or the result of cls(response) + :rtype: ~azure_migrate.models.ProjectKey + :raises: ~azure_migrate.models.CloudErrorException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.ProjectKey"] + error_map = kwargs.pop('error_map', {}) + api_version = "2018-02-02" + + # Construct URL + url = self.get_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'), + 'projectName': self._serialize.url("project_name", project_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + 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) + raise models.CloudErrorException.from_response(response, self._deserialize) + + response_headers = {} + response_headers['x-ms-request-id']=self._deserialize('str', response.headers.get('x-ms-request-id')) + deserialized = self._deserialize('ProjectKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/projects/{projectName}/keys'} diff --git a/src/migrate/report.md b/src/migrate/report.md new file mode 100644 index 00000000000..01519ea2b5a --- /dev/null +++ b/src/migrate/report.md @@ -0,0 +1,173 @@ +# Azure CLI Module Creation Report + +### migrate assessed-machine list + +list a migrate assessed-machine. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate assessed-machine show + +show a migrate assessed-machine. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate assessment create + +create a migrate assessment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--azure-location**|choice|Target Azure location for which the machines should be assessed. These enums are the same as used by Compute API.|/something/my_option|/something/myOption| +|**--azure-offer-code**|choice|Offer code according to which cost estimation is done.|/something/my_option|/something/myOption| +|**--azure-pricing-tier**|choice|Pricing tier for Size evaluation.|/something/my_option|/something/myOption| +|**--azure-storage-redundancy**|choice|Storage Redundancy type offered by Azure.|/something/my_option|/something/myOption| +|**--scaling-factor**|number|Scaling factor used over utilization data to add a performance buffer for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3.|/something/my_option|/something/myOption| +|**--percentile**|choice|Percentile of performance data used to recommend Azure size.|/something/my_option|/something/myOption| +|**--time-range**|choice|Time range of performance data used to recommend a size.|/something/my_option|/something/myOption| +|**--stage**|choice|User configurable setting that describes the status of the assessment.|/something/my_option|/something/myOption| +|**--currency**|choice|Currency to report prices in.|/something/my_option|/something/myOption| +|**--azure-hybrid-use-benefit**|choice|AHUB discount on windows virtual machines.|/something/my_option|/something/myOption| +|**--discount-percentage**|number|Custom discount percentage to be applied on final costs. Can be in the range [0, 100].|/something/my_option|/something/myOption| +|**--sizing-criterion**|choice|Assessment sizing criterion.|/something/my_option|/something/myOption| +|--assessment**|object|New or Updated Assessment object.|/something/my_option|/something/myOption| +|--e-tag**|string|For optimistic concurrency control.|/something/my_option|/something/myOption| +### migrate assessment delete + +delete a migrate assessment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate assessment get-report-download-url + +get-report-download-url a migrate assessment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate assessment list + +list a migrate assessment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate assessment show + +show a migrate assessment. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate assessment-option show + +show a migrate assessment-option. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate group create + +create a migrate group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|**--machines**|array|List of machine names that are part of this group.|/something/my_option|/something/myOption| +|--group**|object|New or Updated Group object.|/something/my_option|/something/myOption| +|--e-tag**|string|For optimistic concurrency control.|/something/my_option|/something/myOption| +### migrate group delete + +delete a migrate group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate group list + +list a migrate group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate group show + +show a migrate group. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate machine list + +list a migrate machine. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate machine show + +show a migrate machine. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate project create + +create a migrate project. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|--project**|object|New or Updated project object.|/something/my_option|/something/myOption| +|--e-tag**|string|For optimistic concurrency control.|/something/my_option|/something/myOption| +|--location**|string|Azure location in which project is created.|/something/my_option|/something/myOption| +|--tags**|object|Tags provided by Azure Tagging service.|/something/my_option|/something/myOption| +|--customer-workspace-id**|string|ARM ID of the Service Map workspace created by user.|/something/my_option|/something/myOption| +|--customer-workspace-location**|string|Location of the Service Map workspace created by user.|/something/my_option|/something/myOption| +|--provisioning-state**|choice|Provisioning state of the project.|/something/my_option|/something/myOption| +### migrate project delete + +delete a migrate project. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate project get-key + +get-key a migrate project. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate project list + +list a migrate project. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate project show + +show a migrate project. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +### migrate project update + +update a migrate project. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--api-version**|constant|Api Version|/something/my_option|/something/myOption| +|--project**|object|New or Updated project object.|/something/my_option|/something/myOption| +|--e-tag**|string|For optimistic concurrency control.|/something/my_option|/something/myOption| +|--location**|string|Azure location in which project is created.|/something/my_option|/something/myOption| +|--tags**|object|Tags provided by Azure Tagging service.|/something/my_option|/something/myOption| +|--customer-workspace-id**|string|ARM ID of the Service Map workspace created by user.|/something/my_option|/something/myOption| +|--customer-workspace-location**|string|Location of the Service Map workspace created by user.|/something/my_option|/something/myOption| +|--provisioning-state**|choice|Provisioning state of the project.|/something/my_option|/something/myOption| \ No newline at end of file diff --git a/src/migrate/setup.cfg b/src/migrate/setup.cfg new file mode 100644 index 00000000000..3c6e79cf31d --- /dev/null +++ b/src/migrate/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/migrate/setup.py b/src/migrate/setup.py new file mode 100644 index 00000000000..4d3fcef04cc --- /dev/null +++ b/src/migrate/setup.py @@ -0,0 +1,60 @@ +#!/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 +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") + +# 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.4', + 'Programming Language :: Python :: 3.5', + '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.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='migrate', + version=VERSION, + description='Microsoft Azure Command-Line Tools AzureMigrate 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_migrate': ['azext_metadata.json']}, +)