Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,33 @@
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true
"has_lro_operations": true,
"client_side_validation": true
},
"global_parameters": {
"sync_method": {
"sync": {
"credential": {
"method_signature": "credential, # type: \"TokenCredential\"",
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"signature": "subscription_id, # type: str",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"async_method": {
"async": {
"credential": {
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential, # type: \"AsyncTokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"signature": "subscription_id, # type: str",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
VERSION = "0.1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -35,7 +35,7 @@ class AzureBareMetalInstancesOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand Down Expand Up @@ -80,7 +80,7 @@ async def _start_initial(

if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down Expand Up @@ -132,7 +132,13 @@ def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})

if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str'),
}

if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
Expand Down Expand Up @@ -183,7 +189,7 @@ async def _restart_initial(

if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down Expand Up @@ -235,7 +241,13 @@ def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})

if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str'),
}

if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
Expand Down Expand Up @@ -286,7 +298,7 @@ async def _shutdown_initial(

if response.status_code not in [200, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down Expand Up @@ -338,7 +350,13 @@ def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})

if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str'),
}

if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
Expand All @@ -355,7 +373,7 @@ def get_long_running_output(pipeline_response):
def list_by_subscription(
self,
**kwargs
) -> AsyncIterable["models.AzureBareMetalInstancesListResult"]:
) -> AsyncIterable["_models.AzureBareMetalInstancesListResult"]:
"""Gets a list of Azure BareMetal instances in the specified subscription.

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns
Expand All @@ -366,7 +384,7 @@ def list_by_subscription(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~bare_metal_infrastructure_client.models.AzureBareMetalInstancesListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.AzureBareMetalInstancesListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureBareMetalInstancesListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -411,7 +429,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand All @@ -426,7 +444,7 @@ def list(
self,
resource_group_name: str,
**kwargs
) -> AsyncIterable["models.AzureBareMetalInstancesListResult"]:
) -> AsyncIterable["_models.AzureBareMetalInstancesListResult"]:
"""Gets a list of AzureBareMetal instances in the specified subscription and resource group.

:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -436,7 +454,7 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~bare_metal_infrastructure_client.models.AzureBareMetalInstancesListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.AzureBareMetalInstancesListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureBareMetalInstancesListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -482,7 +500,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand All @@ -498,7 +516,7 @@ async def get(
resource_group_name: str,
azure_bare_metal_instance_name: str,
**kwargs
) -> "models.AzureBareMetalInstance":
) -> "_models.AzureBareMetalInstance":
"""Gets an Azure BareMetal instance.

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance
Expand All @@ -513,7 +531,7 @@ async def get(
:rtype: ~bare_metal_infrastructure_client.models.AzureBareMetalInstance
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.AzureBareMetalInstance"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureBareMetalInstance"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -544,7 +562,7 @@ async def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('AzureBareMetalInstance', pipeline_response)
Expand Down Expand Up @@ -592,7 +610,7 @@ async def _delete_initial(

if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down Expand Up @@ -647,7 +665,13 @@ def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})

if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'azureBareMetalInstanceName': self._serialize.url("azure_bare_metal_instance_name", azure_bare_metal_instance_name, 'str'),
}

if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
Expand All @@ -665,9 +689,9 @@ async def update(
self,
resource_group_name: str,
azure_bare_metal_instance_name: str,
tags_parameter: "models.Tags",
tags_parameter: "_models.Tags",
**kwargs
) -> "models.AzureBareMetalInstance":
) -> "_models.AzureBareMetalInstance":
"""Patches the Tags field of a Azure BareMetal instance.

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource
Expand All @@ -684,7 +708,7 @@ async def update(
:rtype: ~bare_metal_infrastructure_client.models.AzureBareMetalInstance
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.AzureBareMetalInstance"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureBareMetalInstance"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -720,7 +744,7 @@ async def update(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('AzureBareMetalInstance', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -33,7 +33,7 @@ class Operations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -44,15 +44,15 @@ def __init__(self, client, config, serializer, deserializer) -> None:
def list(
self,
**kwargs
) -> AsyncIterable["models.OperationList"]:
) -> AsyncIterable["_models.OperationList"]:
"""Gets a list of AzureBareMetal management operations.

:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~bare_metal_infrastructure_client.models.OperationList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -93,7 +93,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@


class Resource(msrest.serialization.Model):
"""Resource.
"""Common fields that are returned in the response for all Azure Resource Manager resources.

Variables are only populated by the server, and will be ignored when sending a request.

:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or
Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
"""

Expand All @@ -48,19 +48,19 @@ def __init__(


class TrackedResource(Resource):
"""The resource model definition for a ARM tracked top level resource.
"""The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or
Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
Expand Down Expand Up @@ -99,13 +99,13 @@ class AzureBareMetalInstance(TrackedResource):

All required parameters must be populated in order to send to Azure.

:ivar id: Fully qualified resource Id for the resource. Ex -
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or
Microsoft.Storage/storageAccounts.
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:param tags: A set of tags. Resource tags.
:type tags: dict[str, str]
Expand Down
Loading