Skip to content

Commit 15aaa05

Browse files
authored
Generated from 360f9647ed35ff08ebb2f891c4760cd0016ea33a (#3758)
Azure Container Instance: Add start container group API
1 parent bb7509f commit 15aaa05

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

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

+81
Original file line numberDiff line numberDiff line change
@@ -632,3 +632,84 @@ def stop(
632632
client_raw_response = ClientRawResponse(None, response)
633633
return client_raw_response
634634
stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop'}
635+
636+
637+
def _start_initial(
638+
self, resource_group_name, container_group_name, custom_headers=None, raw=False, **operation_config):
639+
# Construct URL
640+
url = self.start.metadata['url']
641+
path_format_arguments = {
642+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
643+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
644+
'containerGroupName': self._serialize.url("container_group_name", container_group_name, 'str')
645+
}
646+
url = self._client.format_url(url, **path_format_arguments)
647+
648+
# Construct parameters
649+
query_parameters = {}
650+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
651+
652+
# Construct headers
653+
header_parameters = {}
654+
if self.config.generate_client_request_id:
655+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
656+
if custom_headers:
657+
header_parameters.update(custom_headers)
658+
if self.config.accept_language is not None:
659+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
660+
661+
# Construct and send request
662+
request = self._client.post(url, query_parameters, header_parameters)
663+
response = self._client.send(request, stream=False, **operation_config)
664+
665+
if response.status_code not in [204]:
666+
exp = CloudError(response)
667+
exp.request_id = response.headers.get('x-ms-request-id')
668+
raise exp
669+
670+
if raw:
671+
client_raw_response = ClientRawResponse(None, response)
672+
return client_raw_response
673+
674+
def start(
675+
self, resource_group_name, container_group_name, custom_headers=None, raw=False, polling=True, **operation_config):
676+
"""Starts all containers in a container group.
677+
678+
Starts all containers in a container group.
679+
680+
:param resource_group_name: The name of the resource group.
681+
:type resource_group_name: str
682+
:param container_group_name: The name of the container group.
683+
:type container_group_name: str
684+
:param dict custom_headers: headers that will be added to the request
685+
:param bool raw: The poller return type is ClientRawResponse, the
686+
direct response alongside the deserialized response
687+
:param polling: True for ARMPolling, False for no polling, or a
688+
polling object for personal polling strategy
689+
:return: An instance of LROPoller that returns None or
690+
ClientRawResponse<None> if raw==True
691+
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
692+
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
693+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
694+
"""
695+
raw_result = self._start_initial(
696+
resource_group_name=resource_group_name,
697+
container_group_name=container_group_name,
698+
custom_headers=custom_headers,
699+
raw=True,
700+
**operation_config
701+
)
702+
703+
def get_long_running_output(response):
704+
if raw:
705+
client_raw_response = ClientRawResponse(None, response)
706+
return client_raw_response
707+
708+
lro_delay = operation_config.get(
709+
'long_running_operation_timeout',
710+
self.config.long_running_operation_timeout)
711+
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
712+
elif polling is False: polling_method = NoPolling()
713+
else: polling_method = polling
714+
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
715+
start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start'}

azure-mgmt-containerinstance/azure/mgmt/containerinstance/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
VERSION = "1.3.0"
12+
VERSION = "1.0.0"
1313

0 commit comments

Comments
 (0)