From 714a5a632646a3746931909ba15e7ebf60f44659 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 19 Dec 2018 15:29:23 -0800 Subject: [PATCH] [AutoPR imds/data-plane] Instance Metadata Service: Initial Commit (#3876) * Generated from f891877254719885c5dd1da5f8db65ea0ffec7ce Instance Metadata Service: Initial Commit Initial commit of Instance Metadata Service -Added Swagger for 2018-10-01 -Added examples for 2018-10-01 * Packaging update of azure-mgmt-imds * Generated from 5ed5488357aeea3112a442904b3c227fbc9403a7 Instance Metadata Service: Updates -Moved to imds/data-plane from imds/resource-provider * Generated from 8a09dad819f7b9e8bc609535ab247436746a1529 Instance Metadata Service: Added language .md files * Packaging update of azure-imds * Generated from 0773756e2fd45434e049d3b58ad16951bc676ca9 Instance Metadata Service: Updated ErrorResponse -Removed individual error codes from operations * Generated from cba3965b1c467f62087c54339599691391df22f6 Instance Metadata Service: Updates to Swagger -Created separate Identity error property -Updated descriptions and added them where necessary -Created parameters section and moved api-version and Metadata to it -Renamed operationIds * Generated from 630659c4d92ac8df01afeb6ad8b6c97a34efdd19 Added x-ms-parameter-location to Metadata parameter * Generated from 5873893a90ffc8198f435ef05a85286e09b00a62 -Minor property name changes -Removed previous API versions from enum * Generated from 54d9e4376b4348d480402077ae229a83c64acf8a -Fixed a typo * Generated from 2ae5a326c98e9876767b9dbdb808eb0848760d09 -Added missing descriptions * Generated from 29064076aa8c72a9b0a06dda44a65b95ad2f408f -Added more missing descriptions --- azure-imds/HISTORY.rst | 9 + azure-imds/MANIFEST.in | 3 + azure-imds/README.rst | 49 +++ azure-imds/azure/__init__.py | 1 + azure-imds/azure/imds/__init__.py | 18 + .../azure/imds/instance_metadata_client.py | 84 ++++ azure-imds/azure/imds/models/__init__.py | 70 ++++ azure-imds/azure/imds/models/attested_data.py | 33 ++ .../azure/imds/models/attested_data_py3.py | 33 ++ azure-imds/azure/imds/models/compute.py | 112 +++++ azure-imds/azure/imds/models/compute_py3.py | 112 +++++ .../azure/imds/models/error_response.py | 41 ++ .../azure/imds/models/error_response_py3.py | 41 ++ .../imds/models/identity_error_response.py | 50 +++ .../models/identity_error_response_py3.py | 50 +++ .../imds/models/identity_info_response.py | 28 ++ .../imds/models/identity_info_response_py3.py | 28 ++ .../imds/models/identity_token_response.py | 72 ++++ .../models/identity_token_response_py3.py | 72 ++++ azure-imds/azure/imds/models/instance.py | 32 ++ .../models/instance_metadata_client_enums.py | 33 ++ azure-imds/azure/imds/models/instance_py3.py | 32 ++ .../azure/imds/models/ipv4_properties.py | 34 ++ .../azure/imds/models/ipv4_properties_py3.py | 34 ++ .../azure/imds/models/ipv6_properties.py | 29 ++ .../azure/imds/models/ipv6_properties_py3.py | 29 ++ azure-imds/azure/imds/models/network.py | 28 ++ .../azure/imds/models/network_interface.py | 36 ++ .../imds/models/network_interface_ipv4.py | 32 ++ .../imds/models/network_interface_ipv4_py3.py | 32 ++ .../imds/models/network_interface_ipv6.py | 28 ++ .../imds/models/network_interface_ipv6_py3.py | 28 ++ .../imds/models/network_interface_py3.py | 36 ++ azure-imds/azure/imds/models/network_py3.py | 28 ++ .../azure/imds/models/plan_properties.py | 36 ++ .../azure/imds/models/plan_properties_py3.py | 36 ++ .../imds/models/public_keys_properties.py | 34 ++ .../imds/models/public_keys_properties_py3.py | 34 ++ .../azure/imds/models/subnet_properties.py | 32 ++ .../imds/models/subnet_properties_py3.py | 32 ++ azure-imds/azure/imds/operations/__init__.py | 20 + .../imds/operations/attested_operations.py | 109 +++++ .../imds/operations/identity_operations.py | 196 +++++++++ .../imds/operations/instances_operations.py | 104 +++++ azure-imds/azure/imds/version.py | 13 + azure-imds/sdk_packaging.toml | 8 + azure-imds/setup.cfg | 2 + azure-imds/setup.py | 86 ++++ azure-mgmt-imds/HISTORY.rst | 9 + azure-mgmt-imds/MANIFEST.in | 4 + azure-mgmt-imds/README.rst | 49 +++ azure-mgmt-imds/azure/__init__.py | 1 + azure-mgmt-imds/azure/mgmt/__init__.py | 1 + azure-mgmt-imds/azure/mgmt/imds/__init__.py | 18 + .../mgmt/imds/instance_metadata_client.py | 384 ++++++++++++++++++ .../azure/mgmt/imds/models/__init__.py | 61 +++ .../azure/mgmt/imds/models/attested.py | 33 ++ .../azure/mgmt/imds/models/attested_py3.py | 33 ++ .../azure/mgmt/imds/models/compute.py | 112 +++++ .../azure/mgmt/imds/models/compute_py3.py | 112 +++++ .../azure/mgmt/imds/models/error_response.py | 35 ++ .../mgmt/imds/models/error_response_py3.py | 35 ++ .../azure/mgmt/imds/models/info_response.py | 28 ++ .../mgmt/imds/models/info_response_py3.py | 28 ++ .../azure/mgmt/imds/models/instance.py | 32 ++ .../azure/mgmt/imds/models/instance_py3.py | 32 ++ .../azure/mgmt/imds/models/ipv4_properties.py | 34 ++ .../mgmt/imds/models/ipv4_properties_py3.py | 34 ++ .../azure/mgmt/imds/models/ipv6_properties.py | 29 ++ .../mgmt/imds/models/ipv6_properties_py3.py | 29 ++ .../azure/mgmt/imds/models/network.py | 28 ++ .../mgmt/imds/models/network_interface.py | 36 ++ .../imds/models/network_interface_ipv4.py | 32 ++ .../imds/models/network_interface_ipv4_py3.py | 32 ++ .../imds/models/network_interface_ipv6.py | 28 ++ .../imds/models/network_interface_ipv6_py3.py | 28 ++ .../mgmt/imds/models/network_interface_py3.py | 36 ++ .../azure/mgmt/imds/models/network_py3.py | 28 ++ .../azure/mgmt/imds/models/plan_properties.py | 36 ++ .../mgmt/imds/models/plan_properties_py3.py | 36 ++ .../imds/models/public_keys_properties.py | 34 ++ .../imds/models/public_keys_properties_py3.py | 34 ++ .../mgmt/imds/models/subnet_properties.py | 32 ++ .../mgmt/imds/models/subnet_properties_py3.py | 32 ++ .../azure/mgmt/imds/models/token_response.py | 72 ++++ .../mgmt/imds/models/token_response_py3.py | 72 ++++ azure-mgmt-imds/azure/mgmt/imds/version.py | 13 + azure-mgmt-imds/sdk_packaging.toml | 8 + azure-mgmt-imds/setup.cfg | 2 + azure-mgmt-imds/setup.py | 87 ++++ 90 files changed, 3958 insertions(+) create mode 100644 azure-imds/HISTORY.rst create mode 100644 azure-imds/MANIFEST.in create mode 100644 azure-imds/README.rst create mode 100644 azure-imds/azure/__init__.py create mode 100644 azure-imds/azure/imds/__init__.py create mode 100644 azure-imds/azure/imds/instance_metadata_client.py create mode 100644 azure-imds/azure/imds/models/__init__.py create mode 100644 azure-imds/azure/imds/models/attested_data.py create mode 100644 azure-imds/azure/imds/models/attested_data_py3.py create mode 100644 azure-imds/azure/imds/models/compute.py create mode 100644 azure-imds/azure/imds/models/compute_py3.py create mode 100644 azure-imds/azure/imds/models/error_response.py create mode 100644 azure-imds/azure/imds/models/error_response_py3.py create mode 100644 azure-imds/azure/imds/models/identity_error_response.py create mode 100644 azure-imds/azure/imds/models/identity_error_response_py3.py create mode 100644 azure-imds/azure/imds/models/identity_info_response.py create mode 100644 azure-imds/azure/imds/models/identity_info_response_py3.py create mode 100644 azure-imds/azure/imds/models/identity_token_response.py create mode 100644 azure-imds/azure/imds/models/identity_token_response_py3.py create mode 100644 azure-imds/azure/imds/models/instance.py create mode 100644 azure-imds/azure/imds/models/instance_metadata_client_enums.py create mode 100644 azure-imds/azure/imds/models/instance_py3.py create mode 100644 azure-imds/azure/imds/models/ipv4_properties.py create mode 100644 azure-imds/azure/imds/models/ipv4_properties_py3.py create mode 100644 azure-imds/azure/imds/models/ipv6_properties.py create mode 100644 azure-imds/azure/imds/models/ipv6_properties_py3.py create mode 100644 azure-imds/azure/imds/models/network.py create mode 100644 azure-imds/azure/imds/models/network_interface.py create mode 100644 azure-imds/azure/imds/models/network_interface_ipv4.py create mode 100644 azure-imds/azure/imds/models/network_interface_ipv4_py3.py create mode 100644 azure-imds/azure/imds/models/network_interface_ipv6.py create mode 100644 azure-imds/azure/imds/models/network_interface_ipv6_py3.py create mode 100644 azure-imds/azure/imds/models/network_interface_py3.py create mode 100644 azure-imds/azure/imds/models/network_py3.py create mode 100644 azure-imds/azure/imds/models/plan_properties.py create mode 100644 azure-imds/azure/imds/models/plan_properties_py3.py create mode 100644 azure-imds/azure/imds/models/public_keys_properties.py create mode 100644 azure-imds/azure/imds/models/public_keys_properties_py3.py create mode 100644 azure-imds/azure/imds/models/subnet_properties.py create mode 100644 azure-imds/azure/imds/models/subnet_properties_py3.py create mode 100644 azure-imds/azure/imds/operations/__init__.py create mode 100644 azure-imds/azure/imds/operations/attested_operations.py create mode 100644 azure-imds/azure/imds/operations/identity_operations.py create mode 100644 azure-imds/azure/imds/operations/instances_operations.py create mode 100644 azure-imds/azure/imds/version.py create mode 100644 azure-imds/sdk_packaging.toml create mode 100644 azure-imds/setup.cfg create mode 100644 azure-imds/setup.py create mode 100644 azure-mgmt-imds/HISTORY.rst create mode 100644 azure-mgmt-imds/MANIFEST.in create mode 100644 azure-mgmt-imds/README.rst create mode 100644 azure-mgmt-imds/azure/__init__.py create mode 100644 azure-mgmt-imds/azure/mgmt/__init__.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/__init__.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/instance_metadata_client.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/__init__.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/attested.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/attested_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/compute.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/compute_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/error_response.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/error_response_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/info_response.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/info_response_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/instance.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/instance_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/ipv4_properties.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/ipv4_properties_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/ipv6_properties.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/ipv6_properties_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/network.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/network_interface.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv4.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv4_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv6.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv6_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/network_interface_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/network_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/plan_properties.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/plan_properties_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/public_keys_properties.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/public_keys_properties_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/subnet_properties.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/subnet_properties_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/token_response.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/models/token_response_py3.py create mode 100644 azure-mgmt-imds/azure/mgmt/imds/version.py create mode 100644 azure-mgmt-imds/sdk_packaging.toml create mode 100644 azure-mgmt-imds/setup.cfg create mode 100644 azure-mgmt-imds/setup.py diff --git a/azure-imds/HISTORY.rst b/azure-imds/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-imds/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-imds/MANIFEST.in b/azure-imds/MANIFEST.in new file mode 100644 index 000000000000..73ef117329e5 --- /dev/null +++ b/azure-imds/MANIFEST.in @@ -0,0 +1,3 @@ +include *.rst +include azure/__init__.py + diff --git a/azure-imds/README.rst b/azure-imds/README.rst new file mode 100644 index 000000000000..45de4e6b43dd --- /dev/null +++ b/azure-imds/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-imds/azure/__init__.py b/azure-imds/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-imds/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-imds/azure/imds/__init__.py b/azure-imds/azure/imds/__init__.py new file mode 100644 index 000000000000..1fa037b34cea --- /dev/null +++ b/azure-imds/azure/imds/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .instance_metadata_client import InstanceMetadataClient +from .version import VERSION + +__all__ = ['InstanceMetadataClient'] + +__version__ = VERSION + diff --git a/azure-imds/azure/imds/instance_metadata_client.py b/azure-imds/azure/imds/instance_metadata_client.py new file mode 100644 index 000000000000..4c118a9deb04 --- /dev/null +++ b/azure-imds/azure/imds/instance_metadata_client.py @@ -0,0 +1,84 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.instances_operations import InstancesOperations +from .operations.attested_operations import AttestedOperations +from .operations.identity_operations import IdentityOperations +from . import models + + +class InstanceMetadataClientConfiguration(AzureConfiguration): + """Configuration for InstanceMetadataClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://169.254.169.254/metadata' + + super(InstanceMetadataClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-imds/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + + +class InstanceMetadataClient(SDKClient): + """The Azure Instance Metadata Client + + :ivar config: Configuration for client. + :vartype config: InstanceMetadataClientConfiguration + + :ivar instances: Instances operations + :vartype instances: azure.imds.operations.InstancesOperations + :ivar attested: Attested operations + :vartype attested: azure.imds.operations.AttestedOperations + :ivar identity: Identity operations + :vartype identity: azure.imds.operations.IdentityOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = InstanceMetadataClientConfiguration(credentials, base_url) + super(InstanceMetadataClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-10-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.instances = InstancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.attested = AttestedOperations( + self._client, self.config, self._serialize, self._deserialize) + self.identity = IdentityOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-imds/azure/imds/models/__init__.py b/azure-imds/azure/imds/models/__init__.py new file mode 100644 index 000000000000..aa11901b8855 --- /dev/null +++ b/azure-imds/azure/imds/models/__init__.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 .plan_properties_py3 import PlanProperties + from .public_keys_properties_py3 import PublicKeysProperties + from .compute_py3 import Compute + from .ipv4_properties_py3 import Ipv4Properties + from .subnet_properties_py3 import SubnetProperties + from .network_interface_ipv4_py3 import NetworkInterfaceIpv4 + from .ipv6_properties_py3 import Ipv6Properties + from .network_interface_ipv6_py3 import NetworkInterfaceIpv6 + from .network_interface_py3 import NetworkInterface + from .network_py3 import Network + from .instance_py3 import Instance + from .attested_data_py3 import AttestedData + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .identity_error_response_py3 import IdentityErrorResponse, IdentityErrorResponseException + from .identity_token_response_py3 import IdentityTokenResponse + from .identity_info_response_py3 import IdentityInfoResponse +except (SyntaxError, ImportError): + from .plan_properties import PlanProperties + from .public_keys_properties import PublicKeysProperties + from .compute import Compute + from .ipv4_properties import Ipv4Properties + from .subnet_properties import SubnetProperties + from .network_interface_ipv4 import NetworkInterfaceIpv4 + from .ipv6_properties import Ipv6Properties + from .network_interface_ipv6 import NetworkInterfaceIpv6 + from .network_interface import NetworkInterface + from .network import Network + from .instance import Instance + from .attested_data import AttestedData + from .error_response import ErrorResponse, ErrorResponseException + from .identity_error_response import IdentityErrorResponse, IdentityErrorResponseException + from .identity_token_response import IdentityTokenResponse + from .identity_info_response import IdentityInfoResponse +from .instance_metadata_client_enums import ( + Error, + BypassCache, +) + +__all__ = [ + 'PlanProperties', + 'PublicKeysProperties', + 'Compute', + 'Ipv4Properties', + 'SubnetProperties', + 'NetworkInterfaceIpv4', + 'Ipv6Properties', + 'NetworkInterfaceIpv6', + 'NetworkInterface', + 'Network', + 'Instance', + 'AttestedData', + 'ErrorResponse', 'ErrorResponseException', + 'IdentityErrorResponse', 'IdentityErrorResponseException', + 'IdentityTokenResponse', + 'IdentityInfoResponse', + 'Error', + 'BypassCache', +] diff --git a/azure-imds/azure/imds/models/attested_data.py b/azure-imds/azure/imds/models/attested_data.py new file mode 100644 index 000000000000..1da42f2bb93d --- /dev/null +++ b/azure-imds/azure/imds/models/attested_data.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AttestedData(Model): + """This is the response from the Attested_GetDocument operation. + + :param signature: This is the encoded string containing the VM ID, plan + information, public key, timestamp, and nonce value. + :type signature: str + :param encoding: This is the encoding scheme of the signature. + :type encoding: str + """ + + _attribute_map = { + 'signature': {'key': 'signature', 'type': 'str'}, + 'encoding': {'key': 'encoding', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AttestedData, self).__init__(**kwargs) + self.signature = kwargs.get('signature', None) + self.encoding = kwargs.get('encoding', None) diff --git a/azure-imds/azure/imds/models/attested_data_py3.py b/azure-imds/azure/imds/models/attested_data_py3.py new file mode 100644 index 000000000000..dedc15d9a6b8 --- /dev/null +++ b/azure-imds/azure/imds/models/attested_data_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AttestedData(Model): + """This is the response from the Attested_GetDocument operation. + + :param signature: This is the encoded string containing the VM ID, plan + information, public key, timestamp, and nonce value. + :type signature: str + :param encoding: This is the encoding scheme of the signature. + :type encoding: str + """ + + _attribute_map = { + 'signature': {'key': 'signature', 'type': 'str'}, + 'encoding': {'key': 'encoding', 'type': 'str'}, + } + + def __init__(self, *, signature: str=None, encoding: str=None, **kwargs) -> None: + super(AttestedData, self).__init__(**kwargs) + self.signature = signature + self.encoding = encoding diff --git a/azure-imds/azure/imds/models/compute.py b/azure-imds/azure/imds/models/compute.py new file mode 100644 index 000000000000..147819067373 --- /dev/null +++ b/azure-imds/azure/imds/models/compute.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Compute(Model): + """Compute Metadata. + + :param az_environment: This is the name of the environment in which the VM + is running. + :type az_environment: str + :param location: This is the Azure Region in which the VM is running. + :type location: str + :param name: This is the name of the VM. + :type name: str + :param offer: This is the offer information for the VM image. This value + is only present for images deployed from the Azure Image Gallery. + :type offer: str + :param os_type: This value indicates the type of OS the VM is running, + either Linux or Windows. + :type os_type: str + :param placement_group_id: This is the placement group of your Virtual + Machine Scale Set. + :type placement_group_id: str + :param plan: This contains the data about the plan. + :type plan: ~azure.imds.models.PlanProperties + :param public_keys: This is information about the SSH certificate + :type public_keys: list[~azure.imds.models.PublicKeysProperties] + :param platform_fault_domain: This is the fault domain in which the VM. + :type platform_fault_domain: str + :param platform_update_domain: This is the update domain in which the VM. + :type platform_update_domain: str + :param provider: This is the provider of the VM. + :type provider: str + :param publisher: This is the publisher of the VM image. + :type publisher: str + :param resource_group_name: This is the resource group for the VM. + :type resource_group_name: str + :param sku: This is the specific SKU for the VM image. + :type sku: str + :param subscription_id: This is the Azure subscription for the VM. + :type subscription_id: str + :param tags: This is the list of tags for your VM. + :type tags: str + :param version: This is the version of the VM image. + :type version: str + :param vm_id: This is the unique identifier for the VM. + :type vm_id: str + :param vm_scale_set_name: This is the resource name of the VMSS. + :type vm_scale_set_name: str + :param vm_size: This is the size of the VM. + :type vm_size: str + :param zone: This is the availability zone of the VM. + :type zone: str + """ + + _attribute_map = { + 'az_environment': {'key': 'azEnvironment', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'PlanProperties'}, + 'public_keys': {'key': 'publicKeys', 'type': '[PublicKeysProperties]'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'str'}, + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'vm_scale_set_name': {'key': 'vmScaleSetName', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'zone': {'key': 'zone', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Compute, self).__init__(**kwargs) + self.az_environment = kwargs.get('az_environment', None) + self.location = kwargs.get('location', None) + self.name = kwargs.get('name', None) + self.offer = kwargs.get('offer', None) + self.os_type = kwargs.get('os_type', None) + self.placement_group_id = kwargs.get('placement_group_id', None) + self.plan = kwargs.get('plan', None) + self.public_keys = kwargs.get('public_keys', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.provider = kwargs.get('provider', None) + self.publisher = kwargs.get('publisher', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.sku = kwargs.get('sku', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.tags = kwargs.get('tags', None) + self.version = kwargs.get('version', None) + self.vm_id = kwargs.get('vm_id', None) + self.vm_scale_set_name = kwargs.get('vm_scale_set_name', None) + self.vm_size = kwargs.get('vm_size', None) + self.zone = kwargs.get('zone', None) diff --git a/azure-imds/azure/imds/models/compute_py3.py b/azure-imds/azure/imds/models/compute_py3.py new file mode 100644 index 000000000000..190713ccb3b1 --- /dev/null +++ b/azure-imds/azure/imds/models/compute_py3.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Compute(Model): + """Compute Metadata. + + :param az_environment: This is the name of the environment in which the VM + is running. + :type az_environment: str + :param location: This is the Azure Region in which the VM is running. + :type location: str + :param name: This is the name of the VM. + :type name: str + :param offer: This is the offer information for the VM image. This value + is only present for images deployed from the Azure Image Gallery. + :type offer: str + :param os_type: This value indicates the type of OS the VM is running, + either Linux or Windows. + :type os_type: str + :param placement_group_id: This is the placement group of your Virtual + Machine Scale Set. + :type placement_group_id: str + :param plan: This contains the data about the plan. + :type plan: ~azure.imds.models.PlanProperties + :param public_keys: This is information about the SSH certificate + :type public_keys: list[~azure.imds.models.PublicKeysProperties] + :param platform_fault_domain: This is the fault domain in which the VM. + :type platform_fault_domain: str + :param platform_update_domain: This is the update domain in which the VM. + :type platform_update_domain: str + :param provider: This is the provider of the VM. + :type provider: str + :param publisher: This is the publisher of the VM image. + :type publisher: str + :param resource_group_name: This is the resource group for the VM. + :type resource_group_name: str + :param sku: This is the specific SKU for the VM image. + :type sku: str + :param subscription_id: This is the Azure subscription for the VM. + :type subscription_id: str + :param tags: This is the list of tags for your VM. + :type tags: str + :param version: This is the version of the VM image. + :type version: str + :param vm_id: This is the unique identifier for the VM. + :type vm_id: str + :param vm_scale_set_name: This is the resource name of the VMSS. + :type vm_scale_set_name: str + :param vm_size: This is the size of the VM. + :type vm_size: str + :param zone: This is the availability zone of the VM. + :type zone: str + """ + + _attribute_map = { + 'az_environment': {'key': 'azEnvironment', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'PlanProperties'}, + 'public_keys': {'key': 'publicKeys', 'type': '[PublicKeysProperties]'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'str'}, + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'vm_scale_set_name': {'key': 'vmScaleSetName', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'zone': {'key': 'zone', 'type': 'str'}, + } + + def __init__(self, *, az_environment: str=None, location: str=None, name: str=None, offer: str=None, os_type: str=None, placement_group_id: str=None, plan=None, public_keys=None, platform_fault_domain: str=None, platform_update_domain: str=None, provider: str=None, publisher: str=None, resource_group_name: str=None, sku: str=None, subscription_id: str=None, tags: str=None, version: str=None, vm_id: str=None, vm_scale_set_name: str=None, vm_size: str=None, zone: str=None, **kwargs) -> None: + super(Compute, self).__init__(**kwargs) + self.az_environment = az_environment + self.location = location + self.name = name + self.offer = offer + self.os_type = os_type + self.placement_group_id = placement_group_id + self.plan = plan + self.public_keys = public_keys + self.platform_fault_domain = platform_fault_domain + self.platform_update_domain = platform_update_domain + self.provider = provider + self.publisher = publisher + self.resource_group_name = resource_group_name + self.sku = sku + self.subscription_id = subscription_id + self.tags = tags + self.version = version + self.vm_id = vm_id + self.vm_scale_set_name = vm_scale_set_name + self.vm_size = vm_size + self.zone = zone diff --git a/azure-imds/azure/imds/models/error_response.py b/azure-imds/azure/imds/models/error_response.py new file mode 100644 index 000000000000..60321d55e746 --- /dev/null +++ b/azure-imds/azure/imds/models/error_response.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """This is the response from an operation in the case an error occurs. + + :param error: Error message indicating why the operation failed. + :type error: str + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-imds/azure/imds/models/error_response_py3.py b/azure-imds/azure/imds/models/error_response_py3.py new file mode 100644 index 000000000000..200a4ea62c2b --- /dev/null +++ b/azure-imds/azure/imds/models/error_response_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """This is the response from an operation in the case an error occurs. + + :param error: Error message indicating why the operation failed. + :type error: str + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'str'}, + } + + def __init__(self, *, error: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-imds/azure/imds/models/identity_error_response.py b/azure-imds/azure/imds/models/identity_error_response.py new file mode 100644 index 000000000000..a72b99031920 --- /dev/null +++ b/azure-imds/azure/imds/models/identity_error_response.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class IdentityErrorResponse(Model): + """This is the response from an Identity operation in the case an error + occurs. + + :param error: Error code. Possible values include: 'invalid_request', + 'unauthorized_client', 'access_denied', 'unsupported_response_type', + 'invalid_scope', 'server_error', 'service_unavailable', 'bad_request', + 'forbidden', 'not_found', 'method_not_allowed', 'too_many_requests' + :type error: str or ~azure.imds.models.Error + :param error_description: Error message indicating why the operation + failed. + :type error_description: str + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'str'}, + 'error_description': {'key': 'error_description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + self.error_description = kwargs.get('error_description', None) + + +class IdentityErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'IdentityErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(IdentityErrorResponseException, self).__init__(deserialize, response, 'IdentityErrorResponse', *args) diff --git a/azure-imds/azure/imds/models/identity_error_response_py3.py b/azure-imds/azure/imds/models/identity_error_response_py3.py new file mode 100644 index 000000000000..ed78a7cbac24 --- /dev/null +++ b/azure-imds/azure/imds/models/identity_error_response_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class IdentityErrorResponse(Model): + """This is the response from an Identity operation in the case an error + occurs. + + :param error: Error code. Possible values include: 'invalid_request', + 'unauthorized_client', 'access_denied', 'unsupported_response_type', + 'invalid_scope', 'server_error', 'service_unavailable', 'bad_request', + 'forbidden', 'not_found', 'method_not_allowed', 'too_many_requests' + :type error: str or ~azure.imds.models.Error + :param error_description: Error message indicating why the operation + failed. + :type error_description: str + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'str'}, + 'error_description': {'key': 'error_description', 'type': 'str'}, + } + + def __init__(self, *, error=None, error_description: str=None, **kwargs) -> None: + super(IdentityErrorResponse, self).__init__(**kwargs) + self.error = error + self.error_description = error_description + + +class IdentityErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'IdentityErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(IdentityErrorResponseException, self).__init__(deserialize, response, 'IdentityErrorResponse', *args) diff --git a/azure-imds/azure/imds/models/identity_info_response.py b/azure-imds/azure/imds/models/identity_info_response.py new file mode 100644 index 000000000000..19ec5a4183c9 --- /dev/null +++ b/azure-imds/azure/imds/models/identity_info_response.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IdentityInfoResponse(Model): + """This is the response from the Identity_GetInfo operation. + + :param tenant_id: This is the AAD tenantId of the identity of the caller. + :type tenant_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityInfoResponse, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) diff --git a/azure-imds/azure/imds/models/identity_info_response_py3.py b/azure-imds/azure/imds/models/identity_info_response_py3.py new file mode 100644 index 000000000000..dfd4630b9f91 --- /dev/null +++ b/azure-imds/azure/imds/models/identity_info_response_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IdentityInfoResponse(Model): + """This is the response from the Identity_GetInfo operation. + + :param tenant_id: This is the AAD tenantId of the identity of the caller. + :type tenant_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, **kwargs) -> None: + super(IdentityInfoResponse, self).__init__(**kwargs) + self.tenant_id = tenant_id diff --git a/azure-imds/azure/imds/models/identity_token_response.py b/azure-imds/azure/imds/models/identity_token_response.py new file mode 100644 index 000000000000..78e0ad37e482 --- /dev/null +++ b/azure-imds/azure/imds/models/identity_token_response.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IdentityTokenResponse(Model): + """This is the response from the Identity_GetToken operation. + + :param access_token: This is the requested access token. The app can use + this token to authenticate to the sink resource. + :type access_token: str + :param expires_in: This is how long the access token is valid (in + seconds). + :type expires_in: str + :param expires_on: This is the time when the access token expires. The + date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC + until the expiration time. This value is used to determine the lifetime of + cached tokens. + :type expires_on: str + :param ext_expires_in: This indicates the extended lifetime of the token. + :type ext_expires_in: str + :param not_before: This is the time when the access token becomes + effective. The date is represented as the number of seconds from + 1970-01-01T0:0:0Z UTC until the expiration time. + :type not_before: str + :param resource: This is the app ID URI of the sink resource. + :type resource: str + :param token_type: This indicates the token type value. + :type token_type: str + :param client_id: This is the client_id specified in the request, if any. + :type client_id: str + :param object_id: This is the object_id specified in the request, if any. + :type object_id: str + :param msi_res_id: This is the msi_res_id specified in the request, if + any. + :type msi_res_id: str + """ + + _attribute_map = { + 'access_token': {'key': 'access_token', 'type': 'str'}, + 'expires_in': {'key': 'expires_in', 'type': 'str'}, + 'expires_on': {'key': 'expires_on', 'type': 'str'}, + 'ext_expires_in': {'key': 'ext_expires_in', 'type': 'str'}, + 'not_before': {'key': 'not_before', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'token_type': {'key': 'token_type', 'type': 'str'}, + 'client_id': {'key': 'client_id', 'type': 'str'}, + 'object_id': {'key': 'object_id', 'type': 'str'}, + 'msi_res_id': {'key': 'msi_res_id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityTokenResponse, self).__init__(**kwargs) + self.access_token = kwargs.get('access_token', None) + self.expires_in = kwargs.get('expires_in', None) + self.expires_on = kwargs.get('expires_on', None) + self.ext_expires_in = kwargs.get('ext_expires_in', None) + self.not_before = kwargs.get('not_before', None) + self.resource = kwargs.get('resource', None) + self.token_type = kwargs.get('token_type', None) + self.client_id = kwargs.get('client_id', None) + self.object_id = kwargs.get('object_id', None) + self.msi_res_id = kwargs.get('msi_res_id', None) diff --git a/azure-imds/azure/imds/models/identity_token_response_py3.py b/azure-imds/azure/imds/models/identity_token_response_py3.py new file mode 100644 index 000000000000..feabf31b7527 --- /dev/null +++ b/azure-imds/azure/imds/models/identity_token_response_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IdentityTokenResponse(Model): + """This is the response from the Identity_GetToken operation. + + :param access_token: This is the requested access token. The app can use + this token to authenticate to the sink resource. + :type access_token: str + :param expires_in: This is how long the access token is valid (in + seconds). + :type expires_in: str + :param expires_on: This is the time when the access token expires. The + date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC + until the expiration time. This value is used to determine the lifetime of + cached tokens. + :type expires_on: str + :param ext_expires_in: This indicates the extended lifetime of the token. + :type ext_expires_in: str + :param not_before: This is the time when the access token becomes + effective. The date is represented as the number of seconds from + 1970-01-01T0:0:0Z UTC until the expiration time. + :type not_before: str + :param resource: This is the app ID URI of the sink resource. + :type resource: str + :param token_type: This indicates the token type value. + :type token_type: str + :param client_id: This is the client_id specified in the request, if any. + :type client_id: str + :param object_id: This is the object_id specified in the request, if any. + :type object_id: str + :param msi_res_id: This is the msi_res_id specified in the request, if + any. + :type msi_res_id: str + """ + + _attribute_map = { + 'access_token': {'key': 'access_token', 'type': 'str'}, + 'expires_in': {'key': 'expires_in', 'type': 'str'}, + 'expires_on': {'key': 'expires_on', 'type': 'str'}, + 'ext_expires_in': {'key': 'ext_expires_in', 'type': 'str'}, + 'not_before': {'key': 'not_before', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'token_type': {'key': 'token_type', 'type': 'str'}, + 'client_id': {'key': 'client_id', 'type': 'str'}, + 'object_id': {'key': 'object_id', 'type': 'str'}, + 'msi_res_id': {'key': 'msi_res_id', 'type': 'str'}, + } + + def __init__(self, *, access_token: str=None, expires_in: str=None, expires_on: str=None, ext_expires_in: str=None, not_before: str=None, resource: str=None, token_type: str=None, client_id: str=None, object_id: str=None, msi_res_id: str=None, **kwargs) -> None: + super(IdentityTokenResponse, self).__init__(**kwargs) + self.access_token = access_token + self.expires_in = expires_in + self.expires_on = expires_on + self.ext_expires_in = ext_expires_in + self.not_before = not_before + self.resource = resource + self.token_type = token_type + self.client_id = client_id + self.object_id = object_id + self.msi_res_id = msi_res_id diff --git a/azure-imds/azure/imds/models/instance.py b/azure-imds/azure/imds/models/instance.py new file mode 100644 index 000000000000..cfcc8be3caf2 --- /dev/null +++ b/azure-imds/azure/imds/models/instance.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Instance(Model): + """This is the response from the Instance_GetMetadata operation. + + :param compute: Compute Metadata + :type compute: ~azure.imds.models.Compute + :param network: Network Metadata + :type network: ~azure.imds.models.Network + """ + + _attribute_map = { + 'compute': {'key': 'compute', 'type': 'Compute'}, + 'network': {'key': 'network', 'type': 'Network'}, + } + + def __init__(self, **kwargs): + super(Instance, self).__init__(**kwargs) + self.compute = kwargs.get('compute', None) + self.network = kwargs.get('network', None) diff --git a/azure-imds/azure/imds/models/instance_metadata_client_enums.py b/azure-imds/azure/imds/models/instance_metadata_client_enums.py new file mode 100644 index 000000000000..5d29f6f5ca7b --- /dev/null +++ b/azure-imds/azure/imds/models/instance_metadata_client_enums.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class Error(str, Enum): + + invalid_request = "invalid_request" + unauthorized_client = "unauthorized_client" + access_denied = "access_denied" + unsupported_response_type = "unsupported_response_type" + invalid_scope = "invalid_scope" + server_error = "server_error" + service_unavailable = "service_unavailable" + bad_request = "bad_request" + forbidden = "forbidden" + not_found = "not_found" + method_not_allowed = "method_not_allowed" + too_many_requests = "too_many_requests" + + +class BypassCache(str, Enum): + + true = "true" diff --git a/azure-imds/azure/imds/models/instance_py3.py b/azure-imds/azure/imds/models/instance_py3.py new file mode 100644 index 000000000000..90776f6b6ad7 --- /dev/null +++ b/azure-imds/azure/imds/models/instance_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Instance(Model): + """This is the response from the Instance_GetMetadata operation. + + :param compute: Compute Metadata + :type compute: ~azure.imds.models.Compute + :param network: Network Metadata + :type network: ~azure.imds.models.Network + """ + + _attribute_map = { + 'compute': {'key': 'compute', 'type': 'Compute'}, + 'network': {'key': 'network', 'type': 'Network'}, + } + + def __init__(self, *, compute=None, network=None, **kwargs) -> None: + super(Instance, self).__init__(**kwargs) + self.compute = compute + self.network = network diff --git a/azure-imds/azure/imds/models/ipv4_properties.py b/azure-imds/azure/imds/models/ipv4_properties.py new file mode 100644 index 000000000000..5a0837863cc3 --- /dev/null +++ b/azure-imds/azure/imds/models/ipv4_properties.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv4Properties(Model): + """This contains the IPv4 properties. + + :param private_ip_address: This is the private IP address assigned to the + interface. + :type private_ip_address: str + :param public_ip_address: This is the public IP address assigned to the + interface. + :type public_ip_address: str + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Ipv4Properties, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.public_ip_address = kwargs.get('public_ip_address', None) diff --git a/azure-imds/azure/imds/models/ipv4_properties_py3.py b/azure-imds/azure/imds/models/ipv4_properties_py3.py new file mode 100644 index 000000000000..a5710decf4eb --- /dev/null +++ b/azure-imds/azure/imds/models/ipv4_properties_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv4Properties(Model): + """This contains the IPv4 properties. + + :param private_ip_address: This is the private IP address assigned to the + interface. + :type private_ip_address: str + :param public_ip_address: This is the public IP address assigned to the + interface. + :type public_ip_address: str + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + } + + def __init__(self, *, private_ip_address: str=None, public_ip_address: str=None, **kwargs) -> None: + super(Ipv4Properties, self).__init__(**kwargs) + self.private_ip_address = private_ip_address + self.public_ip_address = public_ip_address diff --git a/azure-imds/azure/imds/models/ipv6_properties.py b/azure-imds/azure/imds/models/ipv6_properties.py new file mode 100644 index 000000000000..42e6e62f0a85 --- /dev/null +++ b/azure-imds/azure/imds/models/ipv6_properties.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6Properties(Model): + """This contains the IPv6 properties. + + :param private_ip_address: This is the private IPv6 address assigned to + the interface. + :type private_ip_address: str + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Ipv6Properties, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) diff --git a/azure-imds/azure/imds/models/ipv6_properties_py3.py b/azure-imds/azure/imds/models/ipv6_properties_py3.py new file mode 100644 index 000000000000..9bf332fec7a7 --- /dev/null +++ b/azure-imds/azure/imds/models/ipv6_properties_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6Properties(Model): + """This contains the IPv6 properties. + + :param private_ip_address: This is the private IPv6 address assigned to + the interface. + :type private_ip_address: str + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__(self, *, private_ip_address: str=None, **kwargs) -> None: + super(Ipv6Properties, self).__init__(**kwargs) + self.private_ip_address = private_ip_address diff --git a/azure-imds/azure/imds/models/network.py b/azure-imds/azure/imds/models/network.py new file mode 100644 index 000000000000..4241f7a73e30 --- /dev/null +++ b/azure-imds/azure/imds/models/network.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Network(Model): + """Network Metadata. + + :param interface: This contains data about the network interface. + :type interface: list[~azure.imds.models.NetworkInterface] + """ + + _attribute_map = { + 'interface': {'key': 'interface', 'type': '[NetworkInterface]'}, + } + + def __init__(self, **kwargs): + super(Network, self).__init__(**kwargs) + self.interface = kwargs.get('interface', None) diff --git a/azure-imds/azure/imds/models/network_interface.py b/azure-imds/azure/imds/models/network_interface.py new file mode 100644 index 000000000000..52ce4ea3173e --- /dev/null +++ b/azure-imds/azure/imds/models/network_interface.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterface(Model): + """This contains data about the network interface. + + :param ipv4: This contains the IPv4 address. + :type ipv4: ~azure.imds.models.NetworkInterfaceIpv4 + :param ipv6: This contains the IPv6 address. + :type ipv6: ~azure.imds.models.NetworkInterfaceIpv6 + :param mac_address: This is the MAC address of the interface. + :type mac_address: str + """ + + _attribute_map = { + 'ipv4': {'key': 'ipv4', 'type': 'NetworkInterfaceIpv4'}, + 'ipv6': {'key': 'ipv6', 'type': 'NetworkInterfaceIpv6'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.ipv4 = kwargs.get('ipv4', None) + self.ipv6 = kwargs.get('ipv6', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-imds/azure/imds/models/network_interface_ipv4.py b/azure-imds/azure/imds/models/network_interface_ipv4.py new file mode 100644 index 000000000000..e206b86659f6 --- /dev/null +++ b/azure-imds/azure/imds/models/network_interface_ipv4.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceIpv4(Model): + """This contains the IPv4 address. + + :param ip_address: This is the IP address + :type ip_address: list[~azure.imds.models.Ipv4Properties] + :param subnet: This is the subnet + :type subnet: list[~azure.imds.models.SubnetProperties] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': '[Ipv4Properties]'}, + 'subnet': {'key': 'subnet', 'type': '[SubnetProperties]'}, + } + + def __init__(self, **kwargs): + super(NetworkInterfaceIpv4, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.subnet = kwargs.get('subnet', None) diff --git a/azure-imds/azure/imds/models/network_interface_ipv4_py3.py b/azure-imds/azure/imds/models/network_interface_ipv4_py3.py new file mode 100644 index 000000000000..e5f96ef5a46f --- /dev/null +++ b/azure-imds/azure/imds/models/network_interface_ipv4_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceIpv4(Model): + """This contains the IPv4 address. + + :param ip_address: This is the IP address + :type ip_address: list[~azure.imds.models.Ipv4Properties] + :param subnet: This is the subnet + :type subnet: list[~azure.imds.models.SubnetProperties] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': '[Ipv4Properties]'}, + 'subnet': {'key': 'subnet', 'type': '[SubnetProperties]'}, + } + + def __init__(self, *, ip_address=None, subnet=None, **kwargs) -> None: + super(NetworkInterfaceIpv4, self).__init__(**kwargs) + self.ip_address = ip_address + self.subnet = subnet diff --git a/azure-imds/azure/imds/models/network_interface_ipv6.py b/azure-imds/azure/imds/models/network_interface_ipv6.py new file mode 100644 index 000000000000..3671cf2c4ac2 --- /dev/null +++ b/azure-imds/azure/imds/models/network_interface_ipv6.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceIpv6(Model): + """This contains the IPv6 address. + + :param ip_address: This is the IP address + :type ip_address: list[~azure.imds.models.Ipv6Properties] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': '[Ipv6Properties]'}, + } + + def __init__(self, **kwargs): + super(NetworkInterfaceIpv6, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-imds/azure/imds/models/network_interface_ipv6_py3.py b/azure-imds/azure/imds/models/network_interface_ipv6_py3.py new file mode 100644 index 000000000000..0f24bc86d571 --- /dev/null +++ b/azure-imds/azure/imds/models/network_interface_ipv6_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceIpv6(Model): + """This contains the IPv6 address. + + :param ip_address: This is the IP address + :type ip_address: list[~azure.imds.models.Ipv6Properties] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': '[Ipv6Properties]'}, + } + + def __init__(self, *, ip_address=None, **kwargs) -> None: + super(NetworkInterfaceIpv6, self).__init__(**kwargs) + self.ip_address = ip_address diff --git a/azure-imds/azure/imds/models/network_interface_py3.py b/azure-imds/azure/imds/models/network_interface_py3.py new file mode 100644 index 000000000000..ebe4a3c62342 --- /dev/null +++ b/azure-imds/azure/imds/models/network_interface_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterface(Model): + """This contains data about the network interface. + + :param ipv4: This contains the IPv4 address. + :type ipv4: ~azure.imds.models.NetworkInterfaceIpv4 + :param ipv6: This contains the IPv6 address. + :type ipv6: ~azure.imds.models.NetworkInterfaceIpv6 + :param mac_address: This is the MAC address of the interface. + :type mac_address: str + """ + + _attribute_map = { + 'ipv4': {'key': 'ipv4', 'type': 'NetworkInterfaceIpv4'}, + 'ipv6': {'key': 'ipv6', 'type': 'NetworkInterfaceIpv6'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, ipv4=None, ipv6=None, mac_address: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(**kwargs) + self.ipv4 = ipv4 + self.ipv6 = ipv6 + self.mac_address = mac_address diff --git a/azure-imds/azure/imds/models/network_py3.py b/azure-imds/azure/imds/models/network_py3.py new file mode 100644 index 000000000000..f64cb57a83ff --- /dev/null +++ b/azure-imds/azure/imds/models/network_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Network(Model): + """Network Metadata. + + :param interface: This contains data about the network interface. + :type interface: list[~azure.imds.models.NetworkInterface] + """ + + _attribute_map = { + 'interface': {'key': 'interface', 'type': '[NetworkInterface]'}, + } + + def __init__(self, *, interface=None, **kwargs) -> None: + super(Network, self).__init__(**kwargs) + self.interface = interface diff --git a/azure-imds/azure/imds/models/plan_properties.py b/azure-imds/azure/imds/models/plan_properties.py new file mode 100644 index 000000000000..a97228fd29cf --- /dev/null +++ b/azure-imds/azure/imds/models/plan_properties.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PlanProperties(Model): + """This contains the data about the plan. + + :param name: This is the Plan ID. + :type name: str + :param publisher: This is the publisher ID. + :type publisher: str + :param product: This is the product of the image from the Marketplace. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PlanProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) diff --git a/azure-imds/azure/imds/models/plan_properties_py3.py b/azure-imds/azure/imds/models/plan_properties_py3.py new file mode 100644 index 000000000000..4b59ee1a7bf1 --- /dev/null +++ b/azure-imds/azure/imds/models/plan_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PlanProperties(Model): + """This contains the data about the plan. + + :param name: This is the Plan ID. + :type name: str + :param publisher: This is the publisher ID. + :type publisher: str + :param product: This is the product of the image from the Marketplace. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, **kwargs) -> None: + super(PlanProperties, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product diff --git a/azure-imds/azure/imds/models/public_keys_properties.py b/azure-imds/azure/imds/models/public_keys_properties.py new file mode 100644 index 000000000000..47f6293cb02a --- /dev/null +++ b/azure-imds/azure/imds/models/public_keys_properties.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicKeysProperties(Model): + """This contains the data about the public key. + + :param path: This specifies the full path on the VM where the SSH public + key is stored. + :type path: str + :param key_data: This is the SSH public key certificate used to + authenticate with the VM. + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PublicKeysProperties, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.key_data = kwargs.get('key_data', None) diff --git a/azure-imds/azure/imds/models/public_keys_properties_py3.py b/azure-imds/azure/imds/models/public_keys_properties_py3.py new file mode 100644 index 000000000000..608cc4d22441 --- /dev/null +++ b/azure-imds/azure/imds/models/public_keys_properties_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicKeysProperties(Model): + """This contains the data about the public key. + + :param path: This specifies the full path on the VM where the SSH public + key is stored. + :type path: str + :param key_data: This is the SSH public key certificate used to + authenticate with the VM. + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, key_data: str=None, **kwargs) -> None: + super(PublicKeysProperties, self).__init__(**kwargs) + self.path = path + self.key_data = key_data diff --git a/azure-imds/azure/imds/models/subnet_properties.py b/azure-imds/azure/imds/models/subnet_properties.py new file mode 100644 index 000000000000..f1a5d4746f07 --- /dev/null +++ b/azure-imds/azure/imds/models/subnet_properties.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetProperties(Model): + """This contains the properties of the subnet. + + :param address: This is the address range of the subnet. + :type address: str + :param prefix: This is the prefix of the subnet. + :type prefix: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'prefix': {'key': 'prefix', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubnetProperties, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.prefix = kwargs.get('prefix', None) diff --git a/azure-imds/azure/imds/models/subnet_properties_py3.py b/azure-imds/azure/imds/models/subnet_properties_py3.py new file mode 100644 index 000000000000..516e0160a37d --- /dev/null +++ b/azure-imds/azure/imds/models/subnet_properties_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetProperties(Model): + """This contains the properties of the subnet. + + :param address: This is the address range of the subnet. + :type address: str + :param prefix: This is the prefix of the subnet. + :type prefix: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'prefix': {'key': 'prefix', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, prefix: str=None, **kwargs) -> None: + super(SubnetProperties, self).__init__(**kwargs) + self.address = address + self.prefix = prefix diff --git a/azure-imds/azure/imds/operations/__init__.py b/azure-imds/azure/imds/operations/__init__.py new file mode 100644 index 000000000000..0523f162ec70 --- /dev/null +++ b/azure-imds/azure/imds/operations/__init__.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .instances_operations import InstancesOperations +from .attested_operations import AttestedOperations +from .identity_operations import IdentityOperations + +__all__ = [ + 'InstancesOperations', + 'AttestedOperations', + 'IdentityOperations', +] diff --git a/azure-imds/azure/imds/operations/attested_operations.py b/azure-imds/azure/imds/operations/attested_operations.py new file mode 100644 index 000000000000..d867bcbd503b --- /dev/null +++ b/azure-imds/azure/imds/operations/attested_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AttestedOperations(object): + """AttestedOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: This is the API version to use. Constant value: "2018-10-01". + :ivar metadata: This must be set to 'true'. Constant value: "true". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-01" + self.metadata = "true" + + self.config = config + + def get_document( + self, nonce=None, custom_headers=None, raw=False, **operation_config): + """Get Attested Data for the Virtual Machine. + + :param nonce: This is a string of up to 32 random alphanumeric + characters. + :type nonce: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_document.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if nonce is not None: + query_parameters['nonce'] = self._serialize.query("nonce", nonce, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['Metadata'] = self._serialize.header("self.metadata", self.metadata, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 403, 404, 405, 429, 500, 503]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AttestedData', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 405: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 503: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_document.metadata = {'url': '/attested/document'} diff --git a/azure-imds/azure/imds/operations/identity_operations.py b/azure-imds/azure/imds/operations/identity_operations.py new file mode 100644 index 000000000000..cb7d9b1d4fea --- /dev/null +++ b/azure-imds/azure/imds/operations/identity_operations.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class IdentityOperations(object): + """IdentityOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar metadata: This must be set to 'true'. Constant value: "true". + :ivar api_version: This is the API version to use. Constant value: "2018-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.metadata = "true" + self.api_version = "2018-10-01" + + self.config = config + + def get_token( + self, resource, client_id=None, object_id=None, msi_res_id=None, authority=None, bypass_cache=None, custom_headers=None, raw=False, **operation_config): + """Get a Token from Azure AD. + + :param resource: This is the urlencoded identifier URI of the sink + resource for the requested Azure AD token. The resulting token + contains the corresponding aud for this resource. + :type resource: str + :param client_id: This identifies, by Azure AD client id, a specific + explicit identity to use when authenticating to Azure AD. Mutually + exclusive with object_id and msi_res_id. + :type client_id: str + :param object_id: This identifies, by Azure AD object id, a specific + explicit identity to use when authenticating to Azure AD. Mutually + exclusive with client_id and msi_res_id. + :type object_id: str + :param msi_res_id: This identifies, by urlencoded ARM resource id, a + specific explicit identity to use when authenticating to Azure AD. + Mutually exclusive with client_id and object_id. + :type msi_res_id: str + :param authority: This indicates the authority to request AAD tokens + from. Defaults to the known authority of the identity to be used. + :type authority: str + :param bypass_cache: If provided, the value must be 'true'. This + indicates to the server that the token must be retrieved from Azure AD + and cannot be retrieved from an internal cache. Possible values + include: 'true' + :type bypass_cache: str or ~azure.imds.models.BypassCache + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`IdentityErrorResponseException` + """ + # Construct URL + url = self.get_token.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['resource'] = self._serialize.query("resource", resource, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if client_id is not None: + query_parameters['client_id'] = self._serialize.query("client_id", client_id, 'str') + if object_id is not None: + query_parameters['object_id'] = self._serialize.query("object_id", object_id, 'str') + if msi_res_id is not None: + query_parameters['msi_res_id'] = self._serialize.query("msi_res_id", msi_res_id, 'str') + if authority is not None: + query_parameters['authority'] = self._serialize.query("authority", authority, 'str') + if bypass_cache is not None: + query_parameters['bypass_cache'] = self._serialize.query("bypass_cache", bypass_cache, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['Metadata'] = self._serialize.header("self.metadata", self.metadata, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 404, 405, 429, 500]: + raise models.IdentityErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IdentityTokenResponse', response) + if response.status_code == 400: + deserialized = self._deserialize('IdentityErrorResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('IdentityErrorResponse', response) + if response.status_code == 405: + deserialized = self._deserialize('IdentityErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('IdentityErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('IdentityErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_token.metadata = {'url': '/identity/oauth2/token'} + + def get_info( + self, custom_headers=None, raw=False, **operation_config): + """Get information about AAD Metadata. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`IdentityErrorResponseException` + """ + # Construct URL + url = self.get_info.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['Metadata'] = self._serialize.header("self.metadata", self.metadata, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 404, 405, 429, 500]: + raise models.IdentityErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IdentityInfoResponse', response) + if response.status_code == 400: + deserialized = self._deserialize('IdentityErrorResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('IdentityErrorResponse', response) + if response.status_code == 405: + deserialized = self._deserialize('IdentityErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('IdentityErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('IdentityErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_info.metadata = {'url': '/identity/info'} diff --git a/azure-imds/azure/imds/operations/instances_operations.py b/azure-imds/azure/imds/operations/instances_operations.py new file mode 100644 index 000000000000..e87238eef24d --- /dev/null +++ b/azure-imds/azure/imds/operations/instances_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InstancesOperations(object): + """InstancesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: This is the API version to use. Constant value: "2018-10-01". + :ivar metadata: This must be set to 'true'. Constant value: "true". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-10-01" + self.metadata = "true" + + self.config = config + + def get_metadata( + self, custom_headers=None, raw=False, **operation_config): + """Get Instance Metadata for the Virtual Machine. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_metadata.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['Metadata'] = self._serialize.header("self.metadata", self.metadata, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 403, 404, 405, 429, 500, 503]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Instance', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 405: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 503: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_metadata.metadata = {'url': '/instance'} diff --git a/azure-imds/azure/imds/version.py b/azure-imds/azure/imds/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-imds/azure/imds/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-imds/sdk_packaging.toml b/azure-imds/sdk_packaging.toml new file mode 100644 index 000000000000..8e44431f299e --- /dev/null +++ b/azure-imds/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-imds" +package_nspkg = "azure-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-imds/setup.cfg b/azure-imds/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-imds/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-imds/setup.py b/azure-imds/setup.py new file mode 100644 index 000000000000..834520bcf361 --- /dev/null +++ b/azure-imds/setup.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-imds" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-nspkg'], + } +) diff --git a/azure-mgmt-imds/HISTORY.rst b/azure-mgmt-imds/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-imds/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-imds/MANIFEST.in b/azure-mgmt-imds/MANIFEST.in new file mode 100644 index 000000000000..6ceb27f7a96e --- /dev/null +++ b/azure-mgmt-imds/MANIFEST.in @@ -0,0 +1,4 @@ +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-imds/README.rst b/azure-mgmt-imds/README.rst new file mode 100644 index 000000000000..45de4e6b43dd --- /dev/null +++ b/azure-mgmt-imds/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-imds/azure/__init__.py b/azure-mgmt-imds/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-imds/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-imds/azure/mgmt/__init__.py b/azure-mgmt-imds/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-imds/azure/mgmt/imds/__init__.py b/azure-mgmt-imds/azure/mgmt/imds/__init__.py new file mode 100644 index 000000000000..1fa037b34cea --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .instance_metadata_client import InstanceMetadataClient +from .version import VERSION + +__all__ = ['InstanceMetadataClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-imds/azure/mgmt/imds/instance_metadata_client.py b/azure-mgmt-imds/azure/mgmt/imds/instance_metadata_client.py new file mode 100644 index 000000000000..f66290a1c94b --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/instance_metadata_client.py @@ -0,0 +1,384 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +import uuid +from . import models + + +class InstanceMetadataClientConfiguration(AzureConfiguration): + """Configuration for InstanceMetadataClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://169.254.169.254/metadata' + + super(InstanceMetadataClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-imds/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + + +class InstanceMetadataClient(SDKClient): + """The Azure Instance Metadata Client + + :ivar config: Configuration for client. + :vartype config: InstanceMetadataClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = InstanceMetadataClientConfiguration(credentials, base_url) + super(InstanceMetadataClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-10-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + + def get_instance( + self, api_version, custom_headers=None, raw=False, **operation_config): + """Get Instance Metadata for the Virtual Machine. + + :param api_version: This is the version of API to invoke. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + metadata = "true" + + # Construct URL + url = self.get_instance.metadata['url'] + + # 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' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['Metadata'] = self._serialize.header("metadata", metadata, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 403, 404, 405, 429, 500, 503]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Instance', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 405: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 503: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_instance.metadata = {'url': '/instance'} + + def get_attested( + self, api_version, nonce=None, custom_headers=None, raw=False, **operation_config): + """Get Attested Data for the Virtual Machine. + + :param api_version: This is the version of API to invoke. + :type api_version: str + :param nonce: 10-digit random number. + :type nonce: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + metadata = "true" + + # Construct URL + url = self.get_attested.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if nonce is not None: + query_parameters['nonce'] = self._serialize.query("nonce", nonce, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['Metadata'] = self._serialize.header("metadata", metadata, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 403, 404, 405, 429, 500, 503]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Attested', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 403: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 405: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 503: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_attested.metadata = {'url': '/attested/document'} + + def get_token( + self, resource, api_version, client_id=None, object_id=None, msi_res_id=None, authority=None, bypass_cache=None, custom_headers=None, raw=False, **operation_config): + """Get a Token from Azure AD. + + :param resource: This is the urlencoded identifier URI of the sink + resource for the requested Azure AD token. The resulting token + contains the corresponding aud for this resource. + :type resource: str + :param api_version: This is the API version to use. Possible values + include: '2018-02-01', '2018-04-02', '2018-10-01' + :type api_version: str + :param client_id: This identifies, by Azure AD client id, a specific + explicit identity to use when authenticating to Azure AD. Mutually + exclusive with object_id and msi_res_id. + :type client_id: str + :param object_id: This identifies, by Azure AD object id, a specific + explicit identity to use when authenticating to Azure AD. Mutually + exclusive with client_id and msi_res_id. + :type object_id: str + :param msi_res_id: This identifies, by urlencoded ARM resource id, a + specific explicit identity to use when authenticating to Azure AD. + Mutually exclusive with client_id and object_id. + :type msi_res_id: str + :param authority: This indicates the authority to request AAD tokens + from. Defaults to the known authority of the identity to be used. + :type authority: str + :param bypass_cache: If provided, the value must be 'true'. This + indicates to the server that the token must be retrieved from Azure AD + and cannot be retrieved from an internal cache. Possible values + include: 'true' + :type bypass_cache: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + metadata = "true" + + # Construct URL + url = self.get_token.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['resource'] = self._serialize.query("resource", resource, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if client_id is not None: + query_parameters['client_id'] = self._serialize.query("client_id", client_id, 'str') + if object_id is not None: + query_parameters['object_id'] = self._serialize.query("object_id", object_id, 'str') + if msi_res_id is not None: + query_parameters['msi_res_id'] = self._serialize.query("msi_res_id", msi_res_id, 'str') + if authority is not None: + query_parameters['authority'] = self._serialize.query("authority", authority, 'str') + if bypass_cache is not None: + query_parameters['bypass_cache'] = self._serialize.query("bypass_cache", bypass_cache, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['Metadata'] = self._serialize.header("metadata", metadata, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 404, 405, 429, 500]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TokenResponse', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 405: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_token.metadata = {'url': '/identity/oauth2/token'} + + def get_info( + self, api_version, custom_headers=None, raw=False, **operation_config): + """Get information about AAD Metadata. + + :param api_version: This is the API version to use. Possible values + include: '2018-02-01', '2018-04-02', '2018-10-01' + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + metadata = "true" + + # Construct URL + url = self.get_info.metadata['url'] + + # 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' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['Metadata'] = self._serialize.header("metadata", metadata, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 400, 404, 405, 429, 500]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InfoResponse', response) + if response.status_code == 400: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 405: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 429: + deserialized = self._deserialize('ErrorResponse', response) + if response.status_code == 500: + deserialized = self._deserialize('ErrorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_info.metadata = {'url': '/identity/info'} diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/__init__.py b/azure-mgmt-imds/azure/mgmt/imds/models/__init__.py new file mode 100644 index 000000000000..7652e53a16ef --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/__init__.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .plan_properties_py3 import PlanProperties + from .public_keys_properties_py3 import PublicKeysProperties + from .compute_py3 import Compute + from .ipv4_properties_py3 import Ipv4Properties + from .subnet_properties_py3 import SubnetProperties + from .network_interface_ipv4_py3 import NetworkInterfaceIpv4 + from .ipv6_properties_py3 import Ipv6Properties + from .network_interface_ipv6_py3 import NetworkInterfaceIpv6 + from .network_interface_py3 import NetworkInterface + from .network_py3 import Network + from .instance_py3 import Instance + from .attested_py3 import Attested + from .error_response_py3 import ErrorResponse + from .token_response_py3 import TokenResponse + from .info_response_py3 import InfoResponse +except (SyntaxError, ImportError): + from .plan_properties import PlanProperties + from .public_keys_properties import PublicKeysProperties + from .compute import Compute + from .ipv4_properties import Ipv4Properties + from .subnet_properties import SubnetProperties + from .network_interface_ipv4 import NetworkInterfaceIpv4 + from .ipv6_properties import Ipv6Properties + from .network_interface_ipv6 import NetworkInterfaceIpv6 + from .network_interface import NetworkInterface + from .network import Network + from .instance import Instance + from .attested import Attested + from .error_response import ErrorResponse + from .token_response import TokenResponse + from .info_response import InfoResponse + +__all__ = [ + 'PlanProperties', + 'PublicKeysProperties', + 'Compute', + 'Ipv4Properties', + 'SubnetProperties', + 'NetworkInterfaceIpv4', + 'Ipv6Properties', + 'NetworkInterfaceIpv6', + 'NetworkInterface', + 'Network', + 'Instance', + 'Attested', + 'ErrorResponse', + 'TokenResponse', + 'InfoResponse', +] diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/attested.py b/azure-mgmt-imds/azure/mgmt/imds/models/attested.py new file mode 100644 index 000000000000..d07b87bcf313 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/attested.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Attested(Model): + """Attested. + + :param signature: This is the encoded string containing the VM ID, plan + information, and nonce value. + :type signature: str + :param encoding: This is the encoding scheme of the signature. + :type encoding: str + """ + + _attribute_map = { + 'signature': {'key': 'signature', 'type': 'str'}, + 'encoding': {'key': 'encoding', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Attested, self).__init__(**kwargs) + self.signature = kwargs.get('signature', None) + self.encoding = kwargs.get('encoding', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/attested_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/attested_py3.py new file mode 100644 index 000000000000..b4511eb15c2d --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/attested_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Attested(Model): + """Attested. + + :param signature: This is the encoded string containing the VM ID, plan + information, and nonce value. + :type signature: str + :param encoding: This is the encoding scheme of the signature. + :type encoding: str + """ + + _attribute_map = { + 'signature': {'key': 'signature', 'type': 'str'}, + 'encoding': {'key': 'encoding', 'type': 'str'}, + } + + def __init__(self, *, signature: str=None, encoding: str=None, **kwargs) -> None: + super(Attested, self).__init__(**kwargs) + self.signature = signature + self.encoding = encoding diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/compute.py b/azure-mgmt-imds/azure/mgmt/imds/models/compute.py new file mode 100644 index 000000000000..3de80848a3fd --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/compute.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Compute(Model): + """Compute Metadata. + + :param az_environment: This is the name of the environment in which the VM + is running. + :type az_environment: str + :param location: This is the Azure Region in which the VM is running. + :type location: str + :param name: This is the name of the VM. + :type name: str + :param offer: This is the offer information for the VM image. This value + is only present for images deployed from the Azure Image Gallery. + :type offer: str + :param os_type: This value indicates the type of OS the VM is running, + either Linux or Windows. + :type os_type: str + :param placement_group_id: This is the placement group of your Virtual + Machine Scale Set. + :type placement_group_id: str + :param plan: + :type plan: ~azure.mgmt.imds.models.PlanProperties + :param public_keys: This is information about the SSH certificate + :type public_keys: list[~azure.mgmt.imds.models.PublicKeysProperties] + :param platform_fault_domain: This is the fault domain in which the VM. + :type platform_fault_domain: str + :param platform_update_domain: This is the update domain in which the VM. + :type platform_update_domain: str + :param provider: This is the provider of the VM. + :type provider: str + :param publisher: This is the publisher of the VM image. + :type publisher: str + :param resource_group_name: This is the resource group for the VM. + :type resource_group_name: str + :param sku: This is the specific SKU for the VM image. + :type sku: str + :param subscription_id: This is the Azure subscription for the VM. + :type subscription_id: str + :param tags: This is the list of tags for your VM. + :type tags: str + :param version: This is the version of the VM image. + :type version: str + :param vm_id: This is the unique identifier for the VM. + :type vm_id: str + :param vm_scale_set_name: This is the resource name of the VMSS. + :type vm_scale_set_name: str + :param vm_size: This is the size of the VM. + :type vm_size: str + :param zone: This is the availability zone of the VM. + :type zone: str + """ + + _attribute_map = { + 'az_environment': {'key': 'azEnvironment', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'PlanProperties'}, + 'public_keys': {'key': 'publicKeys', 'type': '[PublicKeysProperties]'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'str'}, + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'vm_scale_set_name': {'key': 'vmScaleSetName', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'zone': {'key': 'zone', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Compute, self).__init__(**kwargs) + self.az_environment = kwargs.get('az_environment', None) + self.location = kwargs.get('location', None) + self.name = kwargs.get('name', None) + self.offer = kwargs.get('offer', None) + self.os_type = kwargs.get('os_type', None) + self.placement_group_id = kwargs.get('placement_group_id', None) + self.plan = kwargs.get('plan', None) + self.public_keys = kwargs.get('public_keys', None) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.platform_update_domain = kwargs.get('platform_update_domain', None) + self.provider = kwargs.get('provider', None) + self.publisher = kwargs.get('publisher', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.sku = kwargs.get('sku', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.tags = kwargs.get('tags', None) + self.version = kwargs.get('version', None) + self.vm_id = kwargs.get('vm_id', None) + self.vm_scale_set_name = kwargs.get('vm_scale_set_name', None) + self.vm_size = kwargs.get('vm_size', None) + self.zone = kwargs.get('zone', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/compute_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/compute_py3.py new file mode 100644 index 000000000000..bdd17ede5355 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/compute_py3.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Compute(Model): + """Compute Metadata. + + :param az_environment: This is the name of the environment in which the VM + is running. + :type az_environment: str + :param location: This is the Azure Region in which the VM is running. + :type location: str + :param name: This is the name of the VM. + :type name: str + :param offer: This is the offer information for the VM image. This value + is only present for images deployed from the Azure Image Gallery. + :type offer: str + :param os_type: This value indicates the type of OS the VM is running, + either Linux or Windows. + :type os_type: str + :param placement_group_id: This is the placement group of your Virtual + Machine Scale Set. + :type placement_group_id: str + :param plan: + :type plan: ~azure.mgmt.imds.models.PlanProperties + :param public_keys: This is information about the SSH certificate + :type public_keys: list[~azure.mgmt.imds.models.PublicKeysProperties] + :param platform_fault_domain: This is the fault domain in which the VM. + :type platform_fault_domain: str + :param platform_update_domain: This is the update domain in which the VM. + :type platform_update_domain: str + :param provider: This is the provider of the VM. + :type provider: str + :param publisher: This is the publisher of the VM image. + :type publisher: str + :param resource_group_name: This is the resource group for the VM. + :type resource_group_name: str + :param sku: This is the specific SKU for the VM image. + :type sku: str + :param subscription_id: This is the Azure subscription for the VM. + :type subscription_id: str + :param tags: This is the list of tags for your VM. + :type tags: str + :param version: This is the version of the VM image. + :type version: str + :param vm_id: This is the unique identifier for the VM. + :type vm_id: str + :param vm_scale_set_name: This is the resource name of the VMSS. + :type vm_scale_set_name: str + :param vm_size: This is the size of the VM. + :type vm_size: str + :param zone: This is the availability zone of the VM. + :type zone: str + """ + + _attribute_map = { + 'az_environment': {'key': 'azEnvironment', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'PlanProperties'}, + 'public_keys': {'key': 'publicKeys', 'type': '[PublicKeysProperties]'}, + 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'str'}, + 'platform_update_domain': {'key': 'platformUpdateDomain', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'vm_scale_set_name': {'key': 'vmScaleSetName', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'zone': {'key': 'zone', 'type': 'str'}, + } + + def __init__(self, *, az_environment: str=None, location: str=None, name: str=None, offer: str=None, os_type: str=None, placement_group_id: str=None, plan=None, public_keys=None, platform_fault_domain: str=None, platform_update_domain: str=None, provider: str=None, publisher: str=None, resource_group_name: str=None, sku: str=None, subscription_id: str=None, tags: str=None, version: str=None, vm_id: str=None, vm_scale_set_name: str=None, vm_size: str=None, zone: str=None, **kwargs) -> None: + super(Compute, self).__init__(**kwargs) + self.az_environment = az_environment + self.location = location + self.name = name + self.offer = offer + self.os_type = os_type + self.placement_group_id = placement_group_id + self.plan = plan + self.public_keys = public_keys + self.platform_fault_domain = platform_fault_domain + self.platform_update_domain = platform_update_domain + self.provider = provider + self.publisher = publisher + self.resource_group_name = resource_group_name + self.sku = sku + self.subscription_id = subscription_id + self.tags = tags + self.version = version + self.vm_id = vm_id + self.vm_scale_set_name = vm_scale_set_name + self.vm_size = vm_size + self.zone = zone diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/error_response.py b/azure-mgmt-imds/azure/mgmt/imds/models/error_response.py new file mode 100644 index 000000000000..5c158512088a --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/error_response.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorResponse(Model): + """ErrorResponse. + + :param error: Error code. Possible values include: 'invalid_request', + 'unauthorize_client', 'access_denied', 'unsupported_response_type', + 'invalid_scope', 'server_error', 'service_unavailable', 'bad_request', + 'forbidden', 'not_found', 'method_not_allowed', 'too_many_requests' + :type error: str or ~azure.mgmt.imds.models.enum + :param error_description: Error description + :type error_description: str + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'str'}, + 'error_description': {'key': 'error_description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + self.error_description = kwargs.get('error_description', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/error_response_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/error_response_py3.py new file mode 100644 index 000000000000..a2a2ba08beca --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/error_response_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorResponse(Model): + """ErrorResponse. + + :param error: Error code. Possible values include: 'invalid_request', + 'unauthorize_client', 'access_denied', 'unsupported_response_type', + 'invalid_scope', 'server_error', 'service_unavailable', 'bad_request', + 'forbidden', 'not_found', 'method_not_allowed', 'too_many_requests' + :type error: str or ~azure.mgmt.imds.models.enum + :param error_description: Error description + :type error_description: str + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'str'}, + 'error_description': {'key': 'error_description', 'type': 'str'}, + } + + def __init__(self, *, error=None, error_description: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + self.error_description = error_description diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/info_response.py b/azure-mgmt-imds/azure/mgmt/imds/models/info_response.py new file mode 100644 index 000000000000..3a321310bc2f --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/info_response.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InfoResponse(Model): + """InfoResponse. + + :param tenant_id: This is the AAD tenantId of the identity of the caller. + :type tenant_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InfoResponse, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/info_response_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/info_response_py3.py new file mode 100644 index 000000000000..cee71a9689f8 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/info_response_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InfoResponse(Model): + """InfoResponse. + + :param tenant_id: This is the AAD tenantId of the identity of the caller. + :type tenant_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, **kwargs) -> None: + super(InfoResponse, self).__init__(**kwargs) + self.tenant_id = tenant_id diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/instance.py b/azure-mgmt-imds/azure/mgmt/imds/models/instance.py new file mode 100644 index 000000000000..1dd3d94d4174 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/instance.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Instance(Model): + """Instance. + + :param compute: Compute Metadata + :type compute: ~azure.mgmt.imds.models.Compute + :param network: Network Metadata + :type network: ~azure.mgmt.imds.models.Network + """ + + _attribute_map = { + 'compute': {'key': 'compute', 'type': 'Compute'}, + 'network': {'key': 'network', 'type': 'Network'}, + } + + def __init__(self, **kwargs): + super(Instance, self).__init__(**kwargs) + self.compute = kwargs.get('compute', None) + self.network = kwargs.get('network', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/instance_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/instance_py3.py new file mode 100644 index 000000000000..2f8fa174b8f1 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/instance_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Instance(Model): + """Instance. + + :param compute: Compute Metadata + :type compute: ~azure.mgmt.imds.models.Compute + :param network: Network Metadata + :type network: ~azure.mgmt.imds.models.Network + """ + + _attribute_map = { + 'compute': {'key': 'compute', 'type': 'Compute'}, + 'network': {'key': 'network', 'type': 'Network'}, + } + + def __init__(self, *, compute=None, network=None, **kwargs) -> None: + super(Instance, self).__init__(**kwargs) + self.compute = compute + self.network = network diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/ipv4_properties.py b/azure-mgmt-imds/azure/mgmt/imds/models/ipv4_properties.py new file mode 100644 index 000000000000..838a374a3ebe --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/ipv4_properties.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv4Properties(Model): + """Ipv4Properties. + + :param private_ip_address: This is the private IP address assigned to the + interface. + :type private_ip_address: str + :param public_ip_address: This is the public IP address assigned to the + interface. + :type public_ip_address: str + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Ipv4Properties, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.public_ip_address = kwargs.get('public_ip_address', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/ipv4_properties_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/ipv4_properties_py3.py new file mode 100644 index 000000000000..c146f5a00852 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/ipv4_properties_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv4Properties(Model): + """Ipv4Properties. + + :param private_ip_address: This is the private IP address assigned to the + interface. + :type private_ip_address: str + :param public_ip_address: This is the public IP address assigned to the + interface. + :type public_ip_address: str + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + } + + def __init__(self, *, private_ip_address: str=None, public_ip_address: str=None, **kwargs) -> None: + super(Ipv4Properties, self).__init__(**kwargs) + self.private_ip_address = private_ip_address + self.public_ip_address = public_ip_address diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/ipv6_properties.py b/azure-mgmt-imds/azure/mgmt/imds/models/ipv6_properties.py new file mode 100644 index 000000000000..3e4ea38d0210 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/ipv6_properties.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6Properties(Model): + """Ipv6Properties. + + :param private_ip_address: This is the private IPV6 address assigned to + the interface. + :type private_ip_address: str + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Ipv6Properties, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/ipv6_properties_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/ipv6_properties_py3.py new file mode 100644 index 000000000000..ecf87ecf42d5 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/ipv6_properties_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6Properties(Model): + """Ipv6Properties. + + :param private_ip_address: This is the private IPV6 address assigned to + the interface. + :type private_ip_address: str + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__(self, *, private_ip_address: str=None, **kwargs) -> None: + super(Ipv6Properties, self).__init__(**kwargs) + self.private_ip_address = private_ip_address diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/network.py b/azure-mgmt-imds/azure/mgmt/imds/models/network.py new file mode 100644 index 000000000000..67d843b6745d --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/network.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Network(Model): + """Network Metadata. + + :param interface: + :type interface: list[~azure.mgmt.imds.models.NetworkInterface] + """ + + _attribute_map = { + 'interface': {'key': 'interface', 'type': '[NetworkInterface]'}, + } + + def __init__(self, **kwargs): + super(Network, self).__init__(**kwargs) + self.interface = kwargs.get('interface', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/network_interface.py b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface.py new file mode 100644 index 000000000000..37cb30b0d7cf --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterface(Model): + """NetworkInterface. + + :param ipv4: + :type ipv4: ~azure.mgmt.imds.models.NetworkInterfaceIpv4 + :param ipv6: + :type ipv6: ~azure.mgmt.imds.models.NetworkInterfaceIpv6 + :param mac_address: This is the MAC address of the interface. + :type mac_address: str + """ + + _attribute_map = { + 'ipv4': {'key': 'ipv4', 'type': 'NetworkInterfaceIpv4'}, + 'ipv6': {'key': 'ipv6', 'type': 'NetworkInterfaceIpv6'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.ipv4 = kwargs.get('ipv4', None) + self.ipv6 = kwargs.get('ipv6', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv4.py b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv4.py new file mode 100644 index 000000000000..0761f7251412 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv4.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceIpv4(Model): + """NetworkInterfaceIpv4. + + :param ip_address: + :type ip_address: list[~azure.mgmt.imds.models.Ipv4Properties] + :param subnet: + :type subnet: list[~azure.mgmt.imds.models.SubnetProperties] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': '[Ipv4Properties]'}, + 'subnet': {'key': 'subnet', 'type': '[SubnetProperties]'}, + } + + def __init__(self, **kwargs): + super(NetworkInterfaceIpv4, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.subnet = kwargs.get('subnet', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv4_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv4_py3.py new file mode 100644 index 000000000000..76e0461d762c --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv4_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceIpv4(Model): + """NetworkInterfaceIpv4. + + :param ip_address: + :type ip_address: list[~azure.mgmt.imds.models.Ipv4Properties] + :param subnet: + :type subnet: list[~azure.mgmt.imds.models.SubnetProperties] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': '[Ipv4Properties]'}, + 'subnet': {'key': 'subnet', 'type': '[SubnetProperties]'}, + } + + def __init__(self, *, ip_address=None, subnet=None, **kwargs) -> None: + super(NetworkInterfaceIpv4, self).__init__(**kwargs) + self.ip_address = ip_address + self.subnet = subnet diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv6.py b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv6.py new file mode 100644 index 000000000000..950af82e03a0 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv6.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceIpv6(Model): + """NetworkInterfaceIpv6. + + :param ip_address: + :type ip_address: list[~azure.mgmt.imds.models.Ipv6Properties] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': '[Ipv6Properties]'}, + } + + def __init__(self, **kwargs): + super(NetworkInterfaceIpv6, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv6_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv6_py3.py new file mode 100644 index 000000000000..2056eba357e1 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_ipv6_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceIpv6(Model): + """NetworkInterfaceIpv6. + + :param ip_address: + :type ip_address: list[~azure.mgmt.imds.models.Ipv6Properties] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': '[Ipv6Properties]'}, + } + + def __init__(self, *, ip_address=None, **kwargs) -> None: + super(NetworkInterfaceIpv6, self).__init__(**kwargs) + self.ip_address = ip_address diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_py3.py new file mode 100644 index 000000000000..2642a4eeb6ee --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/network_interface_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterface(Model): + """NetworkInterface. + + :param ipv4: + :type ipv4: ~azure.mgmt.imds.models.NetworkInterfaceIpv4 + :param ipv6: + :type ipv6: ~azure.mgmt.imds.models.NetworkInterfaceIpv6 + :param mac_address: This is the MAC address of the interface. + :type mac_address: str + """ + + _attribute_map = { + 'ipv4': {'key': 'ipv4', 'type': 'NetworkInterfaceIpv4'}, + 'ipv6': {'key': 'ipv6', 'type': 'NetworkInterfaceIpv6'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, ipv4=None, ipv6=None, mac_address: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(**kwargs) + self.ipv4 = ipv4 + self.ipv6 = ipv6 + self.mac_address = mac_address diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/network_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/network_py3.py new file mode 100644 index 000000000000..dc07408f8b53 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/network_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Network(Model): + """Network Metadata. + + :param interface: + :type interface: list[~azure.mgmt.imds.models.NetworkInterface] + """ + + _attribute_map = { + 'interface': {'key': 'interface', 'type': '[NetworkInterface]'}, + } + + def __init__(self, *, interface=None, **kwargs) -> None: + super(Network, self).__init__(**kwargs) + self.interface = interface diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/plan_properties.py b/azure-mgmt-imds/azure/mgmt/imds/models/plan_properties.py new file mode 100644 index 000000000000..d976ea5595db --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/plan_properties.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PlanProperties(Model): + """PlanProperties. + + :param name: This is the Plan ID. + :type name: str + :param publisher: This is the publisher ID. + :type publisher: str + :param product: This is the product of the image from the Marketplace. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PlanProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/plan_properties_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/plan_properties_py3.py new file mode 100644 index 000000000000..facae37c5b3a --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/plan_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PlanProperties(Model): + """PlanProperties. + + :param name: This is the Plan ID. + :type name: str + :param publisher: This is the publisher ID. + :type publisher: str + :param product: This is the product of the image from the Marketplace. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, product: str=None, **kwargs) -> None: + super(PlanProperties, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/public_keys_properties.py b/azure-mgmt-imds/azure/mgmt/imds/models/public_keys_properties.py new file mode 100644 index 000000000000..b981f7d36612 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/public_keys_properties.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicKeysProperties(Model): + """PublicKeysProperties. + + :param path: This specifies the full path on the VM where the SSH public + key is stored. + :type path: str + :param key_data: This is the SSH public key certificate used to + authenticate with the VM. + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PublicKeysProperties, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.key_data = kwargs.get('key_data', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/public_keys_properties_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/public_keys_properties_py3.py new file mode 100644 index 000000000000..b8885c48f12b --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/public_keys_properties_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicKeysProperties(Model): + """PublicKeysProperties. + + :param path: This specifies the full path on the VM where the SSH public + key is stored. + :type path: str + :param key_data: This is the SSH public key certificate used to + authenticate with the VM. + :type key_data: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__(self, *, path: str=None, key_data: str=None, **kwargs) -> None: + super(PublicKeysProperties, self).__init__(**kwargs) + self.path = path + self.key_data = key_data diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/subnet_properties.py b/azure-mgmt-imds/azure/mgmt/imds/models/subnet_properties.py new file mode 100644 index 000000000000..2492c40cec5c --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/subnet_properties.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetProperties(Model): + """SubnetProperties. + + :param address: This is the address range of the subnet. + :type address: str + :param prefix: This is the prefix of the subnet. + :type prefix: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'prefix': {'key': 'prefix', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubnetProperties, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.prefix = kwargs.get('prefix', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/subnet_properties_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/subnet_properties_py3.py new file mode 100644 index 000000000000..e5291042695c --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/subnet_properties_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetProperties(Model): + """SubnetProperties. + + :param address: This is the address range of the subnet. + :type address: str + :param prefix: This is the prefix of the subnet. + :type prefix: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'prefix': {'key': 'prefix', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, prefix: str=None, **kwargs) -> None: + super(SubnetProperties, self).__init__(**kwargs) + self.address = address + self.prefix = prefix diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/token_response.py b/azure-mgmt-imds/azure/mgmt/imds/models/token_response.py new file mode 100644 index 000000000000..6a784a4d2e0e --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/token_response.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TokenResponse(Model): + """TokenResponse. + + :param access_token: This is the requested access token. The app can use + this token to authenticate to the sink resource. + :type access_token: str + :param expires_in: This is how long the access token is valid (in + seconds). + :type expires_in: str + :param expires_on: This is the time when the access token expires. The + date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC + until the expiration time. This value is used to determine the lifetime of + cached tokens. + :type expires_on: str + :param ext_expires_in: This indicates the extended lifetime of the token. + :type ext_expires_in: str + :param not_before: This is the time when the access token becomes + effective. The date is represented as the number of seconds from + 1970-01-01T0:0:0Z UTC until the expiration time. + :type not_before: str + :param resource: This is the app ID URI of the sink resource. + :type resource: str + :param token_type: This indicates the token type value. + :type token_type: str + :param client_id: This is the client_id specified in the request, if any. + :type client_id: str + :param object_id: This is the object_id specified in the request, if any. + :type object_id: str + :param msi_res_id: This is the msi_res_id specified in the request, if + any. + :type msi_res_id: str + """ + + _attribute_map = { + 'access_token': {'key': 'access_token', 'type': 'str'}, + 'expires_in': {'key': 'expires_in', 'type': 'str'}, + 'expires_on': {'key': 'expires_on', 'type': 'str'}, + 'ext_expires_in': {'key': 'ext_expires_in', 'type': 'str'}, + 'not_before': {'key': 'not_before', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'token_type': {'key': 'token_type', 'type': 'str'}, + 'client_id': {'key': 'client_id', 'type': 'str'}, + 'object_id': {'key': 'object_id', 'type': 'str'}, + 'msi_res_id': {'key': 'msi_res_id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TokenResponse, self).__init__(**kwargs) + self.access_token = kwargs.get('access_token', None) + self.expires_in = kwargs.get('expires_in', None) + self.expires_on = kwargs.get('expires_on', None) + self.ext_expires_in = kwargs.get('ext_expires_in', None) + self.not_before = kwargs.get('not_before', None) + self.resource = kwargs.get('resource', None) + self.token_type = kwargs.get('token_type', None) + self.client_id = kwargs.get('client_id', None) + self.object_id = kwargs.get('object_id', None) + self.msi_res_id = kwargs.get('msi_res_id', None) diff --git a/azure-mgmt-imds/azure/mgmt/imds/models/token_response_py3.py b/azure-mgmt-imds/azure/mgmt/imds/models/token_response_py3.py new file mode 100644 index 000000000000..01762a7c7223 --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/models/token_response_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TokenResponse(Model): + """TokenResponse. + + :param access_token: This is the requested access token. The app can use + this token to authenticate to the sink resource. + :type access_token: str + :param expires_in: This is how long the access token is valid (in + seconds). + :type expires_in: str + :param expires_on: This is the time when the access token expires. The + date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC + until the expiration time. This value is used to determine the lifetime of + cached tokens. + :type expires_on: str + :param ext_expires_in: This indicates the extended lifetime of the token. + :type ext_expires_in: str + :param not_before: This is the time when the access token becomes + effective. The date is represented as the number of seconds from + 1970-01-01T0:0:0Z UTC until the expiration time. + :type not_before: str + :param resource: This is the app ID URI of the sink resource. + :type resource: str + :param token_type: This indicates the token type value. + :type token_type: str + :param client_id: This is the client_id specified in the request, if any. + :type client_id: str + :param object_id: This is the object_id specified in the request, if any. + :type object_id: str + :param msi_res_id: This is the msi_res_id specified in the request, if + any. + :type msi_res_id: str + """ + + _attribute_map = { + 'access_token': {'key': 'access_token', 'type': 'str'}, + 'expires_in': {'key': 'expires_in', 'type': 'str'}, + 'expires_on': {'key': 'expires_on', 'type': 'str'}, + 'ext_expires_in': {'key': 'ext_expires_in', 'type': 'str'}, + 'not_before': {'key': 'not_before', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'token_type': {'key': 'token_type', 'type': 'str'}, + 'client_id': {'key': 'client_id', 'type': 'str'}, + 'object_id': {'key': 'object_id', 'type': 'str'}, + 'msi_res_id': {'key': 'msi_res_id', 'type': 'str'}, + } + + def __init__(self, *, access_token: str=None, expires_in: str=None, expires_on: str=None, ext_expires_in: str=None, not_before: str=None, resource: str=None, token_type: str=None, client_id: str=None, object_id: str=None, msi_res_id: str=None, **kwargs) -> None: + super(TokenResponse, self).__init__(**kwargs) + self.access_token = access_token + self.expires_in = expires_in + self.expires_on = expires_on + self.ext_expires_in = ext_expires_in + self.not_before = not_before + self.resource = resource + self.token_type = token_type + self.client_id = client_id + self.object_id = object_id + self.msi_res_id = msi_res_id diff --git a/azure-mgmt-imds/azure/mgmt/imds/version.py b/azure-mgmt-imds/azure/mgmt/imds/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-imds/azure/mgmt/imds/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-mgmt-imds/sdk_packaging.toml b/azure-mgmt-imds/sdk_packaging.toml new file mode 100644 index 000000000000..8febe5d7f966 --- /dev/null +++ b/azure-mgmt-imds/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-imds" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-imds/setup.cfg b/azure-mgmt-imds/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-imds/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-imds/setup.py b/azure-mgmt-imds/setup.py new file mode 100644 index 000000000000..3ac10327e893 --- /dev/null +++ b/azure-mgmt-imds/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-imds" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)