Post a message for a service.

        Args:
            name (string): The short name of the service to query
            level (int): The level of the message (info, warning, error)
            message (string): The message contents
514163
async def send_message(self, name, level, message):
        

        if name not in self.services:
            raise ArgumentError("Unknown service name", short_name=name)

        msg = self.services[name]['state'].post_message(level, message)
        await self._notify_update(name, 'new_message', msg.to_dict())
500764
def Send(self, message):
    
    if not isinstance(message, common_pb2.Message):
      raise ValueError("Send requires a fleetspeak.Message")

    if message.destination.service_name == "system":
      raise ValueError(
          "Only predefined messages can have destination.service_name == \"system\"")

    return self._SendImpl(message)
747507
def api_post(message, url, name, http_data=None, auth=None):
    
    try:
        import requests
    except ImportError:
        print('requests is required to do api post.', file=sys.stderr)
        sys.exit(1)

    data = {name : message}
    if http_data:
        for var in http_data:
            key, value = var.split('=')
            data[key] = value

    response = requests.post(
        url,
        data=data,
        auth=auth
    )

    if response.status_code != 200:
        raise RuntimeError('Unable to post data')
5506
def post(self, *messages):
        
        url = "queues/%s/messages" % self.name

        msgs = [{'body': msg} if isinstance(msg, basestring) else msg
                for msg in messages]
        data = json.dumps({'messages': msgs})

        result = self.client.post(url=url, body=data,
                                  headers={'Content-Type': 'application/json'})

        return result['body']
891090
def assert_service_check(self, name, status=None, tags=None, count=None, at_least=1, hostname=None, message=None):
        
        tags = normalize_tags(tags, sort=True)
        candidates = []
        for sc in self.service_checks(name):
            if status is not None and status != sc.status:
                continue

            if tags and tags != sorted(sc.tags):
                continue

            if hostname is not None and hostname != sc.hostname:
                continue

            if message is not None and message != sc.message:
                continue

            candidates.append(sc)

        if count is not None:
            msg = "Needed exactly {} candidates for '{}', got {}".format(count, name, len(candidates))
            assert len(candidates) == count, msg
        else:
            msg = "Needed at least {} candidates for '{}', got {}".format(at_least, name, len(candidates))
            assert len(candidates) >= at_least, msg
652623
def add_message(self, msg_content, folder, **kwargs):
        
        content = {'m': kwargs}
        content['m']['l'] = str(folder)
        content['m']['content'] = {'_content': msg_content}

        return self.request('AddMsg', content)
25636
async def _on_message(self, update):
        """"""

        name = update['service']
        message_obj = update['payload']

        if name not in self.services:
            return

        with self._state_lock:
            self.services[name].post_message(message_obj['level'], message_obj['message'])
507873
def set_level(name, level):
    
    if name is None or name == "" or name == "bench":
        logging.getLogger("bench").setLevel(level)
    loggername = "bench." + name
    logging.getLogger(loggername).setLevel(level)
1196896
def get_messages(self, name):
        

        return self._loop.run_coroutine(self._client.get_messages(name))
1070861
def send_message(self, data, inc_session_id=False,
                     callback_function=None):
        
        self._check_registered()

        if not self.target_platform and \
           self.namespace not in self._socket_client.app_namespaces:
            if self.supporting_app_id is not None:
                self.launch()

            else:
                raise UnsupportedNamespace(
                    ("Namespace {} is not supported by running"
                     "application.").format(self.namespace))

        return self._message_func(
            self.namespace, data, inc_session_id, callback_function)
391995
public synchronized void postNotification(final String name, Object... args) {
		postNotification(name, ObjectUtils.toMap(args));
	}
962337
def send_message(self, message):
        
        if self._error:
            raise compat.saved_exc(self._error)
        elif self._transport is None:
            raise JsonRpcError('not connected')
        self._version.check_message(message)
        self._writer.write(serialize(message))
1205898
def post(self, message):
        
        return self.connection.post('echo/string', data=dict(message=message))
1053049
def send_msg(self, msg, wait_nak=True, wait_timeout=WAIT_TIMEOUT):
        
        msg_info = MessageInfo(msg=msg, wait_nak=wait_nak,
                               wait_timeout=wait_timeout)
        _LOGGER.debug("Queueing msg: %s", msg)
        self._send_queue.put_nowait(msg_info)
416268
def post(self, request: Request) -> None:
        

        if self._producer is None:
            raise ConfigurationException("Command Processor requires a BrightsideProducer to post to a Broker")
        if self._message_mapper_registry is None:
            raise ConfigurationException("Command Processor requires a BrightsideMessage Mapper Registry to post to a Broker")

        message_mapper = self._message_mapper_registry.lookup(request)
        message = message_mapper(request)
        self._message_store.add(message)
        self._producer.send(message)
1024946
def create_service(self, name, **kwargs):
        
        data = self._wrap_dict("service", kwargs)
        data["customer"]["name"] = name
        return self.post("/services.json", data=data)
525444
function _postMessage(args, name) {
                return this.circuit.run(function (success, failure, timeout) {
                    var message = _prepare.call(this, args, name, timeout);

                    if (message) {
                        try {
                            var initiated = this.messageChannel.postMessage.call(this.messageChannel, message);

                            if (false === initiated) {
                                failure();
                            }
                            else {
                                success();
                            }
                        }
                        catch (ex) {
                            failure();
                        }
                    }
                    else {
                        // Cache is full, as a fail fast mechanism, we should not continue
                        failure();
                    }
                }.bind(this));
            }