Skip to content

Commit 9abecc6

Browse files
AutorestCIlmazuel
authored andcommitted
[AutoPR] containerinstance/resource-manager (#3055)
* Generated from 130558caf04982e77015ceb76133473847b3f061 (#3054) Fix errors in container group update example * Adding restart test * Generated from 5e3cbec47d171de4a66d7303dbc455298817a1e5 (#3265) Adding new changes to the september swagger * Packaging update of azure-mgmt-containerinstance * adding new recording files for updates * Update settings.json * ChangeLog * Generated from 41afecad86851cf0f2955c9042941e245b85d15a (#3285) Adding ability to use private ip * Update version.py
1 parent 5b7bb30 commit 9abecc6

22 files changed

+432
-109
lines changed

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"git.ignoreLimitWarning": true,
33
"python.unitTest.pyTestArgs": [],
44
"python.unitTest.pyTestEnabled": true
5-
}
5+
}

azure-mgmt-containerinstance/HISTORY.rst

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
Release History
44
===============
55

6+
1.1.0 (2018-09-06)
7+
++++++++++++++++++
8+
9+
**Features**
10+
11+
- Model LogAnalytics has a new parameter log_type
12+
- Model LogAnalytics has a new parameter metadata
13+
- Model ContainerGroup has a new parameter network_profile
14+
- Added operation ContainerGroupsOperations.stop
15+
- Added operation ContainerGroupsOperations.restart
16+
617
1.0.0 (2018-06-13)
718
++++++++++++++++++
819

azure-mgmt-containerinstance/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the Microsoft Azure Container Instance Client Library.
66
Azure Resource Manager (ARM) is the next generation of management APIs that
77
replace the old Azure Service Management (ASM).
88

9-
This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
9+
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
1010

1111
For the older Azure Service Management (ASM) libraries, see
1212
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.

azure-mgmt-containerinstance/azure/mgmt/containerinstance/container_instance_management_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__(
8686
super(ContainerInstanceManagementClient, self).__init__(self.config.credentials, self.config)
8787

8888
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
89-
self.api_version = '2018-06-01'
89+
self.api_version = '2018-09-01'
9090
self._serialize = Serializer(client_models)
9191
self._deserialize = Deserializer(client_models)
9292

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from .container_group_properties_instance_view_py3 import ContainerGroupPropertiesInstanceView
3333
from .log_analytics_py3 import LogAnalytics
3434
from .container_group_diagnostics_py3 import ContainerGroupDiagnostics
35+
from .container_group_network_profile_py3 import ContainerGroupNetworkProfile
3536
from .container_group_py3 import ContainerGroup
3637
from .operation_display_py3 import OperationDisplay
3738
from .operation_py3 import Operation
@@ -67,6 +68,7 @@
6768
from .container_group_properties_instance_view import ContainerGroupPropertiesInstanceView
6869
from .log_analytics import LogAnalytics
6970
from .container_group_diagnostics import ContainerGroupDiagnostics
71+
from .container_group_network_profile import ContainerGroupNetworkProfile
7072
from .container_group import ContainerGroup
7173
from .operation_display import OperationDisplay
7274
from .operation import Operation
@@ -84,7 +86,9 @@
8486
ContainerNetworkProtocol,
8587
ContainerGroupRestartPolicy,
8688
ContainerGroupNetworkProtocol,
89+
ContainerGroupIpAddressType,
8790
OperatingSystemTypes,
91+
LogAnalyticsLogType,
8892
ContainerInstanceOperationsOrigin,
8993
)
9094

