(self, request, tenant_id, entity_id)
return json.dumps(response_body)
Tests a check.

        If the user has configured overrides using the control API for
        test-check using this entity and check type, those will be used.
        Otherwise, random values within each metric type will be
        generated. For instance, integer metrics generate integers, and
        string metrics generate strings. No other guarantees are made.
Tests a check.
Tests a check .
def test_check(self, request, tenant_id, entity_id):
        """
        Tests a check.

        If the user has configured overrides using the control API for
        test-check using this entity and check type, those will be used.
        Otherwise, random values within each metric type will be
        generated. For instance, integer metrics generate integers, and
        string metrics generate strings. No other guarantees are made.
        """
        content = request.content.read()
        test_config = json.loads(content.decode("utf-8"))
        check_type = test_config['type']
        maas_store = self._entity_cache_for_tenant(tenant_id).maas_store
        response_code, response_body = maas_store.check_types[check_type].get_test_check_response(
            entity_id=entity_id,
            monitoring_zones=test_config.get('monitoring_zones_poll'),
            timestamp=int(1000 * self._session_store.clock.seconds()))
        request.setResponseCode(response_code)
        self._audit('checks', request, tenant_id, response_code, content)
        return json.dumps(response_body)
def test_check ( self , request , tenant_id , entity_id ) : content = request . content . read ( ) test_config = json . loads ( content . decode ( "utf-8" ) ) check_type = test_config [ 'type' ] maas_store = self . _entity_cache_for_tenant ( tenant_id ) . maas_store response_code , response_body = maas_store . check_types [ check_type ] . get_test_check_response ( entity_id = entity_id , monitoring_zones = test_config . get ( 'monitoring_zones_poll' ) , timestamp = int ( 1000 * self . _session_store . clock . seconds ( ) ) ) request . setResponseCode ( response_code ) self . _audit ( 'checks' , request , tenant_id , response_code , content ) return json . dumps ( response_body )