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] containerinstance/resource-manager #3055

Merged
merged 11 commits into from
Sep 6, 2018
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"git.ignoreLimitWarning": true,
"python.unitTest.pyTestArgs": [],
"python.unitTest.pyTestEnabled": true
}
}
11 changes: 11 additions & 0 deletions azure-mgmt-containerinstance/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
Release History
===============

1.1.0 (2018-09-06)
++++++++++++++++++

**Features**

- Model LogAnalytics has a new parameter log_type
- Model LogAnalytics has a new parameter metadata
- Model ContainerGroup has a new parameter network_profile
- Added operation ContainerGroupsOperations.stop
- Added operation ContainerGroupsOperations.restart

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

Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-containerinstance/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure Container Instance Client Library.
Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(
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-06-01'
self.api_version = '2018-09-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
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_network_profile_py3 import ContainerGroupNetworkProfile
from .container_group_py3 import ContainerGroup
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
Expand Down Expand Up @@ -67,6 +68,7 @@
from .container_group_properties_instance_view import ContainerGroupPropertiesInstanceView
from .log_analytics import LogAnalytics
from .container_group_diagnostics import ContainerGroupDiagnostics
from .container_group_network_profile import ContainerGroupNetworkProfile
from .container_group import ContainerGroup
from .operation_display import OperationDisplay
from .operation import Operation
Expand All @@ -84,7 +86,9 @@
ContainerNetworkProtocol,
ContainerGroupRestartPolicy,
ContainerGroupNetworkProtocol,
ContainerGroupIpAddressType,
OperatingSystemTypes,
LogAnalyticsLogType,
ContainerInstanceOperationsOrigin,
)

Expand All @@ -111,6 +115,7 @@
'ContainerGroupPropertiesInstanceView',
'LogAnalytics',
'ContainerGroupDiagnostics',
'ContainerGroupNetworkProfile',
'ContainerGroup',
'OperationDisplay',
'Operation',
Expand All @@ -127,6 +132,8 @@
'ContainerNetworkProtocol',
'ContainerGroupRestartPolicy',
'ContainerGroupNetworkProtocol',
'ContainerGroupIpAddressType',
'OperatingSystemTypes',
'LogAnalyticsLogType',
'ContainerInstanceOperationsOrigin',
]
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ class ContainerGroup(Resource):
:param diagnostics: The diagnostic information for a container group.
:type diagnostics:
~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
:param network_profile: The network profile information for a container
group.
:type network_profile:
~azure.mgmt.containerinstance.models.ContainerGroupNetworkProfile
"""

_validation = {
Expand Down Expand Up @@ -91,6 +95,7 @@ class ContainerGroup(Resource):
'volumes': {'key': 'properties.volumes', 'type': '[Volume]'},
'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'},
'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'},
'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'},
}

def __init__(self, **kwargs):
Expand All @@ -104,3 +109,4 @@ def __init__(self, **kwargs):
self.volumes = kwargs.get('volumes', None)
self.instance_view = None
self.diagnostics = kwargs.get('diagnostics', None)
self.network_profile = kwargs.get('network_profile', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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 ContainerGroupNetworkProfile(Model):
"""Container group network profile information.

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

:param id: Required. The identifier for a network profile.
:type id: str
"""

_validation = {
'id': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ContainerGroupNetworkProfile, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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 ContainerGroupNetworkProfile(Model):
"""Container group network profile information.

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

:param id: Required. The identifier for a network profile.
:type id: str
"""

_validation = {
'id': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
}

def __init__(self, *, id: str, **kwargs) -> None:
super(ContainerGroupNetworkProfile, self).__init__(**kwargs)
self.id = id
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ class ContainerGroup(Resource):
:param diagnostics: The diagnostic information for a container group.
:type diagnostics:
~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
:param network_profile: The network profile information for a container
group.
:type network_profile:
~azure.mgmt.containerinstance.models.ContainerGroupNetworkProfile
"""

_validation = {
Expand Down Expand Up @@ -91,9 +95,10 @@ class ContainerGroup(Resource):
'volumes': {'key': 'properties.volumes', 'type': '[Volume]'},
'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'},
'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'},
'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'},
}

def __init__(self, *, containers, os_type, location: str=None, tags=None, image_registry_credentials=None, restart_policy=None, ip_address=None, volumes=None, diagnostics=None, **kwargs) -> None:
def __init__(self, *, containers, os_type, location: str=None, tags=None, image_registry_credentials=None, restart_policy=None, ip_address=None, volumes=None, diagnostics=None, network_profile=None, **kwargs) -> None:
super(ContainerGroup, self).__init__(location=location, tags=tags, **kwargs)
self.provisioning_state = None
self.containers = containers
Expand All @@ -104,3 +109,4 @@ def __init__(self, *, containers, os_type, location: str=None, tags=None, image_
self.volumes = volumes
self.instance_view = None
self.diagnostics = diagnostics
self.network_profile = network_profile
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,24 @@ class ContainerGroupNetworkProtocol(str, Enum):
udp = "UDP"


class ContainerGroupIpAddressType(str, Enum):

public = "Public"
private = "Private"


class OperatingSystemTypes(str, Enum):

windows = "Windows"
linux = "Linux"


class LogAnalyticsLogType(str, Enum):

container_insights = "ContainerInsights"
container_instance_logs = "ContainerInstanceLogs"


class ContainerInstanceOperationsOrigin(str, Enum):

user = "User"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ class IpAddress(Model):

:param ports: Required. The list of ports exposed on the container group.
:type ports: list[~azure.mgmt.containerinstance.models.Port]
:ivar type: Required. Specifies if the IP is exposed to the public
internet. Default value: "Public" .
:vartype type: str
:param type: Required. Specifies if the IP is exposed to the public
internet. Possible values include: 'Public', 'Private'
:type type: str or
~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
:param ip: The IP exposed to the public internet.
:type ip: str
:param dns_name_label: The Dns name label for the IP.
Expand All @@ -35,7 +36,7 @@ class IpAddress(Model):

_validation = {
'ports': {'required': True},
'type': {'required': True, 'constant': True},
'type': {'required': True},
'fqdn': {'readonly': True},
}

Expand All @@ -47,11 +48,10 @@ class IpAddress(Model):
'fqdn': {'key': 'fqdn', 'type': 'str'},
}