@@ -111,6 +115,7 @@
111115
'ContainerGroupPropertiesInstanceView',
112116
'LogAnalytics',
113117
'ContainerGroupDiagnostics',
118+
'ContainerGroupNetworkProfile',
114119
'ContainerGroup',
115120
'OperationDisplay',
116121
'Operation',
@@ -127,6 +132,8 @@
127132
'ContainerNetworkProtocol',
128133
'ContainerGroupRestartPolicy',
129134
'ContainerGroupNetworkProtocol',
135+
'ContainerGroupIpAddressType',
130136
'OperatingSystemTypes',
137+
'LogAnalyticsLogType',
131138
'ContainerInstanceOperationsOrigin',
132139
]

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group.py

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ class ContainerGroup(Resource):
6464
:param diagnostics: The diagnostic information for a container group.
6565
:type diagnostics:
6666
~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
67+
:param network_profile: The network profile information for a container
68+
group.
69+
:type network_profile:
70+
~azure.mgmt.containerinstance.models.ContainerGroupNetworkProfile
6771
"""
6872

6973
_validation = {
@@ -91,6 +95,7 @@ class ContainerGroup(Resource):
9195
'volumes': {'key': 'properties.volumes', 'type': '[Volume]'},
9296
'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'},
9397
'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'},
98+
'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'},
9499
}
95100

96101
def __init__(self, **kwargs):
@@ -104,3 +109,4 @@ def __init__(self, **kwargs):
104109
self.volumes = kwargs.get('volumes', None)
105110
self.instance_view = None
106111
self.diagnostics = kwargs.get('diagnostics', None)
112+
self.network_profile = kwargs.get('network_profile', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class ContainerGroupNetworkProfile(Model):
16+
"""Container group network profile information.
17+
18+
All required parameters must be populated in order to send to Azure.
19+
20+
:param id: Required. The identifier for a network profile.
21+
:type id: str
22+
"""
23+
24+
_validation = {
25+
'id': {'required': True},
26+
}
27+
28+
_attribute_map = {
29+
'id': {'key': 'id', 'type': 'str'},
30+
}
31+
32+
def __init__(self, **kwargs):
33+
super(ContainerGroupNetworkProfile, self).__init__(**kwargs)
34+
self.id = kwargs.get('id', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class ContainerGroupNetworkProfile(Model):
16+
"""Container group network profile information.
17+
18+
All required parameters must be populated in order to send to Azure.
19+
20+
:param id: Required. The identifier for a network profile.
21+
:type id: str
22+
"""
23+
24+
_validation = {
25+
'id': {'required': True},
26+
}
27+
28+
_attribute_map = {
29+
'id': {'key': 'id', 'type': 'str'},
30+
}
31+
32+
def __init__(self, *, id: str, **kwargs) -> None:
33+
super(ContainerGroupNetworkProfile, self).__init__(**kwargs)
34+
self.id = id

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_group_py3.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ class ContainerGroup(Resource):
6464
:param diagnostics: The diagnostic information for a container group.
6565
:type diagnostics:
6666
~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics
67+
:param network_profile: The network profile information for a container
68+
group.
69+
:type network_profile:
70+
~azure.mgmt.containerinstance.models.ContainerGroupNetworkProfile
6771
"""
6872

6973
_validation = {
@@ -91,9 +95,10 @@ class ContainerGroup(Resource):
9195
'volumes': {'key': 'properties.volumes', 'type': '[Volume]'},
9296
'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'},
9397
'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'},
98+
'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'},
9499
}
95100

