Skip to content

Commit

Permalink
GA containerinstance (#15538)
Browse files Browse the repository at this point in the history
  • Loading branch information
00Kai0 authored Nov 25, 2020
1 parent efb2ade commit 9b5fa8c
Show file tree
Hide file tree
Showing 11 changed files with 359 additions and 238 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Release History

## 7.0.0 (2020-11-25)

## 7.0.0b1 (2020-10-12)

This is beta preview version.
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 = "7.0.0b1"
VERSION = "7.0.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 ContainerGroupsOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
def list(
self,
**kwargs
) -> AsyncIterable["models.ContainerGroupListResult"]:
) -> AsyncIterable["_models.ContainerGroupListResult"]:
"""Get a list of container groups in the specified subscription.
Get a list of container groups in the specified subscription. This operation returns properties
Expand All @@ -58,7 +58,7 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerGroupListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerGroupListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -117,7 +117,7 @@ def list_by_resource_group(
self,
resource_group_name: str,
**kwargs
) -> AsyncIterable["models.ContainerGroupListResult"]:
) -> AsyncIterable["_models.ContainerGroupListResult"]:
"""Get a list of container groups in the specified subscription and resource group.
Get a list of container groups in a specified subscription and resource group. This operation
Expand All @@ -131,7 +131,7 @@ def list_by_resource_group(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.ContainerGroupListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerGroupListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerGroupListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -192,7 +192,7 @@ async def get(
resource_group_name: str,
container_group_name: str,
**kwargs
) -> "models.ContainerGroup":
) -> "_models.ContainerGroup":
"""Get the properties of the specified container group.
Gets the properties of the specified container group in the specified subscription and resource
Expand All @@ -208,7 +208,7 @@ async def get(
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroup
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerGroup"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerGroup"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -253,10 +253,10 @@ async def _create_or_update_initial(
self,
resource_group_name: str,
container_group_name: str,
container_group: "models.ContainerGroup",
container_group: "_models.ContainerGroup",
**kwargs
) -> "models.ContainerGroup":
cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerGroup"]
) -> "_models.ContainerGroup":
cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerGroup"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -310,9 +310,9 @@ async def begin_create_or_update(
self,
resource_group_name: str,
container_group_name: str,
container_group: "models.ContainerGroup",
container_group: "_models.ContainerGroup",
**kwargs
) -> AsyncLROPoller["models.ContainerGroup"]:
) -> AsyncLROPoller["_models.ContainerGroup"]:
"""Create or update container groups.
Create or update container groups with specified configurations.
Expand All @@ -334,7 +334,7 @@ async def begin_create_or_update(
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerGroup"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerGroup"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
Expand All @@ -359,7 +359,13 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, deserialized, {})
return deserialized

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'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'containerGroupName': self._serialize.url("container_group_name", container_group_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 @@ -377,9 +383,9 @@ async def update(
self,
resource_group_name: str,
container_group_name: str,
resource: "models.Resource",
resource: "_models.Resource",
**kwargs
) -> "models.ContainerGroup":
) -> "_models.ContainerGroup":
"""Update container groups.
Updates container group tags with specified values.
Expand All @@ -395,7 +401,7 @@ async def update(
:rtype: ~azure.mgmt.containerinstance.models.ContainerGroup
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerGroup"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerGroup"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -446,8 +452,8 @@ async def _delete_initial(
resource_group_name: str,
container_group_name: str,
**kwargs
) -> Optional["models.ContainerGroup"]:
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ContainerGroup"]]
) -> Optional["_models.ContainerGroup"]:
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContainerGroup"]]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -495,7 +501,7 @@ async def begin_delete(
resource_group_name: str,
container_group_name: str,
**kwargs
) -> AsyncLROPoller["models.ContainerGroup"]:
) -> AsyncLROPoller["_models.ContainerGroup"]:
"""Delete the specified container group.
Delete the specified container group in the specified subscription and resource group. The
Expand All @@ -516,7 +522,7 @@ async def begin_delete(
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerGroup"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerGroup"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
Expand All @@ -540,7 +546,13 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, deserialized, {})
return deserialized

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'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'containerGroupName': self._serialize.url("container_group_name", container_group_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 @@ -645,7 +657,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'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'containerGroupName': self._serialize.url("container_group_name", container_group_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 @@ -808,7 +826,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'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'containerGroupName': self._serialize.url("container_group_name", container_group_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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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 @@ -32,7 +32,7 @@ class ContainersOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -47,7 +47,7 @@ async def list_logs(
container_name: str,
tail: Optional[int] = None,
**kwargs
) -> "models.Logs":
) -> "_models.Logs":
"""Get the logs for a specified container instance.
Get the logs for a specified container instance in a specified resource group and container
Expand All @@ -67,7 +67,7 @@ async def list_logs(
:rtype: ~azure.mgmt.containerinstance.models.Logs
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.Logs"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.Logs"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -116,9 +116,9 @@ async def execute_command(
resource_group_name: str,
container_group_name: str,
container_name: str,
container_exec_request: "models.ContainerExecRequest",
container_exec_request: "_models.ContainerExecRequest",
**kwargs
) -> "models.ContainerExecResponse":
) -> "_models.ContainerExecResponse":
"""Executes a command in a specific container instance.
Executes a command for a specific container instance in a specified resource group and
Expand All @@ -137,7 +137,7 @@ async def execute_command(
:rtype: ~azure.mgmt.containerinstance.models.ContainerExecResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerExecResponse"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerExecResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
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 LocationOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -45,7 +45,7 @@ def list_usage(
self,
location: str,
**kwargs
) -> AsyncIterable["models.UsageListResult"]:
) -> AsyncIterable["_models.UsageListResult"]:
"""Get the usage for a subscription.
:param location: The identifier for the physical azure location.
Expand All @@ -55,7 +55,7 @@ def list_usage(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.UsageListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -115,7 +115,7 @@ def list_cached_images(
self,
location: str,
**kwargs
) -> AsyncIterable["models.CachedImagesListResult"]:
) -> AsyncIterable["_models.CachedImagesListResult"]:
"""Get the list of cached images.
Get the list of cached images on specific OS type for a subscription in a region.
Expand All @@ -127,7 +127,7 @@ def list_cached_images(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.CachedImagesListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CachedImagesListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CachedImagesListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -187,7 +187,7 @@ def list_capabilities(
self,
location: str,
**kwargs
) -> AsyncIterable["models.CapabilitiesListResult"]:
) -> AsyncIterable["_models.CapabilitiesListResult"]:
"""Get the list of capabilities of the location.
Get the list of CPU/memory/GPU capabilities of a region.
Expand All @@ -199,7 +199,7 @@ def list_capabilities(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.CapabilitiesListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CapabilitiesListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilitiesListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
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.OperationListResult"]:
) -> AsyncIterable["_models.OperationListResult"]:
"""List the operations for Azure Container Instance service.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerinstance.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down
Loading

0 comments on commit 9b5fa8c

Please sign in to comment.