'Cancels a user-induced fault operation.
The following is a list of APIs that start fault operations that may
be cancelled using CancelOperation -
- StartDataLoss
- StartQuorumLoss
- StartPartitionRestart
- StartNodeTransition
If force is false, then the specified user-induced operation will be
gracefully stopped and cleaned up.  If force is true, the command
will be aborted, and some internal state
may be left behind.  Specifying force as true should be used with
care.  Calling this API with force set to true is not allowed until
this API has already
been called on the same test command with force set to false first, or
unless the test command already has an OperationState of
OperationState.RollingBack.
Clarification: OperationState.RollingBack means that the system
will/is be cleaning up internal system state caused by executing the
command.  It will not restore data if the
test command was to cause data loss.  For example, if you call
StartDataLoss then call this API, the system will only clean up
internal state from running the command.
It will not restore the target partition\'s data, if the command
progressed far enough to cause data loss.
Important note:  if this API is invoked with force==true, internal
state may be left behind.
:param operation_id: A GUID that identifies a call of this API.  This
is passed into the corresponding GetProgress API
:type operation_id: str
:param force: Indicates whether to gracefully rollback and clean up
internal system state modified by executing the user-induced
operation.
:type force: bool
:param timeout: The server timeout for performing the operation in
seconds. This specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value
for this parameter is 60 seconds.
:type timeout: long
: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:`FabricErrorException<azure.servicefabric.models.FabricErrorException>`'

def cancel_operation(self, operation_id, force=False, timeout=60, custom_headers=None, raw=False, **operation_config):

    api_version = '3.0'
    url = '/Faults/$/Cancel'
    query_parameters = {}
    query_parameters['api-version'] = self._serialize.query('api_version', api_version, 'str')
    query_parameters['OperationId'] = self._serialize.query('operation_id', operation_id, 'str')
    query_parameters['Force'] = self._serialize.query('force', force, 'bool')
    if (timeout is not None):
        query_parameters['timeout'] = self._serialize.query('timeout', timeout, 'long', maximum=4294967295, minimum=1)
    header_parameters = {}
    header_parameters['Content-Type'] = 'application/json;    charset=utf-8'
    if custom_headers:
        header_parameters.update(custom_headers)
    request = self._client.post(url, query_parameters)
    response = self._client.send(request, header_parameters, **operation_config)
    if (response.status_code not in [200]):
        raise models.FabricErrorException(self._deserialize, response)
    if raw:
        client_raw_response = ClientRawResponse(None, response)
        return client_raw_response
