azure-servicebus/azure/servicebus/control_client/servicebusservice.py
def send_event(self, hub_name, message, device_id=None,
                   broker_properties=None):
        '''
        Sends a new message event to an Event Hub.
        '''
        _validate_not_none('hub_name', hub_name)
        request = HTTPRequest()
        request.method = 'POST'
        request.host = self._get_host()
        if device_id:
            request.path = '/{0}/publishers/{1}/messages?api-version=2014-01'.format(hub_name, device_id)
        else:
            request.path = '/{0}/messages?api-version=2014-01'.format(hub_name)
        if broker_properties:
            request.headers.append(
                ('BrokerProperties', str(broker_properties)))
        request.body = _get_request_body(message)
        request.path, request.query = self._httpclient._update_request_uri_query(request)  # pylint: disable=protected-access
        request.headers = self._update_service_bus_header(request)
        self._perform_request(request)
def send_event(self, hub_name, message, device_id=None,
                   broker_properties=None):
        '''
        Sends a new message event to an Event Hub.
        '''
        _validate_not_none('hub_name', hub_name)
        request = HTTPRequest()
        request.method = 'POST'
        request.host = self._get_host()
        if device_id:
            request.path = '/{0}/publishers/{1}/messages?api-version=2014-01'.format(hub_name, device_id)
        else:
            request.path = '/{0}/messages?api-version=2014-01'.format(hub_name)
        if broker_properties:
            request.headers.append(
                ('BrokerProperties', str(broker_properties)))
        request.body = _get_request_body(message)
        request.path, request.query = self._httpclient._update_request_uri_query(request)  # pylint: disable=protected-access
        request.headers = self._update_service_bus_header(request)
        self._perform_request(request)
def send_event ( self , hub_name , message , device_id = None , broker_properties = None ) : _validate_not_none ( 'hub_name' , hub_name ) request = HTTPRequest ( ) request . method = 'POST' request . host = self . _get_host ( ) if device_id : request . path = '/{0}/publishers/{1}/messages?api-version=2014-01' . format ( hub_name , device_id ) else : request . path = '/{0}/messages?api-version=2014-01' . format ( hub_name ) if broker_properties : request . headers . append ( ( 'BrokerProperties' , str ( broker_properties ) ) ) request . body = _get_request_body ( message ) request . path , request . query = self . _httpclient . _update_request_uri_query ( request ) # pylint: disable=protected-access request . headers = self . _update_service_bus_header ( request ) self . _perform_request ( request )
Sends a new message event to an Event Hub.
Sends a new message event to an Event Hub .