body
stringlengths 26
98.2k
| body_hash
int64 -9,222,864,604,528,158,000
9,221,803,474B
| docstring
stringlengths 1
16.8k
| path
stringlengths 5
230
| name
stringlengths 1
96
| repository_name
stringlengths 7
89
| lang
stringclasses 1
value | body_without_docstring
stringlengths 20
98.2k
|
---|---|---|---|---|---|---|---|
@distributed_trace_async
async def export_template_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param scope: The scope of a deployment.\n :type scope: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_at_scope_request(scope=scope, deployment_name=deployment_name, api_version=api_version, template_url=self.export_template_at_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -5,967,444,359,698,686,000 | Exports the template used for specified deployment.
:param scope: The scope of a deployment.
:type scope: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentExportResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | export_template_at_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def export_template_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param scope: The scope of a deployment.\n :type scope: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_at_scope_request(scope=scope, deployment_name=deployment_name, api_version=api_version, template_url=self.export_template_at_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_at_scope(self, scope: str, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments at the given scope.\n\n :param scope: The scope of a deployment.\n :type scope: str\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_at_scope_request(scope=scope, api_version=api_version, filter=filter, top=top, template_url=self.list_at_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_at_scope_request(scope=scope, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | -1,940,040,283,598,648,000 | Get all the deployments at the given scope.
:param scope: The scope of a deployment.
:type scope: str
:param filter: The filter to apply on the operation. For example, you can use
$filter=provisioningState eq '{state}'. Default value is None.
:type filter: str
:param top: The number of results to get. If null is passed, returns all deployments. Default
value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_at_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_at_scope(self, scope: str, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments at the given scope.\n\n :param scope: The scope of a deployment.\n :type scope: str\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_at_scope_request(scope=scope, api_version=api_version, filter=filter, top=top, template_url=self.list_at_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_at_scope_request(scope=scope, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a deployment from the deployment history.\n\n A template deployment that is currently running cannot be deleted. Deleting a template\n deployment removes the associated deployment operations. This is an asynchronous operation that\n returns a status of 202 until the template deployment is successfully deleted. The Location\n response header contains the URI that is used to obtain the status of the process. While the\n process is running, a call to the URI in the Location header returns a status of 202. When the\n process finishes, the URI in the Location header returns a status of 204 on success. If the\n asynchronous request failed, the URI in the Location header returns an error-level status code.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_at_tenant_scope_initial(deployment_name=deployment_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 2,529,955,481,961,169,400 | Deletes a deployment from the deployment history.
A template deployment that is currently running cannot be deleted. Deleting a template
deployment removes the associated deployment operations. This is an asynchronous operation that
returns a status of 202 until the template deployment is successfully deleted. The Location
response header contains the URI that is used to obtain the status of the process. While the
process is running, a call to the URI in the Location header returns a status of 202. When the
process finishes, the URI in the Location header returns a status of 204 on success. If the
asynchronous request failed, the URI in the Location header returns an error-level status code.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_delete_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a deployment from the deployment history.\n\n A template deployment that is currently running cannot be deleted. Deleting a template\n deployment removes the associated deployment operations. This is an asynchronous operation that\n returns a status of 202 until the template deployment is successfully deleted. The Location\n response header contains the URI that is used to obtain the status of the process. While the\n process is running, a call to the URI in the Location header returns a status of 202. When the\n process finishes, the URI in the Location header returns a status of 204 on success. If the\n asynchronous request failed, the URI in the Location header returns an error-level status code.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_at_tenant_scope_initial(deployment_name=deployment_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> bool:
'Checks whether the deployment exists.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_check_existence_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.check_existence_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) | -1,091,770,316,583,379,300 | Checks whether the deployment exists.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: bool, or the result of cls(response)
:rtype: bool
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | check_existence_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> bool:
'Checks whether the deployment exists.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_check_existence_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.check_existence_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) |
@distributed_trace_async
async def begin_create_or_update_at_tenant_scope(self, deployment_name: str, parameters: '_models.ScopedDeployment', **kwargs: Any) -> AsyncLROPoller['_models.DeploymentExtended']:
'Deploys resources at tenant scope.\n\n You can provide the template and parameters directly in the request or link to JSON files.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Additional parameters supplied to the operation.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_at_tenant_scope_initial(deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | -4,122,528,066,057,727,500 | Deploys resources at tenant scope.
You can provide the template and parameters directly in the request or link to JSON files.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Additional parameters supplied to the operation.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_create_or_update_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_create_or_update_at_tenant_scope(self, deployment_name: str, parameters: '_models.ScopedDeployment', **kwargs: Any) -> AsyncLROPoller['_models.DeploymentExtended']:
'Deploys resources at tenant scope.\n\n You can provide the template and parameters directly in the request or link to JSON files.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Additional parameters supplied to the operation.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_at_tenant_scope_initial(deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExtended':
'Gets a deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExtended, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_get_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.get_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -6,662,055,147,283,266,000 | Gets a deployment.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentExtended, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExtended':
'Gets a deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExtended, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_get_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.get_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
'Cancels a currently running template deployment.\n\n You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n deployment stops the currently running template deployment and leaves the resources partially\n deployed.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_cancel_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.cancel_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) | -119,724,416,851,238,180 | Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
deployment is canceled, the provisioningState is set to Canceled. Canceling a template
deployment stops the currently running template deployment and leaves the resources partially
deployed.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | cancel_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
'Cancels a currently running template deployment.\n\n You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n deployment stops the currently running template deployment and leaves the resources partially\n deployed.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_cancel_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.cancel_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) |
@distributed_trace_async
async def validate_at_tenant_scope(self, deployment_name: str, parameters: '_models.ScopedDeployment', **kwargs: Any) -> '_models.DeploymentValidateResult':
'Validates whether the specified template is syntactically correct and will be accepted by Azure\n Resource Manager..\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentValidateResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'ScopedDeployment')
request = build_deployments_validate_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, content_type=content_type, json=_json, template_url=self.validate_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 400]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if (response.status_code == 400):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -454,183,006,928,972,160 | Validates whether the specified template is syntactically correct and will be accepted by Azure
Resource Manager..
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Parameters to validate.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentValidateResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | validate_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def validate_at_tenant_scope(self, deployment_name: str, parameters: '_models.ScopedDeployment', **kwargs: Any) -> '_models.DeploymentValidateResult':
'Validates whether the specified template is syntactically correct and will be accepted by Azure\n Resource Manager..\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentValidateResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'ScopedDeployment')
request = build_deployments_validate_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, content_type=content_type, json=_json, template_url=self.validate_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 400]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if (response.status_code == 400):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.export_template_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 6,851,045,788,325,881,000 | Exports the template used for specified deployment.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentExportResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | export_template_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.export_template_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_at_tenant_scope(self, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments at the tenant scope.\n\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_at_tenant_scope_request(api_version=api_version, filter=filter, top=top, template_url=self.list_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_at_tenant_scope_request(template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | -1,685,512,031,179,623,000 | Get all the deployments at the tenant scope.
:param filter: The filter to apply on the operation. For example, you can use
$filter=provisioningState eq '{state}'. Default value is None.
:type filter: str
:param top: The number of results to get. If null is passed, returns all deployments. Default
value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_at_tenant_scope(self, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments at the tenant scope.\n\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_at_tenant_scope_request(api_version=api_version, filter=filter, top=top, template_url=self.list_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_at_tenant_scope_request(template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def begin_delete_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a deployment from the deployment history.\n\n A template deployment that is currently running cannot be deleted. Deleting a template\n deployment removes the associated deployment operations. This is an asynchronous operation that\n returns a status of 202 until the template deployment is successfully deleted. The Location\n response header contains the URI that is used to obtain the status of the process. While the\n process is running, a call to the URI in the Location header returns a status of 202. When the\n process finishes, the URI in the Location header returns a status of 204 on success. If the\n asynchronous request failed, the URI in the Location header returns an error-level status code.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_at_management_group_scope_initial(group_id=group_id, deployment_name=deployment_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | -3,488,062,729,575,821,300 | Deletes a deployment from the deployment history.
A template deployment that is currently running cannot be deleted. Deleting a template
deployment removes the associated deployment operations. This is an asynchronous operation that
returns a status of 202 until the template deployment is successfully deleted. The Location
response header contains the URI that is used to obtain the status of the process. While the
process is running, a call to the URI in the Location header returns a status of 202. When the
process finishes, the URI in the Location header returns a status of 204 on success. If the
asynchronous request failed, the URI in the Location header returns an error-level status code.
:param group_id: The management group ID.
:type group_id: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_delete_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_delete_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a deployment from the deployment history.\n\n A template deployment that is currently running cannot be deleted. Deleting a template\n deployment removes the associated deployment operations. This is an asynchronous operation that\n returns a status of 202 until the template deployment is successfully deleted. The Location\n response header contains the URI that is used to obtain the status of the process. While the\n process is running, a call to the URI in the Location header returns a status of 202. When the\n process finishes, the URI in the Location header returns a status of 204 on success. If the\n asynchronous request failed, the URI in the Location header returns an error-level status code.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_at_management_group_scope_initial(group_id=group_id, deployment_name=deployment_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def check_existence_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> bool:
'Checks whether the deployment exists.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_check_existence_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, template_url=self.check_existence_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) | 1,830,930,494,163,189,200 | Checks whether the deployment exists.
:param group_id: The management group ID.
:type group_id: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: bool, or the result of cls(response)
:rtype: bool
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | check_existence_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def check_existence_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> bool:
'Checks whether the deployment exists.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_check_existence_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, template_url=self.check_existence_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) |
@distributed_trace_async
async def begin_create_or_update_at_management_group_scope(self, group_id: str, deployment_name: str, parameters: '_models.ScopedDeployment', **kwargs: Any) -> AsyncLROPoller['_models.DeploymentExtended']:
'Deploys resources at management group scope.\n\n You can provide the template and parameters directly in the request or link to JSON files.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Additional parameters supplied to the operation.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_at_management_group_scope_initial(group_id=group_id, deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 5,926,000,422,071,736,000 | Deploys resources at management group scope.
You can provide the template and parameters directly in the request or link to JSON files.
:param group_id: The management group ID.
:type group_id: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Additional parameters supplied to the operation.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_create_or_update_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_create_or_update_at_management_group_scope(self, group_id: str, deployment_name: str, parameters: '_models.ScopedDeployment', **kwargs: Any) -> AsyncLROPoller['_models.DeploymentExtended']:
'Deploys resources at management group scope.\n\n You can provide the template and parameters directly in the request or link to JSON files.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Additional parameters supplied to the operation.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_at_management_group_scope_initial(group_id=group_id, deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def get_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExtended':
'Gets a deployment.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExtended, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_get_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, template_url=self.get_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 5,293,605,042,126,691,000 | Gets a deployment.
:param group_id: The management group ID.
:type group_id: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentExtended, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExtended':
'Gets a deployment.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExtended, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_get_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, template_url=self.get_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
'Cancels a currently running template deployment.\n\n You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n deployment stops the currently running template deployment and leaves the resources partially\n deployed.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_cancel_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, template_url=self.cancel_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) | 3,932,999,452,919,411,700 | Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
deployment is canceled, the provisioningState is set to Canceled. Canceling a template
deployment stops the currently running template deployment and leaves the resources partially
deployed.
:param group_id: The management group ID.
:type group_id: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | cancel_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
'Cancels a currently running template deployment.\n\n You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n deployment stops the currently running template deployment and leaves the resources partially\n deployed.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_cancel_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, template_url=self.cancel_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) |
@distributed_trace_async
async def validate_at_management_group_scope(self, group_id: str, deployment_name: str, parameters: '_models.ScopedDeployment', **kwargs: Any) -> '_models.DeploymentValidateResult':
'Validates whether the specified template is syntactically correct and will be accepted by Azure\n Resource Manager..\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentValidateResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'ScopedDeployment')
request = build_deployments_validate_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, content_type=content_type, json=_json, template_url=self.validate_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 400]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if (response.status_code == 400):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -1,673,885,904,297,715,500 | Validates whether the specified template is syntactically correct and will be accepted by Azure
Resource Manager..
:param group_id: The management group ID.
:type group_id: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Parameters to validate.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentValidateResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | validate_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def validate_at_management_group_scope(self, group_id: str, deployment_name: str, parameters: '_models.ScopedDeployment', **kwargs: Any) -> '_models.DeploymentValidateResult':
'Validates whether the specified template is syntactically correct and will be accepted by Azure\n Resource Manager..\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ScopedDeployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentValidateResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'ScopedDeployment')
request = build_deployments_validate_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, content_type=content_type, json=_json, template_url=self.validate_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 400]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if (response.status_code == 400):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def export_template_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, template_url=self.export_template_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 5,723,905,621,695,796,000 | Exports the template used for specified deployment.
:param group_id: The management group ID.
:type group_id: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentExportResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | export_template_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def export_template_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, template_url=self.export_template_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_at_management_group_scope(self, group_id: str, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments for a management group.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_at_management_group_scope_request(group_id=group_id, api_version=api_version, filter=filter, top=top, template_url=self.list_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_at_management_group_scope_request(group_id=group_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 4,591,285,809,376,135,000 | Get all the deployments for a management group.
:param group_id: The management group ID.
:type group_id: str
:param filter: The filter to apply on the operation. For example, you can use
$filter=provisioningState eq '{state}'. Default value is None.
:type filter: str
:param top: The number of results to get. If null is passed, returns all deployments. Default
value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_at_management_group_scope(self, group_id: str, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments for a management group.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_at_management_group_scope_request(group_id=group_id, api_version=api_version, filter=filter, top=top, template_url=self.list_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_at_management_group_scope_request(group_id=group_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a deployment from the deployment history.\n\n A template deployment that is currently running cannot be deleted. Deleting a template\n deployment removes the associated deployment operations. This is an asynchronous operation that\n returns a status of 202 until the template deployment is successfully deleted. The Location\n response header contains the URI that is used to obtain the status of the process. While the\n process is running, a call to the URI in the Location header returns a status of 202. When the\n process finishes, the URI in the Location header returns a status of 204 on success. If the\n asynchronous request failed, the URI in the Location header returns an error-level status code.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_at_subscription_scope_initial(deployment_name=deployment_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | -3,850,553,516,541,032,000 | Deletes a deployment from the deployment history.
A template deployment that is currently running cannot be deleted. Deleting a template
deployment removes the associated deployment operations. This is an asynchronous operation that
returns a status of 202 until the template deployment is successfully deleted. The Location
response header contains the URI that is used to obtain the status of the process. While the
process is running, a call to the URI in the Location header returns a status of 202. When the
process finishes, the URI in the Location header returns a status of 204 on success. If the
asynchronous request failed, the URI in the Location header returns an error-level status code.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_delete_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a deployment from the deployment history.\n\n A template deployment that is currently running cannot be deleted. Deleting a template\n deployment removes the associated deployment operations. This is an asynchronous operation that\n returns a status of 202 until the template deployment is successfully deleted. The Location\n response header contains the URI that is used to obtain the status of the process. While the\n process is running, a call to the URI in the Location header returns a status of 202. When the\n process finishes, the URI in the Location header returns a status of 204 on success. If the\n asynchronous request failed, the URI in the Location header returns an error-level status code.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_at_subscription_scope_initial(deployment_name=deployment_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> bool:
'Checks whether the deployment exists.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_check_existence_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.check_existence_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) | -603,013,656,997,926,700 | Checks whether the deployment exists.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: bool, or the result of cls(response)
:rtype: bool
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | check_existence_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> bool:
'Checks whether the deployment exists.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_check_existence_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.check_existence_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) |
@distributed_trace_async
async def begin_create_or_update_at_subscription_scope(self, deployment_name: str, parameters: '_models.Deployment', **kwargs: Any) -> AsyncLROPoller['_models.DeploymentExtended']:
'Deploys resources at subscription scope.\n\n You can provide the template and parameters directly in the request or link to JSON files.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Additional parameters supplied to the operation.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_at_subscription_scope_initial(deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 49,377,543,154,765,530 | Deploys resources at subscription scope.
You can provide the template and parameters directly in the request or link to JSON files.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Additional parameters supplied to the operation.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_create_or_update_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_create_or_update_at_subscription_scope(self, deployment_name: str, parameters: '_models.Deployment', **kwargs: Any) -> AsyncLROPoller['_models.DeploymentExtended']:
'Deploys resources at subscription scope.\n\n You can provide the template and parameters directly in the request or link to JSON files.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Additional parameters supplied to the operation.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_at_subscription_scope_initial(deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExtended':
'Gets a deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExtended, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_get_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 4,093,246,918,404,920,000 | Gets a deployment.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentExtended, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExtended':
'Gets a deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExtended, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_get_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
'Cancels a currently running template deployment.\n\n You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n deployment stops the currently running template deployment and leaves the resources partially\n deployed.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_cancel_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.cancel_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) | 2,993,399,675,028,468,700 | Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
deployment is canceled, the provisioningState is set to Canceled. Canceling a template
deployment stops the currently running template deployment and leaves the resources partially
deployed.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | cancel_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
'Cancels a currently running template deployment.\n\n You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n deployment stops the currently running template deployment and leaves the resources partially\n deployed.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_cancel_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.cancel_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) |
@distributed_trace_async
async def validate_at_subscription_scope(self, deployment_name: str, parameters: '_models.Deployment', **kwargs: Any) -> '_models.DeploymentValidateResult':
'Validates whether the specified template is syntactically correct and will be accepted by Azure\n Resource Manager..\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentValidateResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'Deployment')
request = build_deployments_validate_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.validate_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 400]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if (response.status_code == 400):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -5,542,345,338,631,738,000 | Validates whether the specified template is syntactically correct and will be accepted by Azure
Resource Manager..
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Parameters to validate.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentValidateResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | validate_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def validate_at_subscription_scope(self, deployment_name: str, parameters: '_models.Deployment', **kwargs: Any) -> '_models.DeploymentValidateResult':
'Validates whether the specified template is syntactically correct and will be accepted by Azure\n Resource Manager..\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentValidateResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'Deployment')
request = build_deployments_validate_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.validate_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 400]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if (response.status_code == 400):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def begin_what_if_at_subscription_scope(self, deployment_name: str, parameters: '_models.DeploymentWhatIf', **kwargs: Any) -> AsyncLROPoller['_models.WhatIfOperationResult']:
'Returns changes that will be made by the deployment if executed at the scope of the\n subscription.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to What If.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentWhatIf\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result\n of cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.WhatIfOperationResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._what_if_at_subscription_scope_initial(deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('WhatIfOperationResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | -7,152,854,858,173,177,000 | Returns changes that will be made by the deployment if executed at the scope of the
subscription.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Parameters to What If.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentWhatIf
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.WhatIfOperationResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_what_if_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_what_if_at_subscription_scope(self, deployment_name: str, parameters: '_models.DeploymentWhatIf', **kwargs: Any) -> AsyncLROPoller['_models.WhatIfOperationResult']:
'Returns changes that will be made by the deployment if executed at the scope of the\n subscription.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to What If.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentWhatIf\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result\n of cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.WhatIfOperationResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._what_if_at_subscription_scope_initial(deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('WhatIfOperationResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def export_template_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.export_template_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 3,650,925,487,927,149,000 | Exports the template used for specified deployment.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentExportResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | export_template_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def export_template_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.export_template_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_at_subscription_scope(self, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments for a subscription.\n\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_at_subscription_scope_request(subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, top=top, template_url=self.list_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_at_subscription_scope_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 4,056,206,940,501,431,300 | Get all the deployments for a subscription.
:param filter: The filter to apply on the operation. For example, you can use
$filter=provisioningState eq '{state}'. Default value is None.
:type filter: str
:param top: The number of results to get. If null is passed, returns all deployments. Default
value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_at_subscription_scope(self, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments for a subscription.\n\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_at_subscription_scope_request(subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, top=top, template_url=self.list_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_at_subscription_scope_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a deployment from the deployment history.\n\n A template deployment that is currently running cannot be deleted. Deleting a template\n deployment removes the associated deployment operations. Deleting a template deployment does\n not affect the state of the resource group. This is an asynchronous operation that returns a\n status of 202 until the template deployment is successfully deleted. The Location response\n header contains the URI that is used to obtain the status of the process. While the process is\n running, a call to the URI in the Location header returns a status of 202. When the process\n finishes, the URI in the Location header returns a status of 204 on success. If the\n asynchronous request failed, the URI in the Location header returns an error-level status code.\n\n :param resource_group_name: The name of the resource group with the deployment to delete. The\n name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_initial(resource_group_name=resource_group_name, deployment_name=deployment_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | -2,801,076,519,298,536,400 | Deletes a deployment from the deployment history.
A template deployment that is currently running cannot be deleted. Deleting a template
deployment removes the associated deployment operations. Deleting a template deployment does
not affect the state of the resource group. This is an asynchronous operation that returns a
status of 202 until the template deployment is successfully deleted. The Location response
header contains the URI that is used to obtain the status of the process. While the process is
running, a call to the URI in the Location header returns a status of 202. When the process
finishes, the URI in the Location header returns a status of 204 on success. If the
asynchronous request failed, the URI in the Location header returns an error-level status code.
:param resource_group_name: The name of the resource group with the deployment to delete. The
name is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_delete | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a deployment from the deployment history.\n\n A template deployment that is currently running cannot be deleted. Deleting a template\n deployment removes the associated deployment operations. Deleting a template deployment does\n not affect the state of the resource group. This is an asynchronous operation that returns a\n status of 202 until the template deployment is successfully deleted. The Location response\n header contains the URI that is used to obtain the status of the process. While the process is\n running, a call to the URI in the Location header returns a status of 202. When the process\n finishes, the URI in the Location header returns a status of 204 on success. If the\n asynchronous request failed, the URI in the Location header returns an error-level status code.\n\n :param resource_group_name: The name of the resource group with the deployment to delete. The\n name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_initial(resource_group_name=resource_group_name, deployment_name=deployment_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def check_existence(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> bool:
'Checks whether the deployment exists.\n\n :param resource_group_name: The name of the resource group with the deployment to check. The\n name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_check_existence_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.check_existence.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) | -4,889,340,746,919,436,000 | Checks whether the deployment exists.
:param resource_group_name: The name of the resource group with the deployment to check. The
name is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: bool, or the result of cls(response)
:rtype: bool
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | check_existence | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def check_existence(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> bool:
'Checks whether the deployment exists.\n\n :param resource_group_name: The name of the resource group with the deployment to check. The\n name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_check_existence_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.check_existence.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) |
@distributed_trace_async
async def begin_create_or_update(self, resource_group_name: str, deployment_name: str, parameters: '_models.Deployment', **kwargs: Any) -> AsyncLROPoller['_models.DeploymentExtended']:
'Deploys resources to a resource group.\n\n You can provide the template and parameters directly in the request or link to JSON files.\n\n :param resource_group_name: The name of the resource group to deploy the resources to. The name\n is case insensitive. The resource group must already exist.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Additional parameters supplied to the operation.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_initial(resource_group_name=resource_group_name, deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 1,888,048,510,984,597,000 | Deploys resources to a resource group.
You can provide the template and parameters directly in the request or link to JSON files.
:param resource_group_name: The name of the resource group to deploy the resources to. The name
is case insensitive. The resource group must already exist.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Additional parameters supplied to the operation.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_create_or_update | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_create_or_update(self, resource_group_name: str, deployment_name: str, parameters: '_models.Deployment', **kwargs: Any) -> AsyncLROPoller['_models.DeploymentExtended']:
'Deploys resources to a resource group.\n\n You can provide the template and parameters directly in the request or link to JSON files.\n\n :param resource_group_name: The name of the resource group to deploy the resources to. The name\n is case insensitive. The resource group must already exist.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Additional parameters supplied to the operation.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_initial(resource_group_name=resource_group_name, deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExtended':
'Gets a deployment.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExtended, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_get_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 4,690,986,231,256,878,000 | Gets a deployment.
:param resource_group_name: The name of the resource group. The name is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentExtended, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExtended':
'Gets a deployment.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExtended, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_get_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExtended', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
'Cancels a currently running template deployment.\n\n You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n deployment stops the currently running template deployment and leaves the resource group\n partially deployed.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_cancel_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.cancel.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) | -3,968,857,488,888,834,000 | Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
deployment is canceled, the provisioningState is set to Canceled. Canceling a template
deployment stops the currently running template deployment and leaves the resource group
partially deployed.
:param resource_group_name: The name of the resource group. The name is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | cancel | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
'Cancels a currently running template deployment.\n\n You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n deployment stops the currently running template deployment and leaves the resource group\n partially deployed.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_cancel_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.cancel.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) |
@distributed_trace_async
async def validate(self, resource_group_name: str, deployment_name: str, parameters: '_models.Deployment', **kwargs: Any) -> '_models.DeploymentValidateResult':
'Validates whether the specified template is syntactically correct and will be accepted by Azure\n Resource Manager..\n\n :param resource_group_name: The name of the resource group the template will be deployed to.\n The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentValidateResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'Deployment')
request = build_deployments_validate_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.validate.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 400]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if (response.status_code == 400):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -6,040,123,090,855,222,000 | Validates whether the specified template is syntactically correct and will be accepted by Azure
Resource Manager..
:param resource_group_name: The name of the resource group the template will be deployed to.
The name is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Parameters to validate.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentValidateResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | validate | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def validate(self, resource_group_name: str, deployment_name: str, parameters: '_models.Deployment', **kwargs: Any) -> '_models.DeploymentValidateResult':
'Validates whether the specified template is syntactically correct and will be accepted by Azure\n Resource Manager..\n\n :param resource_group_name: The name of the resource group the template will be deployed to.\n The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.Deployment\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentValidateResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'Deployment')
request = build_deployments_validate_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.validate.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 400]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if (response.status_code == 400):
deserialized = self._deserialize('DeploymentValidateResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def begin_what_if(self, resource_group_name: str, deployment_name: str, parameters: '_models.DeploymentWhatIf', **kwargs: Any) -> AsyncLROPoller['_models.WhatIfOperationResult']:
'Returns changes that will be made by the deployment if executed at the scope of the resource\n group.\n\n :param resource_group_name: The name of the resource group the template will be deployed to.\n The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentWhatIf\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result\n of cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.WhatIfOperationResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._what_if_initial(resource_group_name=resource_group_name, deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('WhatIfOperationResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 1,938,095,169,450,362,600 | Returns changes that will be made by the deployment if executed at the scope of the resource
group.
:param resource_group_name: The name of the resource group the template will be deployed to.
The name is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param parameters: Parameters to validate.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentWhatIf
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.WhatIfOperationResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_what_if | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_what_if(self, resource_group_name: str, deployment_name: str, parameters: '_models.DeploymentWhatIf', **kwargs: Any) -> AsyncLROPoller['_models.WhatIfOperationResult']:
'Returns changes that will be made by the deployment if executed at the scope of the resource\n group.\n\n :param resource_group_name: The name of the resource group the template will be deployed to.\n The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param parameters: Parameters to validate.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentWhatIf\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result\n of cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.WhatIfOperationResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._what_if_initial(resource_group_name=resource_group_name, deployment_name=deployment_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('WhatIfOperationResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def export_template(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.export_template.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 4,771,757,875,697,959,000 | Exports the template used for specified deployment.
:param resource_group_name: The name of the resource group. The name is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentExportResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | export_template | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def export_template(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> '_models.DeploymentExportResult':
'Exports the template used for specified deployment.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentExportResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployments_export_template_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.export_template.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_by_resource_group(self, resource_group_name: str, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments for a resource group.\n\n :param resource_group_name: The name of the resource group with the deployments to get. The\n name is case insensitive.\n :type resource_group_name: str\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_by_resource_group_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, top=top, template_url=self.list_by_resource_group.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_by_resource_group_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 1,863,758,226,716,605,200 | Get all the deployments for a resource group.
:param resource_group_name: The name of the resource group with the deployments to get. The
name is case insensitive.
:type resource_group_name: str
:param filter: The filter to apply on the operation. For example, you can use
$filter=provisioningState eq '{state}'. Default value is None.
:type filter: str
:param top: The number of results to get. If null is passed, returns all deployments. Default
value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_by_resource_group | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_by_resource_group(self, resource_group_name: str, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentListResult']:
"Get all the deployments for a resource group.\n\n :param resource_group_name: The name of the resource group with the deployments to get. The\n name is case insensitive.\n :type resource_group_name: str\n :param filter: The filter to apply on the operation. For example, you can use\n $filter=provisioningState eq '{state}'. Default value is None.\n :type filter: str\n :param top: The number of results to get. If null is passed, returns all deployments. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployments_list_by_resource_group_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, top=top, template_url=self.list_by_resource_group.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployments_list_by_resource_group_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def calculate_template_hash(self, template: Any, **kwargs: Any) -> '_models.TemplateHashResult':
'Calculate the hash of the given template.\n\n :param template: The template provided to calculate hash.\n :type template: any\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: TemplateHashResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TemplateHashResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(template, 'object')
request = build_deployments_calculate_template_hash_request(api_version=api_version, content_type=content_type, json=_json, template_url=self.calculate_template_hash.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('TemplateHashResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -1,916,146,662,565,270,300 | Calculate the hash of the given template.
:param template: The template provided to calculate hash.
:type template: any
:keyword callable cls: A custom type or function that will be passed the direct response
:return: TemplateHashResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TemplateHashResult
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | calculate_template_hash | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def calculate_template_hash(self, template: Any, **kwargs: Any) -> '_models.TemplateHashResult':
'Calculate the hash of the given template.\n\n :param template: The template provided to calculate hash.\n :type template: any\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: TemplateHashResult, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TemplateHashResult\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(template, 'object')
request = build_deployments_calculate_template_hash_request(api_version=api_version, content_type=content_type, json=_json, template_url=self.calculate_template_hash.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('TemplateHashResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> '_models.Provider':
'Unregisters a subscription from a resource provider.\n\n :param resource_provider_namespace: The namespace of the resource provider to unregister.\n :type resource_provider_namespace: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: Provider, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_providers_unregister_request(resource_provider_namespace=resource_provider_namespace, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.unregister.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Provider', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -2,968,052,756,689,409,000 | Unregisters a subscription from a resource provider.
:param resource_provider_namespace: The namespace of the resource provider to unregister.
:type resource_provider_namespace: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Provider, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | unregister | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> '_models.Provider':
'Unregisters a subscription from a resource provider.\n\n :param resource_provider_namespace: The namespace of the resource provider to unregister.\n :type resource_provider_namespace: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: Provider, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_providers_unregister_request(resource_provider_namespace=resource_provider_namespace, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.unregister.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Provider', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def register(self, resource_provider_namespace: str, **kwargs: Any) -> '_models.Provider':
'Registers a subscription with a resource provider.\n\n :param resource_provider_namespace: The namespace of the resource provider to register.\n :type resource_provider_namespace: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: Provider, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_providers_register_request(resource_provider_namespace=resource_provider_namespace, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.register.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Provider', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -7,865,524,866,861,684,000 | Registers a subscription with a resource provider.
:param resource_provider_namespace: The namespace of the resource provider to register.
:type resource_provider_namespace: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Provider, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | register | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def register(self, resource_provider_namespace: str, **kwargs: Any) -> '_models.Provider':
'Registers a subscription with a resource provider.\n\n :param resource_provider_namespace: The namespace of the resource provider to register.\n :type resource_provider_namespace: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: Provider, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_providers_register_request(resource_provider_namespace=resource_provider_namespace, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.register.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Provider', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list(self, top: Optional[int]=None, expand: Optional[str]=None, **kwargs: Any) -> AsyncIterable['_models.ProviderListResult']:
'Gets all resource providers for a subscription.\n\n :param top: The number of results to return. If null is passed returns all deployments. Default\n value is None.\n :type top: int\n :param expand: The properties to include in the results. For example, use &$expand=metadata in\n the query string to retrieve resource provider metadata. To include property aliases in\n response, use $expand=resourceTypes/aliases. Default value is None.\n :type expand: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ProviderListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ProviderListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_providers_list_request(subscription_id=self._config.subscription_id, api_version=api_version, top=top, expand=expand, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_providers_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ProviderListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 9,032,360,935,932,921,000 | Gets all resource providers for a subscription.
:param top: The number of results to return. If null is passed returns all deployments. Default
value is None.
:type top: int
:param expand: The properties to include in the results. For example, use &$expand=metadata in
the query string to retrieve resource provider metadata. To include property aliases in
response, use $expand=resourceTypes/aliases. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ProviderListResult or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ProviderListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list(self, top: Optional[int]=None, expand: Optional[str]=None, **kwargs: Any) -> AsyncIterable['_models.ProviderListResult']:
'Gets all resource providers for a subscription.\n\n :param top: The number of results to return. If null is passed returns all deployments. Default\n value is None.\n :type top: int\n :param expand: The properties to include in the results. For example, use &$expand=metadata in\n the query string to retrieve resource provider metadata. To include property aliases in\n response, use $expand=resourceTypes/aliases. Default value is None.\n :type expand: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ProviderListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ProviderListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_providers_list_request(subscription_id=self._config.subscription_id, api_version=api_version, top=top, expand=expand, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_providers_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ProviderListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace
def list_at_tenant_scope(self, top: Optional[int]=None, expand: Optional[str]=None, **kwargs: Any) -> AsyncIterable['_models.ProviderListResult']:
'Gets all resource providers for the tenant.\n\n :param top: The number of results to return. If null is passed returns all providers. Default\n value is None.\n :type top: int\n :param expand: The properties to include in the results. For example, use &$expand=metadata in\n the query string to retrieve resource provider metadata. To include property aliases in\n response, use $expand=resourceTypes/aliases. Default value is None.\n :type expand: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ProviderListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ProviderListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_providers_list_at_tenant_scope_request(api_version=api_version, top=top, expand=expand, template_url=self.list_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_providers_list_at_tenant_scope_request(template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ProviderListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 4,235,414,483,365,429,000 | Gets all resource providers for the tenant.
:param top: The number of results to return. If null is passed returns all providers. Default
value is None.
:type top: int
:param expand: The properties to include in the results. For example, use &$expand=metadata in
the query string to retrieve resource provider metadata. To include property aliases in
response, use $expand=resourceTypes/aliases. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ProviderListResult or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ProviderListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_at_tenant_scope(self, top: Optional[int]=None, expand: Optional[str]=None, **kwargs: Any) -> AsyncIterable['_models.ProviderListResult']:
'Gets all resource providers for the tenant.\n\n :param top: The number of results to return. If null is passed returns all providers. Default\n value is None.\n :type top: int\n :param expand: The properties to include in the results. For example, use &$expand=metadata in\n the query string to retrieve resource provider metadata. To include property aliases in\n response, use $expand=resourceTypes/aliases. Default value is None.\n :type expand: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ProviderListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ProviderListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_providers_list_at_tenant_scope_request(api_version=api_version, top=top, expand=expand, template_url=self.list_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_providers_list_at_tenant_scope_request(template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ProviderListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def get(self, resource_provider_namespace: str, expand: Optional[str]=None, **kwargs: Any) -> '_models.Provider':
'Gets the specified resource provider.\n\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param expand: The $expand query parameter. For example, to include property aliases in\n response, use $expand=resourceTypes/aliases. Default value is None.\n :type expand: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: Provider, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_providers_get_request(resource_provider_namespace=resource_provider_namespace, subscription_id=self._config.subscription_id, api_version=api_version, expand=expand, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Provider', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 4,436,238,885,857,415,000 | Gets the specified resource provider.
:param resource_provider_namespace: The namespace of the resource provider.
:type resource_provider_namespace: str
:param expand: The $expand query parameter. For example, to include property aliases in
response, use $expand=resourceTypes/aliases. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Provider, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get(self, resource_provider_namespace: str, expand: Optional[str]=None, **kwargs: Any) -> '_models.Provider':
'Gets the specified resource provider.\n\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param expand: The $expand query parameter. For example, to include property aliases in\n response, use $expand=resourceTypes/aliases. Default value is None.\n :type expand: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: Provider, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_providers_get_request(resource_provider_namespace=resource_provider_namespace, subscription_id=self._config.subscription_id, api_version=api_version, expand=expand, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Provider', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def get_at_tenant_scope(self, resource_provider_namespace: str, expand: Optional[str]=None, **kwargs: Any) -> '_models.Provider':
'Gets the specified resource provider at the tenant level.\n\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param expand: The $expand query parameter. For example, to include property aliases in\n response, use $expand=resourceTypes/aliases. Default value is None.\n :type expand: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: Provider, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_providers_get_at_tenant_scope_request(resource_provider_namespace=resource_provider_namespace, api_version=api_version, expand=expand, template_url=self.get_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Provider', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 3,148,811,126,681,976,000 | Gets the specified resource provider at the tenant level.
:param resource_provider_namespace: The namespace of the resource provider.
:type resource_provider_namespace: str
:param expand: The $expand query parameter. For example, to include property aliases in
response, use $expand=resourceTypes/aliases. Default value is None.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Provider, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get_at_tenant_scope(self, resource_provider_namespace: str, expand: Optional[str]=None, **kwargs: Any) -> '_models.Provider':
'Gets the specified resource provider at the tenant level.\n\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param expand: The $expand query parameter. For example, to include property aliases in\n response, use $expand=resourceTypes/aliases. Default value is None.\n :type expand: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: Provider, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_providers_get_at_tenant_scope_request(resource_provider_namespace=resource_provider_namespace, api_version=api_version, expand=expand, template_url=self.get_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Provider', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_by_resource_group(self, resource_group_name: str, filter: Optional[str]=None, expand: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.ResourceListResult']:
"Get all the resources for a resource group.\n\n :param resource_group_name: The resource group with the resources to get.\n :type resource_group_name: str\n :param filter: The filter to apply on the operation.:code:`<br>`:code:`<br>`The properties you\n can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup,\n identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version,\n and plan/promotionCode.:code:`<br>`:code:`<br>`For example, to filter by a resource type, use:\n $filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:`<br>`:code:`<br>`You can use\n substringof(value, property) in the filter. The properties you can use for substring are: name\n and resourceGroup.:code:`<br>`:code:`<br>`For example, to get all resources with 'demo'\n anywhere in the name, use: $filter=substringof('demo', name):code:`<br>`:code:`<br>`You can\n link more than one substringof together by adding and/or operators.:code:`<br>`:code:`<br>`You\n can filter by tag names and values. For example, to filter for a tag name and value, use\n $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value,\n the tags for each resource are not returned in the results.:code:`<br>`:code:`<br>`You can use\n some properties together when filtering. The combinations you can use are: substringof and/or\n resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default\n value is None.\n :type filter: str\n :param expand: Comma-separated list of additional properties to be included in the response.\n Valid values include ``createdTime``\\ , ``changedTime`` and ``provisioningState``. For example,\n ``$expand=createdTime,changedTime``. Default value is None.\n :type expand: str\n :param top: The number of results to return. If null is passed, returns all resources. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ResourceListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_resources_list_by_resource_group_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, expand=expand, top=top, template_url=self.list_by_resource_group.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_resources_list_by_resource_group_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ResourceListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 3,465,171,419,629,692,400 | Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get.
:type resource_group_name: str
:param filter: The filter to apply on the operation.:code:`<br>`:code:`<br>`The properties you
can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup,
identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version,
and plan/promotionCode.:code:`<br>`:code:`<br>`For example, to filter by a resource type, use:
$filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:`<br>`:code:`<br>`You can use
substringof(value, property) in the filter. The properties you can use for substring are: name
and resourceGroup.:code:`<br>`:code:`<br>`For example, to get all resources with 'demo'
anywhere in the name, use: $filter=substringof('demo', name):code:`<br>`:code:`<br>`You can
link more than one substringof together by adding and/or operators.:code:`<br>`:code:`<br>`You
can filter by tag names and values. For example, to filter for a tag name and value, use
$filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value,
the tags for each resource are not returned in the results.:code:`<br>`:code:`<br>`You can use
some properties together when filtering. The combinations you can use are: substringof and/or
resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default
value is None.
:type filter: str
:param expand: Comma-separated list of additional properties to be included in the response.
Valid values include ``createdTime``\ , ``changedTime`` and ``provisioningState``. For example,
``$expand=createdTime,changedTime``. Default value is None.
:type expand: str
:param top: The number of results to return. If null is passed, returns all resources. Default
value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ResourceListResult or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_by_resource_group | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_by_resource_group(self, resource_group_name: str, filter: Optional[str]=None, expand: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.ResourceListResult']:
"Get all the resources for a resource group.\n\n :param resource_group_name: The resource group with the resources to get.\n :type resource_group_name: str\n :param filter: The filter to apply on the operation.:code:`<br>`:code:`<br>`The properties you\n can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup,\n identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version,\n and plan/promotionCode.:code:`<br>`:code:`<br>`For example, to filter by a resource type, use:\n $filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:`<br>`:code:`<br>`You can use\n substringof(value, property) in the filter. The properties you can use for substring are: name\n and resourceGroup.:code:`<br>`:code:`<br>`For example, to get all resources with 'demo'\n anywhere in the name, use: $filter=substringof('demo', name):code:`<br>`:code:`<br>`You can\n link more than one substringof together by adding and/or operators.:code:`<br>`:code:`<br>`You\n can filter by tag names and values. For example, to filter for a tag name and value, use\n $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value,\n the tags for each resource are not returned in the results.:code:`<br>`:code:`<br>`You can use\n some properties together when filtering. The combinations you can use are: substringof and/or\n resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default\n value is None.\n :type filter: str\n :param expand: Comma-separated list of additional properties to be included in the response.\n Valid values include ``createdTime``\\ , ``changedTime`` and ``provisioningState``. For example,\n ``$expand=createdTime,changedTime``. Default value is None.\n :type expand: str\n :param top: The number of results to return. If null is passed, returns all resources. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ResourceListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_resources_list_by_resource_group_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, expand=expand, top=top, template_url=self.list_by_resource_group.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_resources_list_by_resource_group_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ResourceListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def begin_move_resources(self, source_resource_group_name: str, parameters: '_models.ResourcesMoveInfo', **kwargs: Any) -> AsyncLROPoller[None]:
'Moves resources from one resource group to another resource group.\n\n The resources to move must be in the same source resource group. The target resource group may\n be in a different subscription. When moving resources, both the source group and the target\n group are locked for the duration of the operation. Write and delete operations are blocked on\n the groups until the move completes.\n\n :param source_resource_group_name: The name of the resource group containing the resources to\n move.\n :type source_resource_group_name: str\n :param parameters: Parameters for moving resources.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourcesMoveInfo\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._move_resources_initial(source_resource_group_name=source_resource_group_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | -1,834,338,419,343,244,500 | Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may
be in a different subscription. When moving resources, both the source group and the target
group are locked for the duration of the operation. Write and delete operations are blocked on
the groups until the move completes.
:param source_resource_group_name: The name of the resource group containing the resources to
move.
:type source_resource_group_name: str
:param parameters: Parameters for moving resources.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourcesMoveInfo
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_move_resources | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_move_resources(self, source_resource_group_name: str, parameters: '_models.ResourcesMoveInfo', **kwargs: Any) -> AsyncLROPoller[None]:
'Moves resources from one resource group to another resource group.\n\n The resources to move must be in the same source resource group. The target resource group may\n be in a different subscription. When moving resources, both the source group and the target\n group are locked for the duration of the operation. Write and delete operations are blocked on\n the groups until the move completes.\n\n :param source_resource_group_name: The name of the resource group containing the resources to\n move.\n :type source_resource_group_name: str\n :param parameters: Parameters for moving resources.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourcesMoveInfo\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._move_resources_initial(source_resource_group_name=source_resource_group_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def begin_validate_move_resources(self, source_resource_group_name: str, parameters: '_models.ResourcesMoveInfo', **kwargs: Any) -> AsyncLROPoller[None]:
'Validates whether resources can be moved from one resource group to another resource group.\n\n This operation checks whether the specified resources can be moved to the target. The resources\n to move must be in the same source resource group. The target resource group may be in a\n different subscription. If validation succeeds, it returns HTTP response code 204 (no content).\n If validation fails, it returns HTTP response code 409 (Conflict) with an error message.\n Retrieve the URL in the Location header value to check the result of the long-running\n operation.\n\n :param source_resource_group_name: The name of the resource group containing the resources to\n validate for move.\n :type source_resource_group_name: str\n :param parameters: Parameters for moving resources.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourcesMoveInfo\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._validate_move_resources_initial(source_resource_group_name=source_resource_group_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 1,295,103,955,939,565,600 | Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources
to move must be in the same source resource group. The target resource group may be in a
different subscription. If validation succeeds, it returns HTTP response code 204 (no content).
If validation fails, it returns HTTP response code 409 (Conflict) with an error message.
Retrieve the URL in the Location header value to check the result of the long-running
operation.
:param source_resource_group_name: The name of the resource group containing the resources to
validate for move.
:type source_resource_group_name: str
:param parameters: Parameters for moving resources.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourcesMoveInfo
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_validate_move_resources | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_validate_move_resources(self, source_resource_group_name: str, parameters: '_models.ResourcesMoveInfo', **kwargs: Any) -> AsyncLROPoller[None]:
'Validates whether resources can be moved from one resource group to another resource group.\n\n This operation checks whether the specified resources can be moved to the target. The resources\n to move must be in the same source resource group. The target resource group may be in a\n different subscription. If validation succeeds, it returns HTTP response code 204 (no content).\n If validation fails, it returns HTTP response code 409 (Conflict) with an error message.\n Retrieve the URL in the Location header value to check the result of the long-running\n operation.\n\n :param source_resource_group_name: The name of the resource group containing the resources to\n validate for move.\n :type source_resource_group_name: str\n :param parameters: Parameters for moving resources.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourcesMoveInfo\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._validate_move_resources_initial(source_resource_group_name=source_resource_group_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace
def list(self, filter: Optional[str]=None, expand: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.ResourceListResult']:
"Get all the resources in a subscription.\n\n :param filter: The filter to apply on the operation.:code:`<br>`:code:`<br>`The properties you\n can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup,\n identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version,\n and plan/promotionCode.:code:`<br>`:code:`<br>`For example, to filter by a resource type, use:\n $filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:`<br>`:code:`<br>`You can use\n substringof(value, property) in the filter. The properties you can use for substring are: name\n and resourceGroup.:code:`<br>`:code:`<br>`For example, to get all resources with 'demo'\n anywhere in the name, use: $filter=substringof('demo', name):code:`<br>`:code:`<br>`You can\n link more than one substringof together by adding and/or operators.:code:`<br>`:code:`<br>`You\n can filter by tag names and values. For example, to filter for a tag name and value, use\n $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value,\n the tags for each resource are not returned in the results.:code:`<br>`:code:`<br>`You can use\n some properties together when filtering. The combinations you can use are: substringof and/or\n resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default\n value is None.\n :type filter: str\n :param expand: Comma-separated list of additional properties to be included in the response.\n Valid values include ``createdTime``\\ , ``changedTime`` and ``provisioningState``. For example,\n ``$expand=createdTime,changedTime``. Default value is None.\n :type expand: str\n :param top: The number of results to return. If null is passed, returns all resources. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ResourceListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_resources_list_request(subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, expand=expand, top=top, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_resources_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ResourceListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 6,971,919,292,355,769,000 | Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`<br>`:code:`<br>`The properties you
can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup,
identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version,
and plan/promotionCode.:code:`<br>`:code:`<br>`For example, to filter by a resource type, use:
$filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:`<br>`:code:`<br>`You can use
substringof(value, property) in the filter. The properties you can use for substring are: name
and resourceGroup.:code:`<br>`:code:`<br>`For example, to get all resources with 'demo'
anywhere in the name, use: $filter=substringof('demo', name):code:`<br>`:code:`<br>`You can
link more than one substringof together by adding and/or operators.:code:`<br>`:code:`<br>`You
can filter by tag names and values. For example, to filter for a tag name and value, use
$filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value,
the tags for each resource are not returned in the results.:code:`<br>`:code:`<br>`You can use
some properties together when filtering. The combinations you can use are: substringof and/or
resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default
value is None.
:type filter: str
:param expand: Comma-separated list of additional properties to be included in the response.
Valid values include ``createdTime``\ , ``changedTime`` and ``provisioningState``. For example,
``$expand=createdTime,changedTime``. Default value is None.
:type expand: str
:param top: The number of results to return. If null is passed, returns all resources. Default
value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ResourceListResult or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list(self, filter: Optional[str]=None, expand: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.ResourceListResult']:
"Get all the resources in a subscription.\n\n :param filter: The filter to apply on the operation.:code:`<br>`:code:`<br>`The properties you\n can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup,\n identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version,\n and plan/promotionCode.:code:`<br>`:code:`<br>`For example, to filter by a resource type, use:\n $filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:`<br>`:code:`<br>`You can use\n substringof(value, property) in the filter. The properties you can use for substring are: name\n and resourceGroup.:code:`<br>`:code:`<br>`For example, to get all resources with 'demo'\n anywhere in the name, use: $filter=substringof('demo', name):code:`<br>`:code:`<br>`You can\n link more than one substringof together by adding and/or operators.:code:`<br>`:code:`<br>`You\n can filter by tag names and values. For example, to filter for a tag name and value, use\n $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value,\n the tags for each resource are not returned in the results.:code:`<br>`:code:`<br>`You can use\n some properties together when filtering. The combinations you can use are: substringof and/or\n resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default\n value is None.\n :type filter: str\n :param expand: Comma-separated list of additional properties to be included in the response.\n Valid values include ``createdTime``\\ , ``changedTime`` and ``provisioningState``. For example,\n ``$expand=createdTime,changedTime``. Default value is None.\n :type expand: str\n :param top: The number of results to return. If null is passed, returns all resources. Default\n value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ResourceListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_resources_list_request(subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, expand=expand, top=top, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_resources_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ResourceListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def check_existence(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, **kwargs: Any) -> bool:
'Checks whether a resource exists.\n\n :param resource_group_name: The name of the resource group containing the resource to check.\n The name is case insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The resource provider of the resource to check.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type.\n :type resource_type: str\n :param resource_name: The name of the resource to check whether it exists.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
request = build_resources_check_existence_request(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.check_existence.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) | -2,463,412,061,442,969,000 | Checks whether a resource exists.
:param resource_group_name: The name of the resource group containing the resource to check.
The name is case insensitive.
:type resource_group_name: str
:param resource_provider_namespace: The resource provider of the resource to check.
:type resource_provider_namespace: str
:param parent_resource_path: The parent resource identity.
:type parent_resource_path: str
:param resource_type: The resource type.
:type resource_type: str
:param resource_name: The name of the resource to check whether it exists.
:type resource_name: str
:param api_version: The API version to use for the operation.
:type api_version: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: bool, or the result of cls(response)
:rtype: bool
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | check_existence | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def check_existence(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, **kwargs: Any) -> bool:
'Checks whether a resource exists.\n\n :param resource_group_name: The name of the resource group containing the resource to check.\n The name is case insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The resource provider of the resource to check.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type.\n :type resource_type: str\n :param resource_name: The name of the resource to check whether it exists.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
request = build_resources_check_existence_request(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.check_existence.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) |
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a resource.\n\n :param resource_group_name: The name of the resource group that contains the resource to\n delete. The name is case insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type.\n :type resource_type: str\n :param resource_name: The name of the resource to delete.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_initial(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | -7,018,557,983,394,776,000 | Deletes a resource.
:param resource_group_name: The name of the resource group that contains the resource to
delete. The name is case insensitive.
:type resource_group_name: str
:param resource_provider_namespace: The namespace of the resource provider.
:type resource_provider_namespace: str
:param parent_resource_path: The parent resource identity.
:type parent_resource_path: str
:param resource_type: The resource type.
:type resource_type: str
:param resource_name: The name of the resource to delete.
:type resource_name: str
:param api_version: The API version to use for the operation.
:type api_version: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_delete | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_delete(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a resource.\n\n :param resource_group_name: The name of the resource group that contains the resource to\n delete. The name is case insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type.\n :type resource_type: str\n :param resource_name: The name of the resource to delete.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_initial(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def begin_create_or_update(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, parameters: '_models.GenericResource', **kwargs: Any) -> AsyncLROPoller['_models.GenericResource']:
'Creates a resource.\n\n :param resource_group_name: The name of the resource group for the resource. The name is case\n insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type of the resource to create.\n :type resource_type: str\n :param resource_name: The name of the resource to create.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :param parameters: Parameters for creating or updating the resource.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either GenericResource or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_initial(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, api_version=api_version, parameters=parameters, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 3,433,010,530,652,796,400 | Creates a resource.
:param resource_group_name: The name of the resource group for the resource. The name is case
insensitive.
:type resource_group_name: str
:param resource_provider_namespace: The namespace of the resource provider.
:type resource_provider_namespace: str
:param parent_resource_path: The parent resource identity.
:type parent_resource_path: str
:param resource_type: The resource type of the resource to create.
:type resource_type: str
:param resource_name: The name of the resource to create.
:type resource_name: str
:param api_version: The API version to use for the operation.
:type api_version: str
:param parameters: Parameters for creating or updating the resource.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either GenericResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_create_or_update | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_create_or_update(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, parameters: '_models.GenericResource', **kwargs: Any) -> AsyncLROPoller['_models.GenericResource']:
'Creates a resource.\n\n :param resource_group_name: The name of the resource group for the resource. The name is case\n insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type of the resource to create.\n :type resource_type: str\n :param resource_name: The name of the resource to create.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :param parameters: Parameters for creating or updating the resource.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either GenericResource or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_initial(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, api_version=api_version, parameters=parameters, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def begin_update(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, parameters: '_models.GenericResource', **kwargs: Any) -> AsyncLROPoller['_models.GenericResource']:
'Updates a resource.\n\n :param resource_group_name: The name of the resource group for the resource. The name is case\n insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type of the resource to update.\n :type resource_type: str\n :param resource_name: The name of the resource to update.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :param parameters: Parameters for updating the resource.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either GenericResource or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._update_initial(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, api_version=api_version, parameters=parameters, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 5,476,888,058,151,218,000 | Updates a resource.
:param resource_group_name: The name of the resource group for the resource. The name is case
insensitive.
:type resource_group_name: str
:param resource_provider_namespace: The namespace of the resource provider.
:type resource_provider_namespace: str
:param parent_resource_path: The parent resource identity.
:type parent_resource_path: str
:param resource_type: The resource type of the resource to update.
:type resource_type: str
:param resource_name: The name of the resource to update.
:type resource_name: str
:param api_version: The API version to use for the operation.
:type api_version: str
:param parameters: Parameters for updating the resource.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either GenericResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_update | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_update(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, parameters: '_models.GenericResource', **kwargs: Any) -> AsyncLROPoller['_models.GenericResource']:
'Updates a resource.\n\n :param resource_group_name: The name of the resource group for the resource. The name is case\n insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type of the resource to update.\n :type resource_type: str\n :param resource_name: The name of the resource to update.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :param parameters: Parameters for updating the resource.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either GenericResource or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._update_initial(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, api_version=api_version, parameters=parameters, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def get(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, **kwargs: Any) -> '_models.GenericResource':
'Gets a resource.\n\n :param resource_group_name: The name of the resource group containing the resource to get. The\n name is case insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type of the resource.\n :type resource_type: str\n :param resource_name: The name of the resource to get.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: GenericResource, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
request = build_resources_get_request(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -3,891,930,686,878,597,000 | Gets a resource.
:param resource_group_name: The name of the resource group containing the resource to get. The
name is case insensitive.
:type resource_group_name: str
:param resource_provider_namespace: The namespace of the resource provider.
:type resource_provider_namespace: str
:param parent_resource_path: The parent resource identity.
:type parent_resource_path: str
:param resource_type: The resource type of the resource.
:type resource_type: str
:param resource_name: The name of the resource to get.
:type resource_name: str
:param api_version: The API version to use for the operation.
:type api_version: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: GenericResource, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get(self, resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, api_version: str, **kwargs: Any) -> '_models.GenericResource':
'Gets a resource.\n\n :param resource_group_name: The name of the resource group containing the resource to get. The\n name is case insensitive.\n :type resource_group_name: str\n :param resource_provider_namespace: The namespace of the resource provider.\n :type resource_provider_namespace: str\n :param parent_resource_path: The parent resource identity.\n :type parent_resource_path: str\n :param resource_type: The resource type of the resource.\n :type resource_type: str\n :param resource_name: The name of the resource to get.\n :type resource_name: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: GenericResource, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
request = build_resources_get_request(resource_group_name=resource_group_name, resource_provider_namespace=resource_provider_namespace, parent_resource_path=parent_resource_path, resource_type=resource_type, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
'Checks by ID whether a resource exists.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
request = build_resources_check_existence_by_id_request(resource_id=resource_id, api_version=api_version, template_url=self.check_existence_by_id.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) | 8,234,824,791,216,713,000 | Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
resource type. Use the format,
/subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
:type resource_id: str
:param api_version: The API version to use for the operation.
:type api_version: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: bool, or the result of cls(response)
:rtype: bool
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | check_existence_by_id | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
'Checks by ID whether a resource exists.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
request = build_resources_check_existence_by_id_request(resource_id=resource_id, api_version=api_version, template_url=self.check_existence_by_id.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) |
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a resource by ID.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_by_id_initial(resource_id=resource_id, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 8,440,762,345,902,372,000 | Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
resource type. Use the format,
/subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
:type resource_id: str
:param api_version: The API version to use for the operation.
:type api_version: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_delete_by_id | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a resource by ID.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_by_id_initial(resource_id=resource_id, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def begin_create_or_update_by_id(self, resource_id: str, api_version: str, parameters: '_models.GenericResource', **kwargs: Any) -> AsyncLROPoller['_models.GenericResource']:
'Create a resource by ID.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :param parameters: Create or update resource parameters.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either GenericResource or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_by_id_initial(resource_id=resource_id, api_version=api_version, parameters=parameters, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | -4,271,799,420,108,345,000 | Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
resource type. Use the format,
/subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
:type resource_id: str
:param api_version: The API version to use for the operation.
:type api_version: str
:param parameters: Create or update resource parameters.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either GenericResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_create_or_update_by_id | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_create_or_update_by_id(self, resource_id: str, api_version: str, parameters: '_models.GenericResource', **kwargs: Any) -> AsyncLROPoller['_models.GenericResource']:
'Create a resource by ID.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :param parameters: Create or update resource parameters.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either GenericResource or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._create_or_update_by_id_initial(resource_id=resource_id, api_version=api_version, parameters=parameters, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def begin_update_by_id(self, resource_id: str, api_version: str, parameters: '_models.GenericResource', **kwargs: Any) -> AsyncLROPoller['_models.GenericResource']:
'Updates a resource by ID.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :param parameters: Update resource parameters.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either GenericResource or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._update_by_id_initial(resource_id=resource_id, api_version=api_version, parameters=parameters, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | -2,791,472,584,120,616,400 | Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
resource type. Use the format,
/subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
:type resource_id: str
:param api_version: The API version to use for the operation.
:type api_version: str
:param parameters: Update resource parameters.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either GenericResource or the result of
cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_update_by_id | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_update_by_id(self, resource_id: str, api_version: str, parameters: '_models.GenericResource', **kwargs: Any) -> AsyncLROPoller['_models.GenericResource']:
'Updates a resource by ID.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :param parameters: Update resource parameters.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either GenericResource or the result of\n cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._update_by_id_initial(resource_id=resource_id, api_version=api_version, parameters=parameters, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> '_models.GenericResource':
'Gets a resource by ID.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: GenericResource, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
request = build_resources_get_by_id_request(resource_id=resource_id, api_version=api_version, template_url=self.get_by_id.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 3,387,436,440,744,711,000 | Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
resource type. Use the format,
/subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
:type resource_id: str
:param api_version: The API version to use for the operation.
:type api_version: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: GenericResource, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get_by_id | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> '_models.GenericResource':
'Gets a resource by ID.\n\n :param resource_id: The fully qualified ID of the resource, including the resource name and\n resource type. Use the format,\n /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.\n :type resource_id: str\n :param api_version: The API version to use for the operation.\n :type api_version: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: GenericResource, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
request = build_resources_get_by_id_request(resource_id=resource_id, api_version=api_version, template_url=self.get_by_id.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('GenericResource', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
'Checks whether a resource group exists.\n\n :param resource_group_name: The name of the resource group to check. The name is case\n insensitive.\n :type resource_group_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_resource_groups_check_existence_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.check_existence.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) | -656,849,533,764,817,800 | Checks whether a resource group exists.
:param resource_group_name: The name of the resource group to check. The name is case
insensitive.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: bool, or the result of cls(response)
:rtype: bool
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | check_existence | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
'Checks whether a resource group exists.\n\n :param resource_group_name: The name of the resource group to check. The name is case\n insensitive.\n :type resource_group_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: bool, or the result of cls(response)\n :rtype: bool\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_resource_groups_check_existence_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.check_existence.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [204, 404]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
return (200 <= response.status_code <= 299) |
@distributed_trace_async
async def create_or_update(self, resource_group_name: str, parameters: '_models.ResourceGroup', **kwargs: Any) -> '_models.ResourceGroup':
'Creates or updates a resource group.\n\n :param resource_group_name: The name of the resource group to create or update. Can include\n alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters\n that match the allowed characters.\n :type resource_group_name: str\n :param parameters: Parameters supplied to the create or update a resource group.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: ResourceGroup, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'ResourceGroup')
request = build_resource_groups_create_or_update_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 201]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('ResourceGroup', pipeline_response)
if (response.status_code == 201):
deserialized = self._deserialize('ResourceGroup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -7,668,671,716,154,610,000 | Creates or updates a resource group.
:param resource_group_name: The name of the resource group to create or update. Can include
alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters
that match the allowed characters.
:type resource_group_name: str
:param parameters: Parameters supplied to the create or update a resource group.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ResourceGroup, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | create_or_update | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def create_or_update(self, resource_group_name: str, parameters: '_models.ResourceGroup', **kwargs: Any) -> '_models.ResourceGroup':
'Creates or updates a resource group.\n\n :param resource_group_name: The name of the resource group to create or update. Can include\n alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters\n that match the allowed characters.\n :type resource_group_name: str\n :param parameters: Parameters supplied to the create or update a resource group.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: ResourceGroup, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'ResourceGroup')
request = build_resource_groups_create_or_update_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 201]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('ResourceGroup', pipeline_response)
if (response.status_code == 201):
deserialized = self._deserialize('ResourceGroup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a resource group.\n\n When you delete a resource group, all of its resources are also deleted. Deleting a resource\n group deletes all of its template deployments and currently stored operations.\n\n :param resource_group_name: The name of the resource group to delete. The name is case\n insensitive.\n :type resource_group_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_initial(resource_group_name=resource_group_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 2,531,146,247,266,177,500 | Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource
group deletes all of its template deployments and currently stored operations.
:param resource_group_name: The name of the resource group to delete. The name is case
insensitive.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_delete | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
'Deletes a resource group.\n\n When you delete a resource group, all of its resources are also deleted. Deleting a resource\n group deletes all of its template deployments and currently stored operations.\n\n :param resource_group_name: The name of the resource group to delete. The name is case\n insensitive.\n :type resource_group_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n :rtype: ~azure.core.polling.AsyncLROPoller[None]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._delete_initial(resource_group_name=resource_group_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace_async
async def get(self, resource_group_name: str, **kwargs: Any) -> '_models.ResourceGroup':
'Gets a resource group.\n\n :param resource_group_name: The name of the resource group to get. The name is case\n insensitive.\n :type resource_group_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: ResourceGroup, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_resource_groups_get_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ResourceGroup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -5,892,831,154,869,291,000 | Gets a resource group.
:param resource_group_name: The name of the resource group to get. The name is case
insensitive.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ResourceGroup, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get(self, resource_group_name: str, **kwargs: Any) -> '_models.ResourceGroup':
'Gets a resource group.\n\n :param resource_group_name: The name of the resource group to get. The name is case\n insensitive.\n :type resource_group_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: ResourceGroup, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_resource_groups_get_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ResourceGroup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def update(self, resource_group_name: str, parameters: '_models.ResourceGroupPatchable', **kwargs: Any) -> '_models.ResourceGroup':
'Updates a resource group.\n\n Resource groups can be updated through a simple PATCH operation to a group address. The format\n of the request is the same as that for creating a resource group. If a field is unspecified,\n the current value is retained.\n\n :param resource_group_name: The name of the resource group to update. The name is case\n insensitive.\n :type resource_group_name: str\n :param parameters: Parameters supplied to update a resource group.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroupPatchable\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: ResourceGroup, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'ResourceGroupPatchable')
request = build_resource_groups_update_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.update.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ResourceGroup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 7,230,138,605,993,320,000 | Updates a resource group.
Resource groups can be updated through a simple PATCH operation to a group address. The format
of the request is the same as that for creating a resource group. If a field is unspecified,
the current value is retained.
:param resource_group_name: The name of the resource group to update. The name is case
insensitive.
:type resource_group_name: str
:param parameters: Parameters supplied to update a resource group.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroupPatchable
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ResourceGroup, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | update | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def update(self, resource_group_name: str, parameters: '_models.ResourceGroupPatchable', **kwargs: Any) -> '_models.ResourceGroup':
'Updates a resource group.\n\n Resource groups can be updated through a simple PATCH operation to a group address. The format\n of the request is the same as that for creating a resource group. If a field is unspecified,\n the current value is retained.\n\n :param resource_group_name: The name of the resource group to update. The name is case\n insensitive.\n :type resource_group_name: str\n :param parameters: Parameters supplied to update a resource group.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroupPatchable\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: ResourceGroup, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
_json = self._serialize.body(parameters, 'ResourceGroupPatchable')
request = build_resource_groups_update_request(resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, template_url=self.update.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('ResourceGroup', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def begin_export_template(self, resource_group_name: str, parameters: '_models.ExportTemplateRequest', **kwargs: Any) -> AsyncLROPoller['_models.ResourceGroupExportResult']:
'Captures the specified resource group as a template.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param parameters: Parameters for exporting the template.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ExportTemplateRequest\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either ResourceGroupExportResult or the\n result of cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroupExportResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._export_template_initial(resource_group_name=resource_group_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('ResourceGroupExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) | 2,768,974,371,772,113,000 | Captures the specified resource group as a template.
:param resource_group_name: The name of the resource group. The name is case insensitive.
:type resource_group_name: str
:param parameters: Parameters for exporting the template.
:type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ExportTemplateRequest
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
this operation to not poll, or pass in your own initialized polling object for a personal
polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either ResourceGroupExportResult or the
result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroupExportResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | begin_export_template | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def begin_export_template(self, resource_group_name: str, parameters: '_models.ExportTemplateRequest', **kwargs: Any) -> AsyncLROPoller['_models.ResourceGroupExportResult']:
'Captures the specified resource group as a template.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param parameters: Parameters for exporting the template.\n :type parameters: ~azure.mgmt.resource.resources.v2019_08_01.models.ExportTemplateRequest\n :keyword callable cls: A custom type or function that will be passed the direct response\n :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n :return: An instance of AsyncLROPoller that returns either ResourceGroupExportResult or the\n result of cls(response)\n :rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroupExportResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
content_type = kwargs.pop('content_type', 'application/json')
polling = kwargs.pop('polling', True)
cls = kwargs.pop('cls', None)
lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
cont_token = kwargs.pop('continuation_token', None)
if (cont_token is None):
raw_result = (await self._export_template_initial(resource_group_name=resource_group_name, parameters=parameters, api_version=api_version, content_type=content_type, cls=(lambda x, y, z: x), **kwargs))
kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('ResourceGroupExportResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
if (polling is True):
polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
elif (polling is False):
polling_method = AsyncNoPolling()
else:
polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output)
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) |
@distributed_trace
def list(self, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.ResourceGroupListResult']:
"Gets all the resource groups for a subscription.\n\n :param filter: The filter to apply on the operation.:code:`<br>`:code:`<br>`You can filter by\n tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq\n 'tag1' and tagValue eq 'Value1'. Default value is None.\n :type filter: str\n :param top: The number of results to return. If null is passed, returns all resource groups.\n Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ResourceGroupListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroupListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_resource_groups_list_request(subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, top=top, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_resource_groups_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ResourceGroupListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | -6,487,294,508,930,864,000 | Gets all the resource groups for a subscription.
:param filter: The filter to apply on the operation.:code:`<br>`:code:`<br>`You can filter by
tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq
'tag1' and tagValue eq 'Value1'. Default value is None.
:type filter: str
:param top: The number of results to return. If null is passed, returns all resource groups.
Default value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ResourceGroupListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroupListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list(self, filter: Optional[str]=None, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.ResourceGroupListResult']:
"Gets all the resource groups for a subscription.\n\n :param filter: The filter to apply on the operation.:code:`<br>`:code:`<br>`You can filter by\n tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq\n 'tag1' and tagValue eq 'Value1'. Default value is None.\n :type filter: str\n :param top: The number of results to return. If null is passed, returns all resource groups.\n Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either ResourceGroupListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroupListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n "
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_resource_groups_list_request(subscription_id=self._config.subscription_id, api_version=api_version, filter=filter, top=top, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_resource_groups_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('ResourceGroupListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
'Deletes a tag value.\n\n :param tag_name: The name of the tag.\n :type tag_name: str\n :param tag_value: The value of the tag to delete.\n :type tag_value: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_tags_delete_value_request(tag_name=tag_name, tag_value=tag_value, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.delete_value.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) | 5,019,277,515,806,058,000 | Deletes a tag value.
:param tag_name: The name of the tag.
:type tag_name: str
:param tag_value: The value of the tag to delete.
:type tag_value: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | delete_value | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
'Deletes a tag value.\n\n :param tag_name: The name of the tag.\n :type tag_name: str\n :param tag_value: The value of the tag to delete.\n :type tag_value: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_tags_delete_value_request(tag_name=tag_name, tag_value=tag_value, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.delete_value.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) |
@distributed_trace_async
async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> '_models.TagValue':
'Creates a tag value. The name of the tag must already exist.\n\n :param tag_name: The name of the tag.\n :type tag_name: str\n :param tag_value: The value of the tag to create.\n :type tag_value: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: TagValue, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagValue\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_tags_create_or_update_value_request(tag_name=tag_name, tag_value=tag_value, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.create_or_update_value.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 201]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('TagValue', pipeline_response)
if (response.status_code == 201):
deserialized = self._deserialize('TagValue', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 3,649,543,177,623,293,400 | Creates a tag value. The name of the tag must already exist.
:param tag_name: The name of the tag.
:type tag_name: str
:param tag_value: The value of the tag to create.
:type tag_value: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: TagValue, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagValue
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | create_or_update_value | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> '_models.TagValue':
'Creates a tag value. The name of the tag must already exist.\n\n :param tag_name: The name of the tag.\n :type tag_name: str\n :param tag_value: The value of the tag to create.\n :type tag_value: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: TagValue, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagValue\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_tags_create_or_update_value_request(tag_name=tag_name, tag_value=tag_value, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.create_or_update_value.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 201]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('TagValue', pipeline_response)
if (response.status_code == 201):
deserialized = self._deserialize('TagValue', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def create_or_update(self, tag_name: str, **kwargs: Any) -> '_models.TagDetails':
'Creates a tag in the subscription.\n\n The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by\n Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these\n prefixes.\n\n :param tag_name: The name of the tag to create.\n :type tag_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: TagDetails, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagDetails\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_tags_create_or_update_request(tag_name=tag_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.create_or_update.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 201]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('TagDetails', pipeline_response)
if (response.status_code == 201):
deserialized = self._deserialize('TagDetails', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 5,787,831,473,035,958,000 | Creates a tag in the subscription.
The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by
Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these
prefixes.
:param tag_name: The name of the tag to create.
:type tag_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: TagDetails, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagDetails
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | create_or_update | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def create_or_update(self, tag_name: str, **kwargs: Any) -> '_models.TagDetails':
'Creates a tag in the subscription.\n\n The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by\n Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these\n prefixes.\n\n :param tag_name: The name of the tag to create.\n :type tag_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: TagDetails, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagDetails\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_tags_create_or_update_request(tag_name=tag_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.create_or_update.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 201]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if (response.status_code == 200):
deserialized = self._deserialize('TagDetails', pipeline_response)
if (response.status_code == 201):
deserialized = self._deserialize('TagDetails', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace_async
async def delete(self, tag_name: str, **kwargs: Any) -> None:
'Deletes a tag from the subscription.\n\n You must remove all values from a resource tag before you can delete it.\n\n :param tag_name: The name of the tag.\n :type tag_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_tags_delete_request(tag_name=tag_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.delete.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) | 7,871,289,252,524,633,000 | Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
:param tag_name: The name of the tag.
:type tag_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | delete | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def delete(self, tag_name: str, **kwargs: Any) -> None:
'Deletes a tag from the subscription.\n\n You must remove all values from a resource tag before you can delete it.\n\n :param tag_name: The name of the tag.\n :type tag_name: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: None, or the result of cls(response)\n :rtype: None\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_tags_delete_request(tag_name=tag_name, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.delete.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200, 204]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {}) |
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable['_models.TagsListResult']:
'Gets the names and values of all resource tags that are defined in a subscription.\n\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either TagsListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.TagsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_tags_list_request(subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_tags_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('TagsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | -1,893,800,081,539,016,000 | Gets the names and values of all resource tags that are defined in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either TagsListResult or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.TagsListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable['_models.TagsListResult']:
'Gets the names and values of all resource tags that are defined in a subscription.\n\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either TagsListResult or the result of cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.TagsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_tags_list_request(subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_tags_list_request(subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('TagsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def get_at_scope(self, scope: str, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param scope: The scope of a deployment.\n :type scope: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_at_scope_request(scope=scope, deployment_name=deployment_name, operation_id=operation_id, api_version=api_version, template_url=self.get_at_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 2,441,306,233,454,527,500 | Gets a deployments operation.
:param scope: The scope of a deployment.
:type scope: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param operation_id: The ID of the operation to get.
:type operation_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentOperation, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get_at_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get_at_scope(self, scope: str, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param scope: The scope of a deployment.\n :type scope: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_at_scope_request(scope=scope, deployment_name=deployment_name, operation_id=operation_id, api_version=api_version, template_url=self.get_at_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_at_scope(self, scope: str, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param scope: The scope of a deployment.\n :type scope: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_at_scope_request(scope=scope, deployment_name=deployment_name, api_version=api_version, top=top, template_url=self.list_at_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_at_scope_request(scope=scope, deployment_name=deployment_name, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 3,967,768,216,409,222,700 | Gets all deployments operations for a deployment.
:param scope: The scope of a deployment.
:type scope: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param top: The number of results to return. Default value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentOperationsListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_at_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_at_scope(self, scope: str, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param scope: The scope of a deployment.\n :type scope: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_at_scope_request(scope=scope, deployment_name=deployment_name, api_version=api_version, top=top, template_url=self.list_at_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_at_scope_request(scope=scope, deployment_name=deployment_name, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def get_at_tenant_scope(self, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_at_tenant_scope_request(deployment_name=deployment_name, operation_id=operation_id, api_version=api_version, template_url=self.get_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -1,461,877,026,801,265,700 | Gets a deployments operation.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param operation_id: The ID of the operation to get.
:type operation_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentOperation, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get_at_tenant_scope(self, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_at_tenant_scope_request(deployment_name=deployment_name, operation_id=operation_id, api_version=api_version, template_url=self.get_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_at_tenant_scope(self, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, top=top, template_url=self.list_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_at_tenant_scope_request(deployment_name=deployment_name, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 7,224,701,935,145,465,000 | Gets all deployments operations for a deployment.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param top: The number of results to return. Default value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentOperationsListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_at_tenant_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_at_tenant_scope(self, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, top=top, template_url=self.list_at_tenant_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_at_tenant_scope_request(deployment_name=deployment_name, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def get_at_management_group_scope(self, group_id: str, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, operation_id=operation_id, api_version=api_version, template_url=self.get_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -5,198,545,124,341,523,000 | Gets a deployments operation.
:param group_id: The management group ID.
:type group_id: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param operation_id: The ID of the operation to get.
:type operation_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentOperation, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get_at_management_group_scope(self, group_id: str, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, operation_id=operation_id, api_version=api_version, template_url=self.get_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_at_management_group_scope(self, group_id: str, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, top=top, template_url=self.list_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 1,840,978,768,811,161,900 | Gets all deployments operations for a deployment.
:param group_id: The management group ID.
:type group_id: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param top: The number of results to return. Default value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentOperationsListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_at_management_group_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_at_management_group_scope(self, group_id: str, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param group_id: The management group ID.\n :type group_id: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, api_version=api_version, top=top, template_url=self.list_at_management_group_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_at_management_group_scope_request(group_id=group_id, deployment_name=deployment_name, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def get_at_subscription_scope(self, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_at_subscription_scope_request(deployment_name=deployment_name, operation_id=operation_id, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | -465,771,385,816,491,460 | Gets a deployments operation.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param operation_id: The ID of the operation to get.
:type operation_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentOperation, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get_at_subscription_scope(self, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_at_subscription_scope_request(deployment_name=deployment_name, operation_id=operation_id, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list_at_subscription_scope(self, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, top=top, template_url=self.list_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 2,163,602,836,924,543,700 | Gets all deployments operations for a deployment.
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param top: The number of results to return. Default value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentOperationsListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list_at_subscription_scope | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list_at_subscription_scope(self, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, top=top, template_url=self.list_at_subscription_scope.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_at_subscription_scope_request(deployment_name=deployment_name, subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
@distributed_trace_async
async def get(self, resource_group_name: str, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_request(resource_group_name=resource_group_name, deployment_name=deployment_name, operation_id=operation_id, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | 5,854,930,461,822,493,000 | Gets a deployments operation.
:param resource_group_name: The name of the resource group. The name is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param operation_id: The ID of the operation to get.
:type operation_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: DeploymentOperation, or the result of cls(response)
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | get | AikoBB/azure-sdk-for-python | python | @distributed_trace_async
async def get(self, resource_group_name: str, deployment_name: str, operation_id: str, **kwargs: Any) -> '_models.DeploymentOperation':
'Gets a deployments operation.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param operation_id: The ID of the operation to get.\n :type operation_id: str\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: DeploymentOperation, or the result of cls(response)\n :rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation\n :raises: ~azure.core.exceptions.HttpResponseError\n '
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = kwargs.pop('api_version', '2019-08-01')
request = build_deployment_operations_get_request(resource_group_name=resource_group_name, deployment_name=deployment_name, operation_id=operation_id, subscription_id=self._config.subscription_id, api_version=api_version, template_url=self.get.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('DeploymentOperation', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized |
@distributed_trace
def list(self, resource_group_name: str, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, top=top, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) | 1,584,671,368,250,146,800 | Gets all deployments operations for a deployment.
:param resource_group_name: The name of the resource group. The name is case insensitive.
:type resource_group_name: str
:param deployment_name: The name of the deployment.
:type deployment_name: str
:param top: The number of results to return. Default value is None.
:type top: int
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either DeploymentOperationsListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]
:raises: ~azure.core.exceptions.HttpResponseError | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | list | AikoBB/azure-sdk-for-python | python | @distributed_trace
def list(self, resource_group_name: str, deployment_name: str, top: Optional[int]=None, **kwargs: Any) -> AsyncIterable['_models.DeploymentOperationsListResult']:
'Gets all deployments operations for a deployment.\n\n :param resource_group_name: The name of the resource group. The name is case insensitive.\n :type resource_group_name: str\n :param deployment_name: The name of the deployment.\n :type deployment_name: str\n :param top: The number of results to return. Default value is None.\n :type top: int\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either DeploymentOperationsListResult or the result of\n cls(response)\n :rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperationsListResult]\n :raises: ~azure.core.exceptions.HttpResponseError\n '
api_version = kwargs.pop('api_version', '2019-08-01')
cls = kwargs.pop('cls', None)
error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if (not next_link):
request = build_deployment_operations_list_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=api_version, top=top, template_url=self.list.metadata['url'])
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_deployment_operations_list_request(resource_group_name=resource_group_name, deployment_name=deployment_name, subscription_id=self._config.subscription_id, template_url=next_link)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = 'GET'
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('DeploymentOperationsListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return ((deserialized.next_link or None), AsyncList(list_of_elem))
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
response = pipeline_response.http_response
if (response.status_code not in [200]):
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(get_next, extract_data) |
def __getitem__(self, name):
' check contents dictionary to allow dict like access to service layers'
if (name in list(self.__getattribute__('contents').keys())):
return self.__getattribute__('contents')[name]
else:
raise KeyError(('No content named %s' % name)) | 3,784,737,241,897,764,000 | check contents dictionary to allow dict like access to service layers | owslib/coverage/wcs100.py | __getitem__ | ferreteleco/OWSLib | python | def __getitem__(self, name):
' '
if (name in list(self.__getattribute__('contents').keys())):
return self.__getattribute__('contents')[name]
else:
raise KeyError(('No content named %s' % name)) |
def items(self):
'supports dict-like items() access'
items = []
for item in self.contents:
items.append((item, self.contents[item]))
return items | 5,470,139,743,979,629,000 | supports dict-like items() access | owslib/coverage/wcs100.py | items | ferreteleco/OWSLib | python | def items(self):
items = []
for item in self.contents:
items.append((item, self.contents[item]))
return items |
def getCoverage(self, identifier=None, bbox=None, time=None, format=None, crs=None, width=None, height=None, resx=None, resy=None, resz=None, parameter=None, method='Get', timeout=30, **kwargs):
"Request and return a coverage from the WCS as a file-like object\n note: additional **kwargs helps with multi-version implementation\n core keyword arguments should be supported cross version\n example:\n cvg=wcs.getCoverage(identifier=['TuMYrRQ4'], timeSequence=['2792-06-01T00:00:00.0'], bbox=(-112,36,-106,41),\n format='cf-netcdf')\n\n is equivalent to:\n http://myhost/mywcs?SERVICE=WCS&REQUEST=GetCoverage&IDENTIFIER=TuMYrRQ4&VERSION=1.1.0&BOUNDINGBOX=-180,-90,180,90&TIME=2792-06-01T00:00:00.0&FORMAT=cf-netcdf\n\n "
if log.isEnabledFor(logging.DEBUG):
msg = 'WCS 1.0.0 DEBUG: Parameters passed to GetCoverage: identifier={}, bbox={}, time={}, format={}, crs={}, width={}, height={}, resx={}, resy={}, resz={}, parameter={}, method={}, other_arguments={}'
log.debug(msg.format(identifier, bbox, time, format, crs, width, height, resx, resy, resz, parameter, method, str(kwargs)))
try:
base_url = next((m.get('url') for m in self.getOperationByName('GetCoverage').methods if (m.get('type').lower() == method.lower())))
except StopIteration:
base_url = self.url
log.debug(('WCS 1.0.0 DEBUG: base url of server: %s' % base_url))
request = {'version': self.version, 'request': 'GetCoverage', 'service': 'WCS'}
assert (len(identifier) > 0)
request['Coverage'] = identifier
if bbox:
request['BBox'] = ','.join([makeString(x) for x in bbox])
else:
request['BBox'] = None
if time:
request['time'] = ','.join(time)
if crs:
request['crs'] = crs
request['format'] = format
if width:
request['width'] = width
if height:
request['height'] = height
if resx:
request['resx'] = resx
if resy:
request['resy'] = resy
if resz:
request['resz'] = resz
if kwargs:
for kw in kwargs:
request[kw] = kwargs[kw]
data = urlencode(request)
log.debug(('WCS 1.0.0 DEBUG: Second part of URL: %s' % data))
u = openURL(base_url, data, method, self.cookies, auth=self.auth, timeout=timeout)
return u | -6,503,268,660,572,574,000 | Request and return a coverage from the WCS as a file-like object
note: additional **kwargs helps with multi-version implementation
core keyword arguments should be supported cross version
example:
cvg=wcs.getCoverage(identifier=['TuMYrRQ4'], timeSequence=['2792-06-01T00:00:00.0'], bbox=(-112,36,-106,41),
format='cf-netcdf')
is equivalent to:
http://myhost/mywcs?SERVICE=WCS&REQUEST=GetCoverage&IDENTIFIER=TuMYrRQ4&VERSION=1.1.0&BOUNDINGBOX=-180,-90,180,90&TIME=2792-06-01T00:00:00.0&FORMAT=cf-netcdf | owslib/coverage/wcs100.py | getCoverage | ferreteleco/OWSLib | python | def getCoverage(self, identifier=None, bbox=None, time=None, format=None, crs=None, width=None, height=None, resx=None, resy=None, resz=None, parameter=None, method='Get', timeout=30, **kwargs):
"Request and return a coverage from the WCS as a file-like object\n note: additional **kwargs helps with multi-version implementation\n core keyword arguments should be supported cross version\n example:\n cvg=wcs.getCoverage(identifier=['TuMYrRQ4'], timeSequence=['2792-06-01T00:00:00.0'], bbox=(-112,36,-106,41),\n format='cf-netcdf')\n\n is equivalent to:\n http://myhost/mywcs?SERVICE=WCS&REQUEST=GetCoverage&IDENTIFIER=TuMYrRQ4&VERSION=1.1.0&BOUNDINGBOX=-180,-90,180,90&TIME=2792-06-01T00:00:00.0&FORMAT=cf-netcdf\n\n "
if log.isEnabledFor(logging.DEBUG):
msg = 'WCS 1.0.0 DEBUG: Parameters passed to GetCoverage: identifier={}, bbox={}, time={}, format={}, crs={}, width={}, height={}, resx={}, resy={}, resz={}, parameter={}, method={}, other_arguments={}'
log.debug(msg.format(identifier, bbox, time, format, crs, width, height, resx, resy, resz, parameter, method, str(kwargs)))
try:
base_url = next((m.get('url') for m in self.getOperationByName('GetCoverage').methods if (m.get('type').lower() == method.lower())))
except StopIteration:
base_url = self.url
log.debug(('WCS 1.0.0 DEBUG: base url of server: %s' % base_url))
request = {'version': self.version, 'request': 'GetCoverage', 'service': 'WCS'}
assert (len(identifier) > 0)
request['Coverage'] = identifier
if bbox:
request['BBox'] = ','.join([makeString(x) for x in bbox])
else:
request['BBox'] = None
if time:
request['time'] = ','.join(time)
if crs:
request['crs'] = crs
request['format'] = format
if width:
request['width'] = width
if height:
request['height'] = height
if resx:
request['resx'] = resx
if resy:
request['resy'] = resy
if resz:
request['resz'] = resz
if kwargs:
for kw in kwargs:
request[kw] = kwargs[kw]
data = urlencode(request)
log.debug(('WCS 1.0.0 DEBUG: Second part of URL: %s' % data))
u = openURL(base_url, data, method, self.cookies, auth=self.auth, timeout=timeout)
return u |
def getOperationByName(self, name):
'Return a named operation item.'
for item in self.operations:
if (item.name == name):
return item
raise KeyError(('No operation named %s' % name)) | -9,217,597,687,808,163,000 | Return a named operation item. | owslib/coverage/wcs100.py | getOperationByName | ferreteleco/OWSLib | python | def getOperationByName(self, name):
for item in self.operations:
if (item.name == name):
return item
raise KeyError(('No operation named %s' % name)) |
def __init__(self, elem):
'.'
self.name = elem.tag.split('}')[1]
self.methods = []
for resource in elem.findall((((ns('DCPType/') + ns('HTTP/')) + ns('Get/')) + ns('OnlineResource'))):
url = resource.attrib['{http://www.w3.org/1999/xlink}href']
self.methods.append({'type': 'Get', 'url': url})
for resource in elem.findall((((ns('DCPType/') + ns('HTTP/')) + ns('Post/')) + ns('OnlineResource'))):
url = resource.attrib['{http://www.w3.org/1999/xlink}href']
self.methods.append({'type': 'Post', 'url': url}) | -2,639,811,581,629,328,000 | . | owslib/coverage/wcs100.py | __init__ | ferreteleco/OWSLib | python | def __init__(self, elem):
selfname = elemtagsplit('}')[1]
selfmethods = []
for resource in elemfindall((((ns('DCPType/') + ns('HTTP/')) + ns('Get/')) + ns('OnlineResource'))):
url = resourceattrib['{http://wwww3org/1999/xlink}href']
selfmethodsappend({'type': 'Get', 'url': url})
for resource in elemfindall((((ns('DCPType/') + ns('HTTP/')) + ns('Post/')) + ns('OnlineResource'))):
url = resourceattrib['{http://wwww3org/1999/xlink}href']
selfmethodsappend({'type': 'Post', 'url': url}) |
def __init__(self, elem, service):
'Initialize. service is required so that describeCoverage requests may be made'
self._elem = elem
self._service = service
self.id = elem.find(ns('name')).text
self.title = testXMLValue(elem.find(ns('label')))
self.abstract = testXMLValue(elem.find(ns('description')))
self.keywords = [f.text for f in elem.findall(((ns('keywords') + '/') + ns('keyword')))]
self.boundingBox = None
self.boundingBoxWGS84 = None
b = elem.find(ns('lonLatEnvelope'))
if (b is not None):
gmlpositions = b.findall('{http://www.opengis.net/gml}pos')
lc = gmlpositions[0].text
uc = gmlpositions[1].text
self.boundingBoxWGS84 = (float(lc.split()[0]), float(lc.split()[1]), float(uc.split()[0]), float(uc.split()[1]))
self.styles = None
self.crsOptions = None
self.defaulttimeposition = None | -5,759,605,786,622,049,000 | Initialize. service is required so that describeCoverage requests may be made | owslib/coverage/wcs100.py | __init__ | ferreteleco/OWSLib | python | def __init__(self, elem, service):
self._elem = elem
self._service = service
self.id = elem.find(ns('name')).text
self.title = testXMLValue(elem.find(ns('label')))
self.abstract = testXMLValue(elem.find(ns('description')))
self.keywords = [f.text for f in elem.findall(((ns('keywords') + '/') + ns('keyword')))]
self.boundingBox = None
self.boundingBoxWGS84 = None
b = elem.find(ns('lonLatEnvelope'))
if (b is not None):
gmlpositions = b.findall('{http://www.opengis.net/gml}pos')
lc = gmlpositions[0].text
uc = gmlpositions[1].text
self.boundingBoxWGS84 = (float(lc.split()[0]), float(lc.split()[1]), float(uc.split()[0]), float(uc.split()[1]))
self.styles = None
self.crsOptions = None
self.defaulttimeposition = None |
def _getOtherBoundingBoxes(self):
' incomplete, should return other bounding boxes not in WGS84\n #TODO: find any other bounding boxes. Need to check for gml:EnvelopeWithTimePeriod.'
bboxes = []
if (not hasattr(self, 'descCov')):
self.descCov = self._service.getDescribeCoverage(self.id)
for envelope in self.descCov.findall((((ns('CoverageOffering/') + ns('domainSet/')) + ns('spatialDomain/')) + '{http://www.opengis.net/gml}Envelope')):
bbox = {}
bbox['nativeSrs'] = envelope.attrib['srsName']
gmlpositions = envelope.findall('{http://www.opengis.net/gml}pos')
lc = gmlpositions[0].text.split()
uc = gmlpositions[1].text.split()
bbox['bbox'] = (float(lc[0]), float(lc[1]), float(uc[0]), float(uc[1]))
bboxes.append(bbox)
return bboxes | -7,268,395,684,310,349,000 | incomplete, should return other bounding boxes not in WGS84
#TODO: find any other bounding boxes. Need to check for gml:EnvelopeWithTimePeriod. | owslib/coverage/wcs100.py | _getOtherBoundingBoxes | ferreteleco/OWSLib | python | def _getOtherBoundingBoxes(self):
' incomplete, should return other bounding boxes not in WGS84\n #TODO: find any other bounding boxes. Need to check for gml:EnvelopeWithTimePeriod.'
bboxes = []
if (not hasattr(self, 'descCov')):
self.descCov = self._service.getDescribeCoverage(self.id)
for envelope in self.descCov.findall((((ns('CoverageOffering/') + ns('domainSet/')) + ns('spatialDomain/')) + '{http://www.opengis.net/gml}Envelope')):
bbox = {}
bbox['nativeSrs'] = envelope.attrib['srsName']
gmlpositions = envelope.findall('{http://www.opengis.net/gml}pos')
lc = gmlpositions[0].text.split()
uc = gmlpositions[1].text.split()
bbox['bbox'] = (float(lc[0]), float(lc[1]), float(uc[0]), float(uc[1]))
bboxes.append(bbox)
return bboxes |
@property
def has_default(self) -> bool:
'\n Checks if attrs as a default field value\n '
return ((self.factory is not None) or (self.default is not None)) | 6,712,993,343,820,218,000 | Checks if attrs as a default field value | appgate/openapi/attribmaker.py | has_default | appgate/sdp-operator | python | @property
def has_default(self) -> bool:
'\n \n '
return ((self.factory is not None) or (self.default is not None)) |
def testGetImportDataResponse(self):
'Test GetImportDataResponse'
pass | -3,838,620,394,645,830,700 | Test GetImportDataResponse | test/test_get_import_data_response.py | testGetImportDataResponse | idaholab/Deep-Lynx-Python-Package | python | def testGetImportDataResponse(self):
pass |
def predict(model: tf.keras.Model, X_test: pd.DataFrame, cate_cols: list) -> np.array:
'\n predict function\n Args:\n model: keras model fit by fit_model\n X_test: Test features\n cate_cols: categorical columns list\n\n Returns: y_pred\n\n '
X_test_list = _to_input_list(df=X_test, cate_cols=cate_cols)
y_pred = model.predict(X_test_list)
return y_pred | -5,369,013,265,004,981,000 | predict function
Args:
model: keras model fit by fit_model
X_test: Test features
cate_cols: categorical columns list
Returns: y_pred | src/models/dnn_regressor.py | predict | onurerkin/prohack | python | def predict(model: tf.keras.Model, X_test: pd.DataFrame, cate_cols: list) -> np.array:
'\n predict function\n Args:\n model: keras model fit by fit_model\n X_test: Test features\n cate_cols: categorical columns list\n\n Returns: y_pred\n\n '
X_test_list = _to_input_list(df=X_test, cate_cols=cate_cols)
y_pred = model.predict(X_test_list)
return y_pred |
def train(X_train: pd.DataFrame, y_train: Union[(pd.Series, np.array)], X_val: pd.DataFrame, y_val: Union[(pd.Series, np.array)], layers: list, num_classes: int, cate_cols: list, learning_rate: float, epochs: int, batch_size: int, dropout_rate: float=0.3) -> Tuple[(tf.keras.callbacks.History, tf.keras.Model)]:
'\n Training main function that takes dataset and parameters as input and returns the trained model with history\n Args:\n X_train: Train features\n y_train: train labels\n X_val: Validation labels\n y_val: validation labels\n layers: List of nodes in hidden layers\n num_classes: Number of classes in target variable\n cate_cols: categorical columns list\n learning_rate: learning rate\n epochs: number of epochs\n batch_size: batch size\n dropout_rate: dropout rate\n\n Returns: history of training, trained model\n\n '
X_train_list = _to_input_list(df=X_train, cate_cols=cate_cols)
X_val_list = _to_input_list(df=X_val, cate_cols=cate_cols)
y_train = np.array(y_train)
y_val = np.array(y_val)
model = _create_keras_model(X_train=X_train, layers=layers, num_classes=num_classes, dropout_rate=dropout_rate, cate_cols=cate_cols)
_compile_model(model=model, num_classes=num_classes, learning_rate=learning_rate)
history = _fit_model(model=model, X_train_list=X_train_list, y_train=y_train, X_val_list=X_val_list, y_val=y_val, epochs=epochs, batch_size=batch_size)
return (history, model) | -2,165,709,550,723,407,000 | Training main function that takes dataset and parameters as input and returns the trained model with history
Args:
X_train: Train features
y_train: train labels
X_val: Validation labels
y_val: validation labels
layers: List of nodes in hidden layers
num_classes: Number of classes in target variable
cate_cols: categorical columns list
learning_rate: learning rate
epochs: number of epochs
batch_size: batch size
dropout_rate: dropout rate
Returns: history of training, trained model | src/models/dnn_regressor.py | train | onurerkin/prohack | python | def train(X_train: pd.DataFrame, y_train: Union[(pd.Series, np.array)], X_val: pd.DataFrame, y_val: Union[(pd.Series, np.array)], layers: list, num_classes: int, cate_cols: list, learning_rate: float, epochs: int, batch_size: int, dropout_rate: float=0.3) -> Tuple[(tf.keras.callbacks.History, tf.keras.Model)]:
'\n Training main function that takes dataset and parameters as input and returns the trained model with history\n Args:\n X_train: Train features\n y_train: train labels\n X_val: Validation labels\n y_val: validation labels\n layers: List of nodes in hidden layers\n num_classes: Number of classes in target variable\n cate_cols: categorical columns list\n learning_rate: learning rate\n epochs: number of epochs\n batch_size: batch size\n dropout_rate: dropout rate\n\n Returns: history of training, trained model\n\n '
X_train_list = _to_input_list(df=X_train, cate_cols=cate_cols)
X_val_list = _to_input_list(df=X_val, cate_cols=cate_cols)
y_train = np.array(y_train)
y_val = np.array(y_val)
model = _create_keras_model(X_train=X_train, layers=layers, num_classes=num_classes, dropout_rate=dropout_rate, cate_cols=cate_cols)
_compile_model(model=model, num_classes=num_classes, learning_rate=learning_rate)
history = _fit_model(model=model, X_train_list=X_train_list, y_train=y_train, X_val_list=X_val_list, y_val=y_val, epochs=epochs, batch_size=batch_size)
return (history, model) |
def _init_ui(self):
'Initialise user interface'
self._layout = QVBoxLayout()
self.setLayout(self._layout)
self._init_keyframes_list_control_widget()
self._init_keyframes_list_widget()
self._init_frame_widget()
self._init_save_button()
self._init_animation_slider_widget() | 7,280,799,399,991,643,000 | Initialise user interface | napari_animation/_qt/animation_widget.py | _init_ui | tlambert-forks/napari-animation | python | def _init_ui(self):
self._layout = QVBoxLayout()
self.setLayout(self._layout)
self._init_keyframes_list_control_widget()
self._init_keyframes_list_widget()
self._init_frame_widget()
self._init_save_button()
self._init_animation_slider_widget() |
def _add_keybind_callbacks(self):
'Bind keys'
self.animation.viewer.bind_key('Alt-f', self._capture_keyframe_callback)
self.animation.viewer.bind_key('Alt-r', self._replace_keyframe_callback)
self.animation.viewer.bind_key('Alt-d', self._delete_keyframe_callback)
self.animation.viewer.bind_key('Alt-a', self._key_adv_frame)
self.animation.viewer.bind_key('Alt-b', self._key_back_frame) | 3,122,671,027,858,068,500 | Bind keys | napari_animation/_qt/animation_widget.py | _add_keybind_callbacks | tlambert-forks/napari-animation | python | def _add_keybind_callbacks(self):
self.animation.viewer.bind_key('Alt-f', self._capture_keyframe_callback)
self.animation.viewer.bind_key('Alt-r', self._replace_keyframe_callback)
self.animation.viewer.bind_key('Alt-d', self._delete_keyframe_callback)
self.animation.viewer.bind_key('Alt-a', self._key_adv_frame)
self.animation.viewer.bind_key('Alt-b', self._key_back_frame) |
def _add_callbacks(self):
'Establish callbacks'
self.keyframesListControlWidget.deleteButton.clicked.connect(self._delete_keyframe_callback)
self.keyframesListControlWidget.captureButton.clicked.connect(self._capture_keyframe_callback)
self.saveButton.clicked.connect(self._save_callback)
self.animationsliderWidget.valueChanged.connect(self._move_animationslider_callback)
self.viewer.events.theme.connect((lambda e: self.keyframesListWidget._update_theme(e.value))) | -2,589,591,270,633,792,000 | Establish callbacks | napari_animation/_qt/animation_widget.py | _add_callbacks | tlambert-forks/napari-animation | python | def _add_callbacks(self):
self.keyframesListControlWidget.deleteButton.clicked.connect(self._delete_keyframe_callback)
self.keyframesListControlWidget.captureButton.clicked.connect(self._capture_keyframe_callback)
self.saveButton.clicked.connect(self._save_callback)
self.animationsliderWidget.valueChanged.connect(self._move_animationslider_callback)
self.viewer.events.theme.connect((lambda e: self.keyframesListWidget._update_theme(e.value))) |
def _release_callbacks(self):
'Release keys'
self.animation.viewer.bind_key('Alt-f', None)
self.animation.viewer.bind_key('Alt-r', None)
self.animation.viewer.bind_key('Alt-d', None)
self.animation.viewer.bind_key('Alt-a', None)
self.animation.viewer.bind_key('Alt-b', None) | 1,593,041,451,493,141,500 | Release keys | napari_animation/_qt/animation_widget.py | _release_callbacks | tlambert-forks/napari-animation | python | def _release_callbacks(self):
self.animation.viewer.bind_key('Alt-f', None)
self.animation.viewer.bind_key('Alt-r', None)
self.animation.viewer.bind_key('Alt-d', None)
self.animation.viewer.bind_key('Alt-a', None)
self.animation.viewer.bind_key('Alt-b', None) |
def _capture_keyframe_callback(self, event=None):
'Record current key-frame'
self.animation.capture_keyframe(steps=self._get_interpolation_steps(), ease=self._get_easing_function())
if (len(self.animation.key_frames) == 1):
self.keyframesListControlWidget.deleteButton.setEnabled(True)
self.keyframesListWidget.setEnabled(True)
self.frameWidget.setEnabled(True)
self.animationsliderWidget.requires_update = True | -7,874,058,387,773,584,000 | Record current key-frame | napari_animation/_qt/animation_widget.py | _capture_keyframe_callback | tlambert-forks/napari-animation | python | def _capture_keyframe_callback(self, event=None):
self.animation.capture_keyframe(steps=self._get_interpolation_steps(), ease=self._get_easing_function())
if (len(self.animation.key_frames) == 1):
self.keyframesListControlWidget.deleteButton.setEnabled(True)
self.keyframesListWidget.setEnabled(True)
self.frameWidget.setEnabled(True)
self.animationsliderWidget.requires_update = True |
def _replace_keyframe_callback(self, event=None):
'Replace current key-frame with new view'
self.animation.capture_keyframe(steps=self._get_interpolation_steps(), ease=self._get_easing_function(), insert=False)
self.animationsliderWidget.requires_update = True | -1,931,771,280,802,751,000 | Replace current key-frame with new view | napari_animation/_qt/animation_widget.py | _replace_keyframe_callback | tlambert-forks/napari-animation | python | def _replace_keyframe_callback(self, event=None):
self.animation.capture_keyframe(steps=self._get_interpolation_steps(), ease=self._get_easing_function(), insert=False)
self.animationsliderWidget.requires_update = True |
def _delete_keyframe_callback(self, event=None):
'Delete current key-frame'
if (len(self.animation.key_frames) > 0):
self.animation.key_frames.pop(self.animation.frame)
if (len(self.animation.key_frames) == 0):
self.keyframesListControlWidget.deleteButton.setEnabled(False)
self.keyframesListWidget.setEnabled(False)
self.frameWidget.setEnabled(False)
self.animationsliderWidget.requires_update = True | -5,873,253,128,557,636,000 | Delete current key-frame | napari_animation/_qt/animation_widget.py | _delete_keyframe_callback | tlambert-forks/napari-animation | python | def _delete_keyframe_callback(self, event=None):
if (len(self.animation.key_frames) > 0):
self.animation.key_frames.pop(self.animation.frame)
if (len(self.animation.key_frames) == 0):
self.keyframesListControlWidget.deleteButton.setEnabled(False)
self.keyframesListWidget.setEnabled(False)
self.frameWidget.setEnabled(False)
self.animationsliderWidget.requires_update = True |
def _key_adv_frame(self, event=None):
'Go forwards in key-frame list'
new_frame = ((self.animation.frame + 1) % len(self.animation.key_frames))
self.animation.set_to_keyframe(new_frame)
self.keyframesListWidget.setCurrentRow(new_frame) | -4,764,902,278,046,115,000 | Go forwards in key-frame list | napari_animation/_qt/animation_widget.py | _key_adv_frame | tlambert-forks/napari-animation | python | def _key_adv_frame(self, event=None):
new_frame = ((self.animation.frame + 1) % len(self.animation.key_frames))
self.animation.set_to_keyframe(new_frame)
self.keyframesListWidget.setCurrentRow(new_frame) |
def _key_back_frame(self, event=None):
'Go backwards in key-frame list'
new_frame = ((self.animation.frame - 1) % len(self.animation.key_frames))
self.animation.set_to_keyframe(new_frame)
self.keyframesListWidget.setCurrentRow(new_frame) | 4,166,661,656,440,926,700 | Go backwards in key-frame list | napari_animation/_qt/animation_widget.py | _key_back_frame | tlambert-forks/napari-animation | python | def _key_back_frame(self, event=None):
new_frame = ((self.animation.frame - 1) % len(self.animation.key_frames))
self.animation.set_to_keyframe(new_frame)
self.keyframesListWidget.setCurrentRow(new_frame) |
def _move_animationslider_callback(self, event=None):
'Scroll through interpolated states. Computes states if key-frames changed'
self.animationsliderWidget.synchronise()
new_frame = self.animationsliderWidget.value()
self.animation._set_viewer_state(self.animationsliderWidget.interpol_states[new_frame])
new_key_frame = (self.animationsliderWidget.cumulative_frame_count > new_frame).argmax()
new_key_frame -= 1
new_key_frame = int(new_key_frame)
self.keyframesListWidget.setCurrentRowBlockingSignals(new_key_frame)
self.animation.frame = new_key_frame | -4,673,430,974,111,327,000 | Scroll through interpolated states. Computes states if key-frames changed | napari_animation/_qt/animation_widget.py | _move_animationslider_callback | tlambert-forks/napari-animation | python | def _move_animationslider_callback(self, event=None):
self.animationsliderWidget.synchronise()
new_frame = self.animationsliderWidget.value()
self.animation._set_viewer_state(self.animationsliderWidget.interpol_states[new_frame])
new_key_frame = (self.animationsliderWidget.cumulative_frame_count > new_frame).argmax()
new_key_frame -= 1
new_key_frame = int(new_key_frame)
self.keyframesListWidget.setCurrentRowBlockingSignals(new_key_frame)
self.animation.frame = new_key_frame |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.