public Diagnostic diagnoseInstance ( String applicationName , String instancePath ) throws DebugWsException { this . logger . finer ( "Diagnosing instance " + instancePath + " in application " + applicationName ) ; WebResource path = this . resource . path ( UrlConstants . DEBUG ) . path ( "diagnose-instance" ) ; path = path . queryParam ( "application-name" , applicationName ) ; path = path . queryParam ( "instance-path" , instancePath ) ; ClientResponse response = this . wsClient . createBuilder ( path ) . accept ( MediaType . APPLICATION_JSON ) . get ( ClientResponse . class ) ; if ( Family . SUCCESSFUL != response . getStatusInfo ( ) . getFamily ( ) ) { String value = response . getEntity ( String . class ) ; this . logger . finer ( response . getStatusInfo ( ) + ": " + value ) ; throw new DebugWsException ( response . getStatusInfo ( ) . getStatusCode ( ) , value ) ; } this . logger . finer ( String . valueOf ( response . getStatusInfo ( ) ) ) ; return response . getEntity ( Diagnostic . class ) ; }
Runs a diagnostic for a given instance .