'Removes a service replica running on a node.
This API simulates a Service Fabric replica failure by removing a
replica from a Service Fabric cluster. The removal closes the
replica, transitions the replica to the role None, and then removes
all of the state information of the replica from the cluster. This
API tests the replica state removal path, and simulates the report
fault permanent path through client APIs. Warning - There are no
safety checks performed when this API is used. Incorrect use of this
API can lead to data loss for stateful services.In addition, the
forceRemove flag impacts all other replicas hosted in the same
process.
:param node_name: The name of the node.
:type node_name: str
:param partition_id: The identity of the partition.
:type partition_id: str
:param replica_id: The identifier of the replica.
:type replica_id: str
:param force_remove: Remove a Service Fabric application or service
forcefully without going through the graceful shutdown sequence.
This parameter can be used to forcefully delete an application or
service for which delete is timing out due to issues in the service
code that prevents graceful close of replicas.
:type force_remove: 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 remove_replica(self, node_name, partition_id, replica_id, force_remove=None, timeout=60, custom_headers=None, raw=False, **operation_config):

    api_version = '3.0'
    url = '/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Delete'
    path_format_arguments = {'nodeName': self._serialize.url('node_name', node_name, 'str'), 'partitionId': self._serialize.url('partition_id', partition_id, 'str', skip_quote=True), 'replicaId': self._serialize.url('replica_id', replica_id, 'str', skip_quote=True)}
    url = self._client.format_url(url, **path_format_arguments)
    query_parameters = {}
    query_parameters['api-version'] = self._serialize.query('api_version', api_version, 'str')
    if (force_remove is not None):
        query_parameters['ForceRemove'] = self._serialize.query('force_remove', force_remove, '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
