Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-imds] Correcting azure-arm to be false #4194

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions sdk/azure-imds/azure/imds/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._configuration import InstanceMetadataClientConfiguration
from ._instance_metadata_client import InstanceMetadataClient
__all__ = ['InstanceMetadataClient', 'InstanceMetadataClientConfiguration']

from .version import VERSION

__version__ = VERSION

43 changes: 43 additions & 0 deletions sdk/azure-imds/azure/imds/_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrestazure import AzureConfiguration

from .version import VERSION


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<msrestazure.azure_active_directory>`
: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)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-imds/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
57 changes: 57 additions & 0 deletions sdk/azure-imds/azure/imds/_instance_metadata_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import InstanceMetadataClientConfiguration
from .operations import InstancesOperations
from .operations import AttestedOperations
from .operations import IdentityOperations
from . import models


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<msrestazure.azure_active_directory>`
: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 = '2019-02-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)
70 changes: 70 additions & 0 deletions sdk/azure-imds/azure/imds/models/__init__.py
Original file line number Diff line number Diff line change
@@ -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 ._models_py3 import AttestedData
from ._models_py3 import Compute
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import IdentityErrorResponse, IdentityErrorResponseException
from ._models_py3 import IdentityInfoResponse
from ._models_py3 import IdentityTokenResponse
from ._models_py3 import Instance
from ._models_py3 import Ipv4Properties
from ._models_py3 import Ipv6Properties
from ._models_py3 import Network
from ._models_py3 import NetworkInterface
from ._models_py3 import NetworkInterfaceIpv4
from ._models_py3 import NetworkInterfaceIpv6
from ._models_py3 import PlanProperties
from ._models_py3 import PublicKeysProperties
from ._models_py3 import SubnetProperties
except (SyntaxError, ImportError):
from ._models import AttestedData
from ._models import Compute
from ._models import ErrorResponse, ErrorResponseException
from ._models import IdentityErrorResponse, IdentityErrorResponseException
from ._models import IdentityInfoResponse
from ._models import IdentityTokenResponse
from ._models import Instance
from ._models import Ipv4Properties
from ._models import Ipv6Properties
from ._models import Network
from ._models import NetworkInterface
from ._models import NetworkInterfaceIpv4
from ._models import NetworkInterfaceIpv6
from ._models import PlanProperties
from ._models import PublicKeysProperties
from ._models import SubnetProperties
from ._instance_metadata_client_enums import (
Error,
BypassCache,
)

__all__ = [
'AttestedData',
'Compute',
'ErrorResponse', 'ErrorResponseException',
'IdentityErrorResponse', 'IdentityErrorResponseException',
'IdentityInfoResponse',
'IdentityTokenResponse',
'Instance',
'Ipv4Properties',
'Ipv6Properties',
'Network',
'NetworkInterface',
'NetworkInterfaceIpv4',
'NetworkInterfaceIpv6',
'PlanProperties',
'PublicKeysProperties',
'SubnetProperties',
'Error',
'BypassCache',
]
Original file line number Diff line number Diff line change
@@ -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"
Loading