Skip to content

Commit 089a47e

Browse files
SDKAutoYan Zhang (WICRESOFT NORTH AMERICA LTD)
andcommitted
CodeGen from PR 13396 in Azure/azure-rest-api-specs
track2 configure (#13396) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) <[email protected]>
1 parent ae427fd commit 089a47e

17 files changed

+366
-37
lines changed

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
51-
self.api_version = "2019-12-01"
51+
self.api_version = "2021-03-01"
5252
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5353
kwargs.setdefault('sdk_moniker', 'mgmt-containerinstance/{}'.format(VERSION))
5454
self._configure(**kwargs)

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_container_instance_management_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def __init__(
5959

6060
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
6161
self._serialize = Serializer(client_models)
62-
self._serialize.client_side_validation = False
6362
self._deserialize = Deserializer(client_models)
6463

6564
self.container_groups = ContainerGroupsOperations(
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"chosen_version": "2021-03-01",
3+
"total_api_version_list": ["2021-03-01"],
4+
"client": {
5+
"name": "ContainerInstanceManagementClient",
6+
"filename": "_container_instance_management_client",
7+
"description": "ContainerInstanceManagementClient.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": true
13+
},
14+
"global_parameters": {
15+
"sync": {
16+
"credential": {
17+
"signature": "credential, # type: \"TokenCredential\"",
18+
"description": "Credential needed for the client to connect to Azure.",
19+
"docstring_type": "~azure.core.credentials.TokenCredential",
20+
"required": true
21+
},
22+
"subscription_id": {
23+
"signature": "subscription_id, # type: str",
24+
"description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
25+
"docstring_type": "str",
26+
"required": true
27+
}
28+
},
29+
"async": {
30+
"credential": {
31+
"signature": "credential, # type: \"AsyncTokenCredential\"",
32+
"description": "Credential needed for the client to connect to Azure.",
33+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
34+
"required": true
35+
},
36+
"subscription_id": {
37+
"signature": "subscription_id, # type: str",
38+
"description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
39+
"docstring_type": "str",
40+
"required": true
41+
}
42+
},
43+
"constant": {
44+
},
45+
"call": "credential, subscription_id"
46+
},
47+
"config": {
48+
"credential": true,
49+
"credential_scopes": ["https://management.azure.com/.default"],
50+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
51+
"credential_default_policy_type_has_async_version": true,
52+
"credential_key_header_name": null
53+
},
54+
"operation_groups": {
55+
"container_groups": "ContainerGroupsOperations",
56+
"operations": "Operations",
57+
"location": "LocationOperations",
58+
"containers": "ContainersOperations"
59+
},
60+
"operation_mixins": {
61+
},
62+
"sync_imports": "None",
63+
"async_imports": "None"
64+
}

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "7.0.0"
9+
VERSION = "1.0.0"

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2019-12-01"
48+
self.api_version = "2021-03-01"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-containerinstance/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_container_instance_management_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def __init__(
5656

5757
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5858
self._serialize = Serializer(client_models)
59-
self._serialize.client_side_validation = False
6059
self._deserialize = Deserializer(client_models)
6160

6261
self.container_groups = ContainerGroupsOperations(

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def list(
6363
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6464
}
6565
error_map.update(kwargs.pop('error_map', {}))
66-
api_version = "2019-12-01"
66+
api_version = "2021-03-01"
6767
accept = "application/json"
6868

6969
def prepare_request(next_link=None):
@@ -136,7 +136,7 @@ def list_by_resource_group(
136136
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
137137
}
138138
error_map.update(kwargs.pop('error_map', {}))
139-
api_version = "2019-12-01"
139+
api_version = "2021-03-01"
140140
accept = "application/json"
141141

142142
def prepare_request(next_link=None):
@@ -213,7 +213,7 @@ async def get(
213213
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
214214
}
215215
error_map.update(kwargs.pop('error_map', {}))
216-
api_version = "2019-12-01"
216+
api_version = "2021-03-01"
217217
accept = "application/json"
218218

219219
# Construct URL
@@ -261,7 +261,7 @@ async def _create_or_update_initial(
261261
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
262262
}
263263
error_map.update(kwargs.pop('error_map', {}))
264-
api_version = "2019-12-01"
264+
api_version = "2021-03-01"
265265
content_type = kwargs.pop("content_type", "application/json")
266266
accept = "application/json"
267267

@@ -406,7 +406,7 @@ async def update(
406406
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
407407
}
408408
error_map.update(kwargs.pop('error_map', {}))
409-
api_version = "2019-12-01"
409+
api_version = "2021-03-01"
410410
content_type = kwargs.pop("content_type", "application/json")
411411
accept = "application/json"
412412

@@ -458,7 +458,7 @@ async def _delete_initial(
458458
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
459459
}
460460
error_map.update(kwargs.pop('error_map', {}))
461-
api_version = "2019-12-01"
461+
api_version = "2021-03-01"
462462
accept = "application/json"
463463

464464
# Construct URL
@@ -577,7 +577,7 @@ async def _restart_initial(
577577
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
578578
}
579579
error_map.update(kwargs.pop('error_map', {}))
580-
api_version = "2019-12-01"
580+
api_version = "2021-03-01"
581581
accept = "application/json"
582582

583583
# Construct URL
@@ -702,7 +702,7 @@ async def stop(
702702
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
703703
}
704704
error_map.update(kwargs.pop('error_map', {}))
705-
api_version = "2019-12-01"
705+
api_version = "2021-03-01"
706706
accept = "application/json"
707707

708708
# Construct URL
@@ -746,7 +746,7 @@ async def _start_initial(
746746
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
747747
}
748748
error_map.update(kwargs.pop('error_map', {}))
749-
api_version = "2019-12-01"
749+
api_version = "2021-03-01"
750750
accept = "application/json"
751751

752752
# Construct URL
@@ -770,7 +770,7 @@ async def _start_initial(
770770
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
771771
response = pipeline_response.http_response
772772

773-
if response.status_code not in [204]:
773+
if response.status_code not in [202]:
774774
map_error(status_code=response.status_code, response=response, error_map=error_map)
775775
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
776776

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ async def list_logs(
4646
container_group_name: str,
4747
container_name: str,
4848
tail: Optional[int] = None,
49+
timestamps: Optional[bool] = None,
4950
**kwargs
5051
) -> "_models.Logs":
5152
"""Get the logs for a specified container instance.
@@ -62,6 +63,9 @@ async def list_logs(
6263
:param tail: The number of lines to show from the tail of the container instance log. If not
6364
provided, all available logs are shown up to 4mb.
6465
:type tail: int
66+
:param timestamps: If true, adds a timestamp at the beginning of every line of log output. If
67+
not provided, defaults to false.
68+
:type timestamps: bool
6569
:keyword callable cls: A custom type or function that will be passed the direct response
6670
:return: Logs, or the result of cls(response)
6771
:rtype: ~azure.mgmt.containerinstance.models.Logs
@@ -72,7 +76,7 @@ async def list_logs(
7276
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
7377
}
7478
error_map.update(kwargs.pop('error_map', {}))
75-
api_version = "2019-12-01"
79+
api_version = "2021-03-01"
7680
accept = "application/json"
7781

7882
# Construct URL
@@ -90,6 +94,8 @@ async def list_logs(
9094
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
9195
if tail is not None:
9296
query_parameters['tail'] = self._serialize.query("tail", tail, 'int')
97+
if timestamps is not None:
98+
query_parameters['timestamps'] = self._serialize.query("timestamps", timestamps, 'bool')
9399

94100
# Construct headers
95101
header_parameters = {} # type: Dict[str, Any]
@@ -142,7 +148,7 @@ async def execute_command(
142148
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
143149
}
144150
error_map.update(kwargs.pop('error_map', {}))
145-
api_version = "2019-12-01"
151+
api_version = "2021-03-01"
146152
content_type = kwargs.pop("content_type", "application/json")
147153
accept = "application/json"
148154

@@ -183,3 +189,68 @@ async def execute_command(
183189

184190
return deserialized
185191
execute_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'} # type: ignore
192+
193+
async def attach(
194+
self,
195+
resource_group_name: str,
196+
container_group_name: str,
197+
container_name: str,
198+
**kwargs
199+
) -> "_models.ContainerAttachResponse":
200+
"""Attach to the output of a specific container instance.
201+
202+
Attach to the output stream of a specific container instance in a specified resource group and
203+
container group.
204+
205+
:param resource_group_name: The name of the resource group.
206+
:type resource_group_name: str
207+
:param container_group_name: The name of the container group.
208+
:type container_group_name: str
209+
:param container_name: The name of the container instance.
210+
:type container_name: str
211+
:keyword callable cls: A custom type or function that will be passed the direct response
212+
:return: ContainerAttachResponse, or the result of cls(response)
213+
:rtype: ~azure.mgmt.containerinstance.models.ContainerAttachResponse
214+
:raises: ~azure.core.exceptions.HttpResponseError
215+
"""
216+
cls = kwargs.pop('cls', None) # type: ClsType["_models.ContainerAttachResponse"]
217+
error_map = {
218+
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
219+
}
220+
error_map.update(kwargs.pop('error_map', {}))
221+
api_version = "2021-03-01"
222+
accept = "application/json"
223+
224+
# Construct URL
225+
url = self.attach.metadata['url'] # type: ignore
226+
path_format_arguments = {
227+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
228+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
229+
'containerGroupName': self._serialize.url("container_group_name", container_group_name, 'str'),
230+
'containerName': self._serialize.url("container_name", container_name, 'str'),
231+
}
232+
url = self._client.format_url(url, **path_format_arguments)
233+
234+
# Construct parameters
235+
query_parameters = {} # type: Dict[str, Any]
236+
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
237+
238+
# Construct headers
239+
header_parameters = {} # type: Dict[str, Any]
240+
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
241+
242+
request = self._client.post(url, query_parameters, header_parameters)
243+
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
244+
response = pipeline_response.http_response
245+
246+
if response.status_code not in [200]:
247+
map_error(status_code=response.status_code, response=response, error_map=error_map)
248+
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
249+
250+
deserialized = self._deserialize('ContainerAttachResponse', pipeline_response)
251+
252+
if cls:
253+
return cls(pipeline_response, deserialized, {})
254+
255+
return deserialized
256+
attach.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach'} # type: ignore

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def list_usage(
6060
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6161
}
6262
error_map.update(kwargs.pop('error_map', {}))
63-
api_version = "2019-12-01"
63+
api_version = "2021-03-01"
6464
accept = "application/json"
6565

6666
def prepare_request(next_link=None):
@@ -132,7 +132,7 @@ def list_cached_images(
132132
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
133133
}
134134
error_map.update(kwargs.pop('error_map', {}))
135-
api_version = "2019-12-01"
135+
api_version = "2021-03-01"
136136
accept = "application/json"
137137

138138
def prepare_request(next_link=None):
@@ -204,7 +204,7 @@ def list_capabilities(
204204
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
205205
}
206206
error_map.update(kwargs.pop('error_map', {}))
207-
api_version = "2019-12-01"
207+
api_version = "2021-03-01"
208208
accept = "application/json"
209209

210210
def prepare_request(next_link=None):

sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def list(
5757
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
5858
}
5959
error_map.update(kwargs.pop('error_map', {}))
60-
api_version = "2019-12-01"
60+
api_version = "2021-03-01"
6161
accept = "application/json"
6262

6363
def prepare_request(next_link=None):

0 commit comments

Comments
 (0)