'Reinstalls the operating system on the specified compute node.
You can reinstall the operating system on a node only if it is in an
idle or running state. This API can be invoked only on pools created
with the cloud service configuration property.
:param pool_id: The ID of the pool that contains the compute node.
:type pool_id: str
:param node_id: The ID of the compute node that you want to restart.
:type node_id: str
:param compute_node_reimage_options: Additional parameters for the
operation
:type compute_node_reimage_options: :class:`ComputeNodeReimageOptions
<azure.batch.models.ComputeNodeReimageOptions>`
:param node_reimage_option: When to reimage the compute node and what
to do with currently running tasks. The default value is requeue.
Possible values include: \'requeue\', \'terminate\', \'taskCompletion\',
\'retainedData\'
:type node_reimage_option: str or :class:`ComputeNodeReimageOption
<azure.batch.models.ComputeNodeReimageOption>`
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: None
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises:
:class:`BatchErrorException<azure.batch.models.BatchErrorException>`'

def reimage(self, pool_id, node_id, compute_node_reimage_options=None, node_reimage_option=None, custom_headers=None, raw=False, **operation_config):

    timeout = None
    if (compute_node_reimage_options is not None):
        timeout = compute_node_reimage_options.timeout
    client_request_id = None
    if (compute_node_reimage_options is not None):
        client_request_id = compute_node_reimage_options.client_request_id
    return_client_request_id = None
    if (compute_node_reimage_options is not None):
        return_client_request_id = compute_node_reimage_options.return_client_request_id
    ocp_date = None
    if (compute_node_reimage_options is not None):
        ocp_date = compute_node_reimage_options.ocp_date
    node_reimage_parameter = None
    if (node_reimage_option is not None):
        node_reimage_parameter = models.NodeReimageParameter(node_reimage_option=node_reimage_option)
    url = '/pools/{poolId}/nodes/{nodeId}/reimage'
    path_format_arguments = {'poolId': self._serialize.url('pool_id', pool_id, 'str'), 'nodeId': self._serialize.url('node_id', node_id, 'str')}
    url = self._client.format_url(url, **path_format_arguments)
    query_parameters = {}
    query_parameters['api-version'] = self._serialize.query('self.api_version', self.api_version, 'str')
    if (timeout is not None):
        query_parameters['timeout'] = self._serialize.query('timeout', timeout, 'int')
    header_parameters = {}
    header_parameters['Content-Type'] = 'application/json;    odata=minimalmetadata;    charset=utf-8'
    if self.config.generate_client_request_id:
        header_parameters['client-request-id'] = str(uuid.uuid1())
    if custom_headers:
        header_parameters.update(custom_headers)
    if (self.config.accept_language is not None):
        header_parameters['accept-language'] = self._serialize.header('self.config.accept_language', self.config.accept_language, 'str')
    if (client_request_id is not None):
        header_parameters['client-request-id'] = self._serialize.header('client_request_id', client_request_id, 'str')
    if (return_client_request_id is not None):
        header_parameters['return-client-request-id'] = self._serialize.header('return_client_request_id', return_client_request_id, 'bool')
    if (ocp_date is not None):
        header_parameters['ocp-date'] = self._serialize.header('ocp_date', ocp_date, 'rfc-1123')
    if (node_reimage_parameter is not None):
        body_content = self._serialize.body(node_reimage_parameter, 'NodeReimageParameter')
    else:
        body_content = None
    request = self._client.post(url, query_parameters)
    response = self._client.send(request, header_parameters, body_content, **operation_config)
    if (response.status_code not in [202]):
        raise models.BatchErrorException(self._deserialize, response)
    if raw:
        client_raw_response = ClientRawResponse(None, response)
        client_raw_response.add_headers({'client-request-id': 'str', 'request-id': 'str', 'ETag': 'str', 'Last-Modified': 'rfc-1123', 'DataServiceId': 'str'})
        return client_raw_response
