'Gets the health of a Service Fabric application using the specified
policy.
Gets the health of a Service Fabric application. Use
EventsHealthStateFilter to filter the collection of health events
reported on the node based on the health state. Use
ClusterHealthPolicies to override the health policies used to
evaluate the health.
:param application_id: The identity of the application. This is
typically the full name of the application without the \'fabric:\' URI
scheme.
:type application_id: str
:param events_health_state_filter: Allows filtering the collection of
HealthEvent objects returned based on health state.
The possible values for this parameter include integer value of one
of the following health states.
Only events that match the filter are returned. All events are used
to evaluate the aggregated health state.
If not specified, all entries are returned. The state values are flag
based enumeration, so the value could be a combination of these
value obtained using bitwise \'OR\' operator. For example, If the
provided value is 6 then all of the events with HealthState value of
OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is
zero.
- None - Filter that doesnât match any HealthState value. Used in
order to return no results on a given collection of states. The
value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value
is 2.
- Warning - Filter that matches input with HealthState value Warning.
The value is 4.
- Error - Filter that matches input with HealthState value Error. The
value is 8.
- All - Filter that matches input with any HealthState value. The
value is 65535.
:type events_health_state_filter: int
:param deployed_applications_health_state_filter: Allows filtering of
the deployed applications health state objects returned in the
result of application health query based on their health state.
The possible values for this parameter include integer value of one
of the following health states. Only deployed applications that
match the filter will be returned.\
All deployed applications are used to evaluate the aggregated health
state. If not specified, all entries are returned.
The state values are flag based enumeration, so the value could be a
combination of these value obtained using bitwise \'OR\' operator.
For example, if the provided value is 6 then health state of deployed
applications with HealthState value of OK (2) and Warning (4) are
returned.
- Default - Default value. Matches any HealthState. The value is
zero.
- None - Filter that doesn\'t match any HealthState value. Used in
order to return no results on a given collection of states. The
value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value
is 2.
- Warning - Filter that matches input with HealthState value Warning.
The value is 4.
- Error - Filter that matches input with HealthState value Error. The
value is 8.
- All - Filter that matches input with any HealthState value. The
value is 65535.
:type deployed_applications_health_state_filter: int
:param services_health_state_filter: Allows filtering of the services
health state objects returned in the result of services health query
based on their health state.
The possible values for this parameter include integer value of one
of the following health states.
Only services that match the filter are returned. All services are
used to evaluate the aggregated health state.
If not specified, all entries are returned. The state values are flag
based enumeration, so the value could be a combination of these value
obtained using bitwise \'OR\' operator. For example, if the provided
value is 6 then health state of services with HealthState value of
OK (2) and Warning (4) will be returned.
- Default - Default value. Matches any HealthState. The value is
zero.
- None - Filter that doesnï¿œt match any HealthState value. Used in
order to return no results on a given collection of states. The
value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value
is 2.
- Warning - Filter that matches input with HealthState value Warning.
The value is 4.
- Error - Filter that matches input with HealthState value Error. The
value is 8.
- All - Filter that matches input with any HealthState value. The
value is 65535.
:type services_health_state_filter: int
:param application_health_policy: Describes the health policies used
to evaluate the health of an application or one of its children.
If not present, the health evaluation uses the health policy from
application manifest or the default health policy.
:type application_health_policy: :class:`ApplicationHealthPolicy
<azure.servicefabric.models.ApplicationHealthPolicy>`
: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: :class:`ApplicationHealth
<azure.servicefabric.models.ApplicationHealth>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises:
:class:`FabricErrorException<azure.servicefabric.models.FabricErrorException>`'

def get_application_health_using_policy(self, application_id, events_health_state_filter=0, deployed_applications_health_state_filter=0, services_health_state_filter=0, application_health_policy=None, timeout=60, custom_headers=None, raw=False, **operation_config):

    api_version = '3.0'
    url = '/Applications/{applicationId}/$/GetHealth'
    path_format_arguments = {'applicationId': self._serialize.url('application_id', application_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 (events_health_state_filter is not None):
        query_parameters['EventsHealthStateFilter'] = self._serialize.query('events_health_state_filter', events_health_state_filter, 'int')
    if (deployed_applications_health_state_filter is not None):
        query_parameters['DeployedApplicationsHealthStateFilter'] = self._serialize.query('deployed_applications_health_state_filter', deployed_applications_health_state_filter, 'int')
    if (services_health_state_filter is not None):
        query_parameters['ServicesHealthStateFilter'] = self._serialize.query('services_health_state_filter', services_health_state_filter, 'int')
    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)
    if (application_health_policy is not None):
        body_content = self._serialize.body(application_health_policy, 'ApplicationHealthPolicy')
    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 [200]):
        raise models.FabricErrorException(self._deserialize, response)
    deserialized = None
    if (response.status_code == 200):
        deserialized = self._deserialize('ApplicationHealth', response)
    if raw:
        client_raw_response = ClientRawResponse(deserialized, response)
        return client_raw_response
    return deserialized
