Skip to content

Commit

Permalink
[AutoPR] containerinstance/resource-manager (#2320)
Browse files Browse the repository at this point in the history
* [AutoPR containerinstance/resource-manager] Adding April Swagger For GA (#2309)

* Generated from 3f1cb3ecea72fb963c8c89dcce5a4a3fe378e878

Adding GA Swagger

* Generated from ab364c6f9db63bf093fc85506577245a35f1fbb4

Moving read only to property level

* [AutoPR containerinstance/resource-manager] Adding June Swagger Update - Azure Container Instance (#2676)

* Generated from dd1d82ca6db8078870ccf13fe430a75a1ebe90d7

updating api version

* Generated from 2988a6ef3f5b633295691d3c0bacdd5cce3fb651

updating basic information to point at correct tag

* Auto conf for ACI

* ACI 1.0.0

* Update ChangeLog again

* Adding new recording

* [AutoPR containerinstance/resource-manager] Container Instance - Fix Mistake in June Update (#2740)

* Generated from 56a24ff7a0bf5903c623c562734aae727189cf22

fixing old mistake with exec request

* Generated from 1c3ce366b0de6230300a2293c500204e7a89e8db

Update readme.md

* ChangeLog update

* [AutoPR containerinstance/resource-manager] Container Instance - Update Fields For Easier to Understand Documentation  (#2755)

* Generated from a58ad31ca0f190c08d519f0e57f0251b719de4c3

Udpating other fields to have better documentation

* Generated from 57c26f8ddc6cce63febe8113dcf5a0c4e638c1ea

Changing Container_Exec -> Conatiner_ExecuteCommand for better understanding

* Adding tests for new changes

* adding tests for container group diagnostics

* removing yolo3301 from autoreviewer for ACI
  • Loading branch information
AutorestCI authored and lmazuel committed Jun 21, 2018
1 parent 9ccc91a commit 223ddb6
Show file tree
Hide file tree
Showing 85 changed files with 2,276 additions and 439 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/azure-mgmt-batchai/ @AlexanderYukhanov
/azure-mgmt-cdn/ @tjprescott
/azure-mgmt-consumption/ @sandeepnl
/azure-mgmt-containerinstance/ @yolo3301 @xizhamsft
/azure-mgmt-containerinstance/ @samkreter @xizhamsft
/azure-mgmt-containerregistry/ @djyou
/azure-mgmt-cosmosdb/ @dmakwana
/azure-mgmt-datafactory/ @hvermis
Expand Down
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 @@ -9,15 +9,14 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
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 @@ -55,7 +54,7 @@ def __init__(
self.subscription_id = subscription_id


class ContainerInstanceManagementClient(object):
class ContainerInstanceManagementClient(SDKClient):
"""ContainerInstanceManagementClient
:ivar config: Configuration for client.
Expand All @@ -67,10 +66,8 @@ class ContainerInstanceManagementClient(object):
: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 All @@ -86,10 +83,10 @@ def __init__(
self, credentials, subscription_id, base_url=None):

self.config = ContainerInstanceManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
super(ContainerInstanceManagementClient, 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-02-01-preview'
self.api_version = '2018-06-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand All @@ -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 @@ -9,35 +9,76 @@
# regenerated.
# --------------------------------------------------------------------------

from .container_port import ContainerPort
from .environment_variable import EnvironmentVariable
from .container_state import ContainerState
from .event import Event
from .container_properties_instance_view import ContainerPropertiesInstanceView
from .resource_requests import ResourceRequests
from .resource_limits import ResourceLimits
from .resource_requirements import ResourceRequirements
from .volume_mount import VolumeMount
from .container import Container
from .azure_file_volume import AzureFileVolume
from .git_repo_volume import GitRepoVolume
from .volume import Volume
from .image_registry_credential import ImageRegistryCredential
from .port import Port
from .ip_address import IpAddress
from .container_group_properties_instance_view import ContainerGroupPropertiesInstanceView
from .container_group import ContainerGroup
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_list_result import OperationListResult
from .usage_name import UsageName
from .usage import Usage
from .usage_list_result import UsageListResult
from .logs import Logs
from .container_exec_request_terminal_size import ContainerExecRequestTerminalSize
from .container_exec_request import ContainerExecRequest
from .container_exec_response import ContainerExecResponse
from .resource import Resource
try:
from .container_port_py3 import ContainerPort
from .environment_variable_py3 import EnvironmentVariable
from .container_state_py3 import ContainerState
from .event_py3 import Event
from .container_properties_instance_view_py3 import ContainerPropertiesInstanceView
from .resource_requests_py3 import ResourceRequests
from .resource_limits_py3 import ResourceLimits
from .resource_requirements_py3 import ResourceRequirements
from .volume_mount_py3 import VolumeMount
from .container_exec_py3 import ContainerExec
from .container_http_get_py3 import ContainerHttpGet
from .container_probe_py3 import ContainerProbe
from .container_py3 import Container
from .azure_file_volume_py3 import AzureFileVolume
from .git_repo_volume_py3 import GitRepoVolume
from .volume_py3 import Volume
from .image_registry_credential_py3 import ImageRegistryCredential
from .port_py3 import Port
from .ip_address_py3 import IpAddress
from .container_group_properties_instance_view_py3 import ContainerGroupPropertiesInstanceView
from .log_analytics_py3 import LogAnalytics
from .container_group_diagnostics_py3 import ContainerGroupDiagnostics
from .container_group_py3 import ContainerGroup
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .operation_list_result_py3 import OperationListResult
from .usage_name_py3 import UsageName
from .usage_py3 import Usage
from .usage_list_result_py3 import UsageListResult
from .logs_py3 import Logs
from .container_exec_request_terminal_size_py3 import ContainerExecRequestTerminalSize
from .container_exec_request_py3 import ContainerExecRequest
from .container_exec_response_py3 import ContainerExecResponse
from .resource_py3 import Resource
except (SyntaxError, ImportError):
from .container_port import ContainerPort
from .environment_variable import EnvironmentVariable
from .container_state import ContainerState
from .event import Event
from .container_properties_instance_view import ContainerPropertiesInstanceView
from .resource_requests import ResourceRequests
from .resource_limits import ResourceLimits
from .resource_requirements import ResourceRequirements
from .volume_mount import VolumeMount
from .container_exec import ContainerExec
from .container_http_get import ContainerHttpGet
from .container_probe import ContainerProbe
from .container import Container
from .azure_file_volume import AzureFileVolume
from .git_repo_volume import GitRepoVolume
from .volume import Volume
from .image_registry_credential import ImageRegistryCredential
from .port import Port
from .ip_address import IpAddress
from .container_group_properties_instance_view import ContainerGroupPropertiesInstanceView
from .log_analytics import LogAnalytics
from .container_group_diagnostics import ContainerGroupDiagnostics
from .container_group import ContainerGroup
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_list_result import OperationListResult
from .usage_name import UsageName
from .usage import Usage
from .usage_list_result import UsageListResult
from .logs import Logs
from .container_exec_request_terminal_size import ContainerExecRequestTerminalSize
from .container_exec_request import ContainerExecRequest
from .container_exec_response import ContainerExecResponse
from .resource import Resource
from .container_group_paged import ContainerGroupPaged
from .container_instance_management_client_enums import (
ContainerNetworkProtocol,
Expand All @@ -57,6 +98,9 @@
'ResourceLimits',
'ResourceRequirements',
'VolumeMount',
'ContainerExec',
'ContainerHttpGet',
'ContainerProbe',
'Container',
'AzureFileVolume',
'GitRepoVolume',
Expand All @@ -65,6 +109,8 @@
'Port',
'IpAddress',
'ContainerGroupPropertiesInstanceView',
'LogAnalytics',
'ContainerGroupDiagnostics',
'ContainerGroup',
'OperationDisplay',
'Operation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ class AzureFileVolume(Model):
"""The properties of the Azure File volume. Azure File shares are mounted as
volumes.
:param share_name: The name of the Azure File share to be mounted as a
volume.
All required parameters must be populated in order to send to Azure.
:param share_name: Required. The name of the Azure File share to be
mounted as a volume.
:type share_name: str
:param read_only: The flag indicating whether the Azure File shared
mounted as a volume is read-only.
:type read_only: bool
:param storage_account_name: The name of the storage account that contains
the Azure File share.
:param storage_account_name: Required. The name of the storage account
that contains the Azure File share.
:type storage_account_name: str
:param storage_account_key: The storage account access key used to access
the Azure File share.
Expand All @@ -42,9 +44,9 @@ class AzureFileVolume(Model):
'storage_account_key': {'key': 'storageAccountKey', 'type': 'str'},
}

def __init__(self, share_name, storage_account_name, read_only=None, storage_account_key=None):
super(AzureFileVolume, self).__init__()
self.share_name = share_name
self.read_only = read_only
self.storage_account_name = storage_account_name
self.storage_account_key = storage_account_key
def __init__(self, **kwargs):
super(AzureFileVolume, self).__init__(**kwargs)
self.share_name = kwargs.get('share_name', None)
self.read_only = kwargs.get('read_only', None)
self.storage_account_name = kwargs.get('storage_account_name', None)
self.storage_account_key = kwargs.get('storage_account_key', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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 AzureFileVolume(Model):
"""The properties of the Azure File volume. Azure File shares are mounted as
volumes.
All required parameters must be populated in order to send to Azure.
:param share_name: Required. The name of the Azure File share to be
mounted as a volume.
:type share_name: str
:param read_only: The flag indicating whether the Azure File shared
mounted as a volume is read-only.
:type read_only: bool
:param storage_account_name: Required. The name of the storage account
that contains the Azure File share.
:type storage_account_name: str
:param storage_account_key: The storage account access key used to access
the Azure File share.
:type storage_account_key: str
"""

_validation = {
'share_name': {'required': True},
'storage_account_name': {'required': True},
}

_attribute_map = {
'share_name': {'key': 'shareName', 'type': 'str'},
'read_only': {'key': 'readOnly', 'type': 'bool'},
'storage_account_name': {'key': 'storageAccountName', 'type': 'str'},
'storage_account_key': {'key': 'storageAccountKey', 'type': 'str'},
}

def __init__(self, *, share_name: str, storage_account_name: str, read_only: bool=None, storage_account_key: str=None, **kwargs) -> None:
super(AzureFileVolume, self).__init__(**kwargs)
self.share_name = share_name
self.read_only = read_only
self.storage_account_name = storage_account_name
self.storage_account_key = storage_account_key
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ class Container(Model):
Variables are only populated by the server, and will be ignored when
sending a request.
:param name: The user-provided name of the container instance.
All required parameters must be populated in order to send to Azure.
:param name: Required. The user-provided name of the container instance.
:type name: str
:param image: The name of the image used to create the container instance.
:param image: Required. The name of the image used to create the container
instance.
:type image: str
:param command: The commands to execute within the container instance in
exec form.
Expand All @@ -35,12 +38,17 @@ class Container(Model):
valid in response.
:vartype instance_view:
~azure.mgmt.containerinstance.models.ContainerPropertiesInstanceView
:param resources: The resource requirements of the container instance.
:param resources: Required. The resource requirements of the container
instance.
:type resources: ~azure.mgmt.containerinstance.models.ResourceRequirements
:param volume_mounts: The volume mounts available to the container
instance.
:type volume_mounts:
list[~azure.mgmt.containerinstance.models.VolumeMount]
:param liveness_probe: The liveness probe.
:type liveness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe
:param readiness_probe: The readiness probe.
:type readiness_probe: ~azure.mgmt.containerinstance.models.ContainerProbe
"""

_validation = {
Expand All @@ -59,15 +67,19 @@ class Container(Model):
'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerPropertiesInstanceView'},
'resources': {'key': 'properties.resources', 'type': 'ResourceRequirements'},
'volume_mounts': {'key': 'properties.volumeMounts', 'type': '[VolumeMount]'},
'liveness_probe': {'key': 'properties.livenessProbe', 'type': 'ContainerProbe'},
'readiness_probe': {'key': 'properties.readinessProbe', 'type': 'ContainerProbe'},
}

def __init__(self, name, image, resources, command=None, ports=None, environment_variables=None, volume_mounts=None):
super(Container, self).__init__()
self.name = name
self.image = image
self.command = command
self.ports = ports
self.environment_variables = environment_variables
def __init__(self, **kwargs):
super(Container, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.image = kwargs.get('image', None)
self.command = kwargs.get('command', None)
self.ports = kwargs.get('ports', None)
self.environment_variables = kwargs.get('environment_variables', None)
self.instance_view = None
self.resources = resources
self.volume_mounts = volume_mounts
self.resources = kwargs.get('resources', None)
self.volume_mounts = kwargs.get('volume_mounts', None)
self.liveness_probe = kwargs.get('liveness_probe', None)
self.readiness_probe = kwargs.get('readiness_probe', None)
Loading

0 comments on commit 223ddb6

Please sign in to comment.