Skip to content

Commit 88ceae1

Browse files
AutorestCIlmazuel
authored andcommitted
[AutoPR] containerinstance/resource-manager (Azure#3979)
* Generated from 3957f60134a0168e401a3756e0650aca04399726 (Azure#3925) typo: Microsoft.ConainterInstance - contaienr -> container * [AutoPR containerinstance/resource-manager] New APIs for container instance (Azure#3914) * Generated from ba0638a9145ab0ae56c5c1cba104fd9261928733 fix swagger * Generated from a251679fd2cbbf4d4f4cf1f8ae3b98230288fd32 Fix warnings and typo * Generated from a621cc14ec1731b6a308bdcd08157f7c1f2f2df7 Add Id property. * Move ACI in new folder * Add missing files * ChangeLog * Packaging update of azure-mgmt-containerinstance * Generated from 33a3e95ddf719ffe6e63a56dd94e54e1f7a13fbc (Azure#5414) chore: jsonfmt containerinstance Ran `jsonfmt -w "specification/containerinstance/**/*.json"` * Revert "Generated from 33a3e95ddf719ffe6e63a56dd94e54e1f7a13fbc (Azure#5414)" This reverts commit a5f4937. * Deprecated file
1 parent 10caba1 commit 88ceae1

File tree

113 files changed

+693
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+693
-108
lines changed

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

-105
This file was deleted.

azure-mgmt-containerinstance/dev_requirements.txt

-1
This file was deleted.

azure-mgmt-containerinstance/HISTORY.rst renamed to sdk/containerinstance/azure-mgmt-containerinstance/HISTORY.rst

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

6+
1.5.0 (2019-05-22)
7+
++++++++++++++++++
8+
9+
**Features**
10+
11+
- Add client level operations list_cached_images and list_capabilities
12+
613
1.4.1 (2019-04-01)
714
++++++++++++++++++
815

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
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.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
from msrestazure import AzureConfiguration
15+
from .version import VERSION
16+
from msrest.pipeline import ClientRawResponse
17+
from msrestazure.azure_exceptions import CloudError
18+
from msrest.polling import LROPoller, NoPolling
19+
from msrestazure.polling.arm_polling import ARMPolling
20+
import uuid
21+
from .operations.container_groups_operations import ContainerGroupsOperations
22+
from .operations.operations import Operations
23+
from .operations.container_group_usage_operations import ContainerGroupUsageOperations
24+
from .operations.container_operations import ContainerOperations
25+
from .operations.service_association_link_operations import ServiceAssociationLinkOperations
26+
from . import models
27+
28+
29+
class ContainerInstanceManagementClientConfiguration(AzureConfiguration):
30+
"""Configuration for ContainerInstanceManagementClient
31+
Note that all parameters used to create this instance are saved as instance
32+
attributes.
33+
34+
:param credentials: Credentials needed for the client to connect to Azure.
35+
:type credentials: :mod:`A msrestazure Credentials
36+
object<msrestazure.azure_active_directory>`
37+
:param subscription_id: Subscription credentials which uniquely identify
38+
Microsoft Azure subscription. The subscription ID forms part of the URI
39+
for every service call.
40+
:type subscription_id: str
41+
:param str base_url: Service URL
42+
"""
43+
44+
def __init__(
45+
self, credentials, subscription_id, base_url=None):
46+
47+
if credentials is None:
48+
raise ValueError("Parameter 'credentials' must not be None.")
49+
if subscription_id is None:
50+
raise ValueError("Parameter 'subscription_id' must not be None.")
51+
if not base_url:
52+
base_url = 'https://management.azure.com'
53+
54+
super(ContainerInstanceManagementClientConfiguration, self).__init__(base_url)
55+
56+
self.add_user_agent('azure-mgmt-containerinstance/{}'.format(VERSION))
57+
self.add_user_agent('Azure-SDK-For-Python')
58+
59+
self.credentials = credentials
60+
self.subscription_id = subscription_id
61+
62+
63+
class ContainerInstanceManagementClient(SDKClient):
64+
"""ContainerInstanceManagementClient
65+
66+
:ivar config: Configuration for client.
67+
:vartype config: ContainerInstanceManagementClientConfiguration
68+
69+
:ivar container_groups: ContainerGroups operations
70+
:vartype container_groups: azure.mgmt.containerinstance.operations.ContainerGroupsOperations
71+
:ivar operations: Operations operations
72+
:vartype operations: azure.mgmt.containerinstance.operations.Operations
73+
:ivar container_group_usage: ContainerGroupUsage operations
74+
:vartype container_group_usage: azure.mgmt.containerinstance.operations.ContainerGroupUsageOperations
75+
:ivar container: Container operations
76+
:vartype container: azure.mgmt.containerinstance.operations.ContainerOperations
77+
:ivar service_association_link: ServiceAssociationLink operations
78+
:vartype service_association_link: azure.mgmt.containerinstance.operations.ServiceAssociationLinkOperations
79+
80+
:param credentials: Credentials needed for the client to connect to Azure.
81+
:type credentials: :mod:`A msrestazure Credentials
82+
object<msrestazure.azure_active_directory>`
83+
:param subscription_id: Subscription credentials which uniquely identify
84+
Microsoft Azure subscription. The subscription ID forms part of the URI
85+
for every service call.
86+
:type subscription_id: str
87+
:param str base_url: Service URL
88+
"""
89+
90+
def __init__(
91+
self, credentials, subscription_id, base_url=None):
92+
93+
self.config = ContainerInstanceManagementClientConfiguration(credentials, subscription_id, base_url)
94+
super(ContainerInstanceManagementClient, self).__init__(self.config.credentials, self.config)
95+
96+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
97+
self.api_version = '2018-10-01'
98+
self._serialize = Serializer(client_models)
99+
self._deserialize = Deserializer(client_models)
100+
101+
self.container_groups = ContainerGroupsOperations(
102+
self._client, self.config, self._serialize, self._deserialize)
103+
self.operations = Operations(
104+
self._client, self.config, self._serialize, self._deserialize)
105+
self.container_group_usage = ContainerGroupUsageOperations(
106+
self._client, self.config, self._serialize, self._deserialize)
107+
self.container = ContainerOperations(
108+
self._client, self.config, self._serialize, self._deserialize)
109+
self.service_association_link = ServiceAssociationLinkOperations(
110+
self._client, self.config, self._serialize, self._deserialize)
111+
112+
def list_cached_images(
113+
self, location, custom_headers=None, raw=False, **operation_config):
114+
"""Get the list of cached images.
115+
116+
Get the list of cached images on specific OS type for a subscription in
117+
a region.
118+
119+
:param location: The identifier for the physical azure location.
120+
:type location: str
121+
:param dict custom_headers: headers that will be added to the request
122+
:param bool raw: returns the direct response alongside the
123+
deserialized response
124+
:param operation_config: :ref:`Operation configuration
125+
overrides<msrest:optionsforoperations>`.
126+
:return: CachedImagesListResult or ClientRawResponse if raw=true
127+
:rtype: ~azure.mgmt.containerinstance.models.CachedImagesListResult or
128+
~msrest.pipeline.ClientRawResponse
129+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
130+
"""
131+
# Construct URL
132+
url = self.list_cached_images.metadata['url']
133+
path_format_arguments = {
134+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
135+
'location': self._serialize.url("location", location, 'str')
136+
}
137+
url = self._client.format_url(url, **path_format_arguments)
138+
139+
# Construct parameters
140+
query_parameters = {}
141+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
142+
143+
# Construct headers
144+
header_parameters = {}
145+
header_parameters['Accept'] = 'application/json'
146+
if self.config.generate_client_request_id:
147+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
148+
if custom_headers:
149+
header_parameters.update(custom_headers)
150+
if self.config.accept_language is not None:
151+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
152+
153+
# Construct and send request
154+
request = self._client.get(url, query_parameters, header_parameters)
155+
response = self._client.send(request, stream=False, **operation_config)
156+
157+
if response.status_code not in [200]:
158+
exp = CloudError(response)
159+
exp.request_id = response.headers.get('x-ms-request-id')
160+
raise exp
161+
162+
deserialized = None
163+
164+
if response.status_code == 200:
165+
deserialized = self._deserialize('CachedImagesListResult', response)
166+
167+
if raw:
168+
client_raw_response = ClientRawResponse(deserialized, response)
169+
return client_raw_response
170+
171+
return deserialized
172+
list_cached_images.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages'}
173+
174+
def list_capabilities(
175+
self, location, custom_headers=None, raw=False, **operation_config):
176+
"""Get the list of capabilities of the location.
177+
178+
Get the list of CPU/memory/GPU capabilities of a region.
179+
180+
:param location: The identifier for the physical azure location.
181+
:type location: str
182+
:param dict custom_headers: headers that will be added to the request
183+
:param bool raw: returns the direct response alongside the
184+
deserialized response
185+
:param operation_config: :ref:`Operation configuration
186+
overrides<msrest:optionsforoperations>`.
187+
:return: CapabilitiesListResult or ClientRawResponse if raw=true
188+
:rtype: ~azure.mgmt.containerinstance.models.CapabilitiesListResult or
189+
~msrest.pipeline.ClientRawResponse
190+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
191+
"""
192+
# Construct URL
193+
url = self.list_capabilities.metadata['url']
194+
path_format_arguments = {
195+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
196+
'location': self._serialize.url("location", location, 'str')
197+
}
198+
url = self._client.format_url(url, **path_format_arguments)
199+
200+
# Construct parameters
201+
query_parameters = {}
202+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
203+
204+
# Construct headers
205+
header_parameters = {}
206+
header_parameters['Accept'] = 'application/json'
207+
if self.config.generate_client_request_id:
208+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
209+
if custom_headers:
210+
header_parameters.update(custom_headers)
211+
if self.config.accept_language is not None:
212+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
213+
214+
# Construct and send request
215+
request = self._client.get(url, query_parameters, header_parameters)
216+
response = self._client.send(request, stream=False, **operation_config)
217+
218+
if response.status_code not in [200]:
219+
exp = CloudError(response)
220+
exp.request_id = response.headers.get('x-ms-request-id')
221+
raise exp
222+
223+
deserialized = None
224+
225+
if response.status_code == 200:
226+
deserialized = self._deserialize('CapabilitiesListResult', response)
227+
228+
if raw:
229+
client_raw_response = ClientRawResponse(deserialized, response)
230+
return client_raw_response
231+
232+
return deserialized
233+
list_capabilities.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities'}

azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py renamed to sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py

+15
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
from .container_exec_request_py3 import ContainerExecRequest
5050
from .container_exec_response_py3 import ContainerExecResponse
5151
from .resource_py3 import Resource
52+
from .cached_images_py3 import CachedImages
53+
from .cached_images_list_result_py3 import CachedImagesListResult
54+
from .capabilities_capabilities_py3 import CapabilitiesCapabilities
55+
from .capabilities_py3 import Capabilities
56+
from .capabilities_list_result_py3 import CapabilitiesListResult
5257
except (SyntaxError, ImportError):
5358
from .container_port import ContainerPort
5459
from .environment_variable import EnvironmentVariable
@@ -89,6 +94,11 @@
8994
from .container_exec_request import ContainerExecRequest
9095
from .container_exec_response import ContainerExecResponse
9196
from .resource import Resource
97+
from .cached_images import CachedImages
98+
from .cached_images_list_result import CachedImagesListResult
99+
from .capabilities_capabilities import CapabilitiesCapabilities
100+
from .capabilities import Capabilities
101+
from .capabilities_list_result import CapabilitiesListResult
92102
from .container_group_paged import ContainerGroupPaged
93103
from .container_instance_management_client_enums import (
94104
ContainerNetworkProtocol,
@@ -142,6 +152,11 @@
142152
'ContainerExecRequest',
143153
'ContainerExecResponse',
144154
'Resource',
155+
'CachedImages',
156+
'CachedImagesListResult',
157+
'CapabilitiesCapabilities',
158+
'Capabilities',
159+
'CapabilitiesListResult',
145160
'ContainerGroupPaged',
146161
'ContainerNetworkProtocol',
147162
'GpuSku',

0 commit comments

Comments
 (0)