type = "Public"

def __init__(self, **kwargs):
super(IpAddress, self).__init__(**kwargs)
self.ports = kwargs.get('ports', None)
self.type = kwargs.get('type', None)
self.ip = kwargs.get('ip', None)
self.dns_name_label = kwargs.get('dns_name_label', None)
self.fqdn = None
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ class IpAddress(Model):

:param ports: Required. The list of ports exposed on the container group.
:type ports: list[~azure.mgmt.containerinstance.models.Port]
:ivar type: Required. Specifies if the IP is exposed to the public
internet. Default value: "Public" .
:vartype type: str
:param type: Required. Specifies if the IP is exposed to the public
internet. Possible values include: 'Public', 'Private'
:type type: str or
~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
:param ip: The IP exposed to the public internet.
:type ip: str
:param dns_name_label: The Dns name label for the IP.
Expand All @@ -35,7 +36,7 @@ class IpAddress(Model):

_validation = {
'ports': {'required': True},
'type': {'required': True, 'constant': True},
'type': {'required': True},
'fqdn': {'readonly': True},
}

Expand All @@ -47,11 +48,10 @@ class IpAddress(Model):
'fqdn': {'key': 'fqdn', 'type': 'str'},
}

type = "Public"

def __init__(self, *, ports, ip: str=None, dns_name_label: str=None, **kwargs) -> None:
def __init__(self, *, ports, type, ip: str=None, dns_name_label: str=None, **kwargs) -> None:
super(IpAddress, self).__init__(**kwargs)
self.ports = ports
self.type = type
self.ip = ip
self.dns_name_label = dns_name_label
self.fqdn = None
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class LogAnalytics(Model):
:type workspace_id: str
:param workspace_key: Required. The workspace key for log analytics
:type workspace_key: str
:param log_type: The log type to be used. Possible values include:
'ContainerInsights', 'ContainerInstanceLogs'
:type log_type: str or
~azure.mgmt.containerinstance.models.LogAnalyticsLogType
:param metadata: Metadata for log analytics.
:type metadata: dict[str, str]
"""

_validation = {
Expand All @@ -31,9 +37,13 @@ class LogAnalytics(Model):
_attribute_map = {
'workspace_id': {'key': 'workspaceId', 'type': 'str'},
'workspace_key': {'key': 'workspaceKey', 'type': 'str'},
'log_type': {'key': 'logType', 'type': 'str'},
'metadata': {'key': 'metadata', 'type': '{str}'},
}

def __init__(self, **kwargs):
super(LogAnalytics, self).__init__(**kwargs)
self.workspace_id = kwargs.get('workspace_id', None)
self.workspace_key = kwargs.get('workspace_key', None)
self.log_type = kwargs.get('log_type', None)
self.metadata = kwargs.get('metadata', None)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class LogAnalytics(Model):
:type workspace_id: str
:param workspace_key: Required. The workspace key for log analytics
:type workspace_key: str
:param log_type: The log type to be used. Possible values include:
'ContainerInsights', 'ContainerInstanceLogs'
:type log_type: str or
~azure.mgmt.containerinstance.models.LogAnalyticsLogType
:param metadata: Metadata for log analytics.
:type metadata: dict[str, str]
"""

_validation = {
Expand All @@ -31,9 +37,13 @@ class LogAnalytics(Model):
_attribute_map = {
'workspace_id': {'key': 'workspaceId', 'type': 'str'},
'workspace_key': {'key': 'workspaceKey', 'type': 'str'},
'log_type': {'key': 'logType', 'type': 'str'},
'metadata': {'key': 'metadata', 'type': '{str}'},
}

def __init__(self, *, workspace_id: str, workspace_key: str, **kwargs) -> None:
def __init__(self, *, workspace_id: str, workspace_key: str, log_type=None, metadata=None, **kwargs) -> None:
super(LogAnalytics, self).__init__(**kwargs)
self.workspace_id = workspace_id
self.workspace_key = workspace_key
self.log_type = log_type
self.metadata = metadata
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ContainerGroupUsageOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Client API version. Constant value: "2018-06-01".
:ivar api_version: Client API version. Constant value: "2018-09-01".
"""

models = models
Expand All @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-06-01"
self.api_version = "2018-09-01"

self.config = config

Expand Down Expand Up @@ -67,7 +67,7 @@ def list(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -76,8 +76,8 @@ def list(
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)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down
Loading