96-
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:
101+
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:
97102
super(ContainerGroup, self).__init__(location=location, tags=tags, **kwargs)
98103
self.provisioning_state = None
99104
self.containers = containers
@@ -104,3 +109,4 @@ def __init__(self, *, containers, os_type, location: str=None, tags=None, image_
104109
self.volumes = volumes
105110
self.instance_view = None
106111
self.diagnostics = diagnostics
112+
self.network_profile = network_profile

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/container_instance_management_client_enums.py

+12
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,24 @@ class ContainerGroupNetworkProtocol(str, Enum):
3131
udp = "UDP"
3232

3333

34+
class ContainerGroupIpAddressType(str, Enum):
35+
36+
public = "Public"
37+
private = "Private"
38+
39+
3440
class OperatingSystemTypes(str, Enum):
3541

3642
windows = "Windows"
3743
linux = "Linux"
3844

3945

46+
class LogAnalyticsLogType(str, Enum):
47+
48+
container_insights = "ContainerInsights"
49+
container_instance_logs = "ContainerInstanceLogs"
50+
51+
4052
class ContainerInstanceOperationsOrigin(str, Enum):
4153

4254
user = "User"

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ class IpAddress(Model):
2222
2323
:param ports: Required. The list of ports exposed on the container group.
2424
:type ports: list[~azure.mgmt.containerinstance.models.Port]
25-
:ivar type: Required. Specifies if the IP is exposed to the public
26-
internet. Default value: "Public" .
27-
:vartype type: str
25+
:param type: Required. Specifies if the IP is exposed to the public
26+
internet. Possible values include: 'Public', 'Private'
27+
:type type: str or
28+
~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
2829
:param ip: The IP exposed to the public internet.
2930
:type ip: str
3031
:param dns_name_label: The Dns name label for the IP.
@@ -35,7 +36,7 @@ class IpAddress(Model):
3536

3637
_validation = {
3738
'ports': {'required': True},
38-
'type': {'required': True, 'constant': True},
39+
'type': {'required': True},
3940
'fqdn': {'readonly': True},
4041
}
4142

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

50-
type = "Public"
51-
5251
def __init__(self, **kwargs):
5352
super(IpAddress, self).__init__(**kwargs)
5453
self.ports = kwargs.get('ports', None)
54+
self.type = kwargs.get('type', None)
5555
self.ip = kwargs.get('ip', None)
5656
self.dns_name_label = kwargs.get('dns_name_label', None)
5757
self.fqdn = None

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/ip_address_py3.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ class IpAddress(Model):
2222
2323
:param ports: Required. The list of ports exposed on the container group.
2424
:type ports: list[~azure.mgmt.containerinstance.models.Port]
25-
:ivar type: Required. Specifies if the IP is exposed to the public
26-
internet. Default value: "Public" .
27-
:vartype type: str
25+
:param type: Required. Specifies if the IP is exposed to the public
26+
internet. Possible values include: 'Public', 'Private'
27+
:type type: str or
28+
~azure.mgmt.containerinstance.models.ContainerGroupIpAddressType
2829
:param ip: The IP exposed to the public internet.
2930
:type ip: str
3031
:param dns_name_label: The Dns name label for the IP.
@@ -35,7 +36,7 @@ class IpAddress(Model):
3536

3637
_validation = {
3738
'ports': {'required': True},
38-
'type': {'required': True, 'constant': True},
39+
'type': {'required': True},
3940
'fqdn': {'readonly': True},
4041
}
4142

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

50-
type = "Public"
51-
52-
def __init__(self, *, ports, ip: str=None, dns_name_label: str=None, **kwargs) -> None:
51+
def __init__(self, *, ports, type, ip: str=None, dns_name_label: str=None, **kwargs) -> None:
5352
super(IpAddress, self).__init__(**kwargs)
5453
self.ports = ports
54+
self.type = type
5555
self.ip = ip
5656
self.dns_name_label = dns_name_label
5757
self.fqdn = None

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/log_analytics.py

+10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ class LogAnalytics(Model):
2121
:type workspace_id: str
2222
:param workspace_key: Required. The workspace key for log analytics
2323
:type workspace_key: str
24+
:param log_type: The log type to be used. Possible values include:
25+
'ContainerInsights', 'ContainerInstanceLogs'
26+
:type log_type: str or
27+
~azure.mgmt.containerinstance.models.LogAnalyticsLogType
28+
:param metadata: Metadata for log analytics.
29+
:type metadata: dict[str, str]
2430
"""
2531

2632
_validation = {
@@ -31,9 +37,13 @@ class LogAnalytics(Model):
3137
_attribute_map = {
3238
'workspace_id': {'key': 'workspaceId', 'type': 'str'},
3339
'workspace_key': {'key': 'workspaceKey', 'type': 'str'},
40+
'log_type': {'key': 'logType', 'type': 'str'},
41+
'metadata': {'key': 'metadata', 'type': '{str}'},
3442
}
3543

3644
def __init__(self, **kwargs):
3745
super(LogAnalytics, self).__init__(**kwargs)
3846
self.workspace_id = kwargs.get('workspace_id', None)
3947
self.workspace_key = kwargs.get('workspace_key', None)
48+
self.log_type = kwargs.get('log_type', None)
49+
self.metadata = kwargs.get('metadata', None)

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/log_analytics_py3.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ class LogAnalytics(Model):
2121
:type workspace_id: str
2222
:param workspace_key: Required. The workspace key for log analytics
2323
:type workspace_key: str
24+
:param log_type: The log type to be used. Possible values include:
25+
'ContainerInsights', 'ContainerInstanceLogs'
26+
:type log_type: str or
27+
~azure.mgmt.containerinstance.models.LogAnalyticsLogType
28+
:param metadata: Metadata for log analytics.
29+
:type metadata: dict[str, str]
2430
"""
2531

2632
_validation = {
@@ -31,9 +37,13 @@ class LogAnalytics(Model):
3137
_attribute_map = {
3238
'workspace_id': {'key': 'workspaceId', 'type': 'str'},
3339
'workspace_key': {'key': 'workspaceKey', 'type': 'str'},
40+
'log_type': {'key': 'logType', 'type': 'str'},
41+
'metadata': {'key': 'metadata', 'type': '{str}'},
3442
}
3543

36-
def __init__(self, *, workspace_id: str, workspace_key: str, **kwargs) -> None:
44+
def __init__(self, *, workspace_id: str, workspace_key: str, log_type=None, metadata=None, **kwargs) -> None:
3745
super(LogAnalytics, self).__init__(**kwargs)
3846
self.workspace_id = workspace_id
3947
self.workspace_key = workspace_key
48+
self.log_type = log_type
49+
self.metadata = metadata

azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_group_usage_operations.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ContainerGroupUsageOperations(object):
2323
:param config: Configuration of service client.
2424
:param serializer: An object model serializer.
2525
:param deserializer: An object model deserializer.
26-
:ivar api_version: Client API version. Constant value: "2018-06-01".
26+
:ivar api_version: Client API version. Constant value: "2018-09-01".
2727
"""
2828

2929
models = models
@@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer):
3333
self._client = client
3434
self._serialize = serializer
3535
self._deserialize = deserializer
36-
self.api_version = "2018-06-01"
36+
self.api_version = "2018-09-01"
3737

3838
self.config = config
3939

@@ -67,7 +67,7 @@ def list(
6767

6868
# Construct headers
6969
header_parameters = {}
70-
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
70+
header_parameters['Accept'] = 'application/json'
7171
if self.config.generate_client_request_id:
7272
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
7373
if custom_headers:
@@ -76,8 +76,8 @@ def list(
7676
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
7777

7878
# Construct and send request
79-
request = self._client.get(url, query_parameters)
80-
response = self._client.send(request, header_parameters, stream=False, **operation_config)
79+
request = self._client.get(url, query_parameters, header_parameters)
80+
response = self._client.send(request, stream=False, **operation_config)
8181

8282
if response.status_code not in [200]:
8383
exp = CloudError(response)

0 commit comments

Comments
 (0)