Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
36 changes: 36 additions & 0 deletions azure-mgmt-containerinstance/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,42 @@
Release History
===============

1.0.0 (2018-06-13)
++++++++++++++++++

**Features**

- Model Container has a new parameter liveness_probe
- Model Container has a new parameter readiness_probe
- Model ContainerGroup has a new parameter diagnostics
- Model EnvironmentVariable has a new parameter secure_value
- Client class can be used as a context manager to keep the underlying HTTP session open for performance

**General Breaking changes**

This version uses a next-generation code generator that *might* introduce breaking changes.

- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments.
To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments.
- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.
While this is not a breaking change, the distinctions are important, and are documented here:
https://docs.python.org/3/library/enum.html#others
At a glance:

- "is" should not be used at all.
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered.

- New Long Running Operation:

- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
the response of the initial call will be returned without polling.
- `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`.
- `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away.

0.4.0 (2018-03-19)
++++++++++++++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
from .operations.container_groups_operations import ContainerGroupsOperations
from .operations.operations import Operations
from .operations.container_group_usage_operations import ContainerGroupUsageOperations
from .operations.container_logs_operations import ContainerLogsOperations
from .operations.start_container_operations import StartContainerOperations
from .operations.container_operations import ContainerOperations
from . import models


Expand Down Expand Up @@ -67,10 +66,8 @@ class ContainerInstanceManagementClient(SDKClient):
:vartype operations: azure.mgmt.containerinstance.operations.Operations
:ivar container_group_usage: ContainerGroupUsage operations
:vartype container_group_usage: azure.mgmt.containerinstance.operations.ContainerGroupUsageOperations
:ivar container_logs: ContainerLogs operations
:vartype container_logs: azure.mgmt.containerinstance.operations.ContainerLogsOperations
:ivar start_container: StartContainer operations
:vartype start_container: azure.mgmt.containerinstance.operations.StartContainerOperations
:ivar container: Container operations
:vartype container: azure.mgmt.containerinstance.operations.ContainerOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand Down Expand Up @@ -99,7 +96,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.container_group_usage = ContainerGroupUsageOperations(
self._client, self.config, self._serialize, self._deserialize)
self.container_logs = ContainerLogsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.start_container = StartContainerOperations(
self.container = ContainerOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class ContainerExecRequest(Model):
"""The start container exec request.
"""The container exec request.

:param command: The command to be executed.
:type command: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class ContainerExecRequest(Model):
"""The start container exec request.
"""The container exec request.

:param command: The command to be executed.
:type command: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
class ContainerExecRequestTerminalSize(Model):
"""The size of the terminal.

:param row: The row size of the terminal
:type row: int
:param column: The column size of the terminal
:type column: int
:param rows: The row size of the terminal
:type rows: int
:param cols: The column size of the terminal
:type cols: int
"""

_attribute_map = {
'row': {'key': 'row', 'type': 'int'},
'column': {'key': 'column', 'type': 'int'},
'rows': {'key': 'rows', 'type': 'int'},
'cols': {'key': 'cols', 'type': 'int'},
}

def __init__(self, **kwargs):
super(ContainerExecRequestTerminalSize, self).__init__(**kwargs)
self.row = kwargs.get('row', None)
self.column = kwargs.get('column', None)
self.rows = kwargs.get('rows', None)
self.cols = kwargs.get('cols', None)
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
class ContainerExecRequestTerminalSize(Model):
"""The size of the terminal.

:param row: The row size of the terminal
:type row: int
:param column: The column size of the terminal
:type column: int
:param rows: The row size of the terminal
:type rows: int
:param cols: The column size of the terminal
:type cols: int
"""

_attribute_map = {
'row': {'key': 'row', 'type': 'int'},
'column': {'key': 'column', 'type': 'int'},
'rows': {'key': 'rows', 'type': 'int'},
'cols': {'key': 'cols', 'type': 'int'},
}

def __init__(self, *, row: int=None, column: int=None, **kwargs) -> None:
def __init__(self, *, rows: int=None, cols: int=None, **kwargs) -> None:
super(ContainerExecRequestTerminalSize, self).__init__(**kwargs)
self.row = row
self.column = column
self.rows = rows
self.cols = cols
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
from .container_groups_operations import ContainerGroupsOperations
from .operations import Operations
from .container_group_usage_operations import ContainerGroupUsageOperations
from .container_logs_operations import ContainerLogsOperations
from .start_container_operations import StartContainerOperations
from .container_operations import ContainerOperations

__all__ = [
'ContainerGroupsOperations',
'Operations',
'ContainerGroupUsageOperations',
'ContainerLogsOperations',
'StartContainerOperations',
'ContainerOperations',
]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from .. import models


class StartContainerOperations(object):
"""StartContainerOperations operations.
class ContainerOperations(object):
"""ContainerOperations operations.

:param client: Client for service requests.
:param config: Configuration of service client.
Expand All @@ -37,12 +37,86 @@ def __init__(self, client, config, serializer, deserializer):

self.config = config

def launch_exec(
def list_logs(
self, resource_group_name, container_group_name, container_name, tail=None, custom_headers=None, raw=False, **operation_config):
"""Get the logs for a specified container instance.

Get the logs for a specified container instance in a specified resource
group and container group.

:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param container_group_name: The name of the container group.
:type container_group_name: str
:param container_name: The name of the container instance.
:type container_name: str
:param tail: The number of lines to show from the tail of the
container instance log. If not provided, all available logs are shown
up to 4mb.
:type tail: int
: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<msrest:optionsforoperations>`.
:return: Logs or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.containerinstance.models.Logs or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.list_logs.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'containerGroupName': self._serialize.url("container_group_name", container_group_name, 'str'),
'containerName': self._serialize.url("container_name", container_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if tail is not None:
query_parameters['tail'] = self._serialize.query("tail", tail, 'int')

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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)
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)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
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('Logs', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
list_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs'}

def execute_command(
self, resource_group_name, container_group_name, container_name, command=None, terminal_size=None, custom_headers=None, raw=False, **operation_config):
"""Starts the exec command for a specific container instance.
"""Executes a command in a specific container instance.

Starts the exec command for a specified container instance in a
specified resource group and container group.
Executes a command for a specific container instance in a specified
resource group and container group.

:param resource_group_name: The name of the resource group.
:type resource_group_name: str
Expand All @@ -68,7 +142,7 @@ def launch_exec(
container_exec_request = models.ContainerExecRequest(command=command, terminal_size=terminal_size)

# Construct URL
url = self.launch_exec.metadata['url']
url = self.execute_command.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
Expand Down Expand Up @@ -114,4 +188,4 @@ def launch_exec(
return client_raw_response

return deserialized
launch_exec.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'}
execute_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'}
Loading