AMQPStorm Client Properties.

        :rtype: dict
960236
def _client_properties():
        
        return {
            'product': 'AMQPStorm',
            'platform': 'Python %s (%s)' % (platform.python_version(),
                                            platform.python_implementation()),
            'capabilities': {
                'basic.nack': True,
                'connection.blocked': True,
                'publisher_confirms': True,
                'consumer_cancel_notify': True,
                'authentication_failure_close': True,
            },
            'information': 'See https://github.com/eandersson/amqpstorm',
            'version': __version__
        }
667009
def get_client_settings_args(**kwargs):
    
    timeout = kwargs.get('timeout')
    if timeout is not None:
        timeout = float(timeout)

    return {
        'endpoint_url': kwargs.get('endpoint_url'),
        'timeout': timeout,
        'proxy': kwargs.get('proxy'),
        'username': kwargs.get('username'),
        'api_key': kwargs.get('api_key'),
    }
257770
def tunnel_bindings(self):
        
        return dict((_server.remote_address, _server.local_address) for
                    _server in self._server_list if
                    self.tunnel_is_up[_server.local_address])
642219
def create_sockets(self):
        """"""

        ports = self.ports

        context = zmq.Context()
        poller = zmq.Poller()

        # Socket to handle init data
        rep = context.socket(zmq.REP)
        # this was inconsequent: here REQ is for the client, we reply with REP.
        # PULL and PUB is seen from here, not from the client.
        # Is now renamed to PUSH and SUB: everything is seen from outside.
        if "REQ" in ports:
            rep.bind(
                "tcp://*:{port}".format(port=ports["REQ"])
            )
        else:
            ports["REQ"] = rep.bind_to_random_port(
                "tcp://*"
            )

        pull = context.socket(zmq.PULL)
        if "PUSH" in ports:
            pull.bind(
                "tcp://*:{port}".format(port=ports["PUSH"])
            )
        else:
            ports["PUSH"] = pull.bind_to_random_port(
                "tcp://*"
            )

        # for sending model messages
        pub = context.socket(zmq.PUB)
        if "SUB" in ports:
            pub.bind(
                "tcp://*:{port}".format(port=ports["SUB"])
            )
        else:
            ports["SUB"] = pub.bind_to_random_port(
                "tcp://*"
            )

        poller.register(rep, zmq.POLLIN)
        poller.register(pull, zmq.POLLIN)

        sockets = dict(
            poller=poller,
            rep=rep,
            pull=pull,
            pub=pub
        )
        return sockets
908819
def emit(self, record):
        
        if not record.name == "amqp":
            data = {}
            for k, v in record.__dict__.items():
                if (self.__includes and k in self.__includes) or (self.__excludes and k not in self.__excludes):
                    data[k] = v
            self.__producer.publish(data, retry=True, delivery_mode=2)
256233
def properties(self):
        
        return {
            "customAnnotatorClass.{}".format(self.name): "edu.stanford.nlp.pipeline.GenericWebServiceAnnotator",
            "generic.endpoint": "http://{}:{}".format(self.host, self.port),
            "generic.requires": ",".join(self.requires),
            "generic.provides": ",".join(self.provides),
            }
1189411
void populateClientProperties(Map properties)
    {
        if (properties != null && !properties.isEmpty())
        {
            Map<String, Client> clientMap = getDelegate();
            if (!clientMap.isEmpty())
            {
                // TODO If we have two pu for same client then? Need to discuss
                // with Amresh.
                for (Client client : clientMap.values())
                {
                    if (client instanceof ClientPropertiesSetter)
                    {
                        ClientPropertiesSetter cps = (ClientPropertiesSetter) client;
                        cps.populateClientProperties(client, properties);
                    }
                }
            }
        }
        else
        {
            if (log.isDebugEnabled())
            {
                log.debug("Can't set Client properties as None/ Null was supplied");
            }
        }
    }
766628
def get_default_properties(event)
      client = event['client']
      check = event['check']
      {
        server_name: client['name'],
        server_ip: client['address'],
        subscriptions: client['subscriptions'].join(';'),
        environment: client['environment'],
        check_name: check['name'],
        check_command: check['command'],
        check_output: check['output'],
        timestamp: event['timestamp'].inspect
      }
    end
427139
def setup(self):
        
        options = ""
        amqps_prefix = ""  # set amqps:// when SSL is used
        if self.get_option("ssl"):
            amqps_prefix = "amqps://"
        # for either present option, add --option=value to 'options' variable
        for option in ["ssl-certificate", "ssl-key"]:
            if self.get_option(option):
                amqps_prefix = "amqps://"
                options = (options + " --%s=" % (option) +
                           self.get_option(option))
        if self.get_option("port"):
            options = (options + " -b " + amqps_prefix +
                       "localhost:%s" % (self.get_option("port")))

        self.add_cmd_output([
            "qpid-stat -g" + options,  # applies since 0.18 version
            "qpid-stat -b" + options,  # applies to pre-0.18 versions
            "qpid-stat -c" + options,
            "qpid-stat -e" + options,
            "qpid-stat -q" + options,
            "qpid-stat -u" + options,
            "qpid-stat -m" + options,  # applies since 0.18 version
            "qpid-config exchanges" + options,
            "qpid-config queues" + options,
            "qpid-config exchanges -b" + options,  # applies to pre-0.18 vers.
            "qpid-config queues -b" + options,  # applies to pre-0.18 versions
            "qpid-config exchanges -r" + options,  # applies since 0.18 version
            "qpid-config queues -r" + options,  # applies since 0.18 version
            "qpid-route link list" + options,
            "qpid-route route list" + options,
            "qpid-cluster" + options,  # applies to pre-0.22 versions
            "qpid-ha query" + options,  # applies since 0.22 version
            "ls -lanR /var/lib/qpidd"
        ])

        self.add_copy_spec([
            "/etc/qpidd.conf",  # applies to pre-0.22 versions
            "/etc/qpid/qpidd.conf",  # applies since 0.22 version
            "/var/lib/qpid/syslog",
            "/etc/ais/openais.conf",
            "/var/log/cumin.log",
            "/var/log/mint.log",
            "/etc/sasl2/qpidd.conf",
            "/etc/qpid/qpidc.conf",
            "/etc/sesame/sesame.conf",
            "/etc/cumin/cumin.conf",
            "/etc/corosync/corosync.conf",
            "/var/lib/sesame",
            "/var/log/qpidd.log",
            "/var/log/sesame",
            "/var/log/cumin"
        ])
604238
def _client_data(self, client):
        
        data = {}
        if client:
            data['obj'] = client
            data['id'] = client.id
            data['url'] = client.absolute_url()
            data['name'] = to_utf8(client.getName())
        return data
178075
def get_clients(self, limit=None, offset=None):
        
        data = {}
        if limit:
            data['limit'] = limit
        if offset:
            data['offset'] = offset
        result = self._request('GET', '/clients', data=json.dumps(data))
        return result.json()
885944
def to_dict(self):
        ''''''
        d = {'connectorId': self.connector_id,
                'name': self.name,
                'dataType': self.data_type,
                'interfaceType': self.interface_type,
                'dataflowType': self.data_flow_type,
                'sourceDataPort': self.source_data_port.to_dict(),
                'targetDataPort': self.target_data_port.to_dict()}
        if self.visible != True:
            d[RTS_EXT_NS_YAML + 'visible'] = self.visible
        if self.subscription_type:
            d['subscriptionType'] = self.subscription_type
        if self.push_interval:
            d['pushInterval'] = self.push_interval
        if self.comment:
            d[RTS_EXT_NS_YAML + 'comment'] = self.comment
        props = []
        for name in self.properties:
            p = {'name': name}
            if self.properties[name]:
                p['value'] = str(self.properties[name])
            props.append(p)
        if props:
            d[RTS_EXT_NS_YAML + 'properties'] = props
        return d
979928
def get_args(self, client):
        
        default_args = self.default_args(client)

        if self.method_args or self.optional_args:
            optional_args = getattr(self, 'optional_args', tuple())
            args = []
            for arg in (self.method_args + optional_args):
                if hasattr(self, arg):
                    obj = getattr(self, arg)
                    if hasattr(obj, 'struct'):
                        args.append(obj.struct)
                    else:
                        args.append(obj)
            args = list(default_args) + args
        else:
            args = default_args

        return args
1120114
def properties
      properties = []
      contract_group_pairs.each do |cg|
        begin
          properties_hash = @client.get_json_body(
            "/papi/v0/properties/",
            { 'contractId' => cg[:contract], 'groupId' => cg[:group], }
          )
          if properties_hash && properties_hash['properties']['items']
            properties_hash['properties']['items'].each do |prp|
              properties << Property.new(prp)
            end
          end
        rescue Exception => e
          # probably due to Akamai PM permissions, don't raise for caller to handle
          puts "# unable to retrieve properties for (group=#{cg[:group]},contract=#{cg[:contract]}): #{e.message}"
        end
      end
      properties
    end
239014
def get_clients(self):
        
        public = self.channels['public']
        private = self.channels['private']
        return dict(public.items() + private.items())
393041
def as_dictionary(self):
        
        condition_dict = {
            "name": self.name,
            "timelock": self.timelock,
            "timeout": self.timeout,
            "contractName": self.contract_name,
            "functionName": self.function_name,
            "events": [e.as_dictionary() for e in self.events],
            "parameters": [p.as_dictionary() for p in self.parameters],
        }

        return condition_dict
284849
def prepare_message(self, message_data, delivery_mode, priority=None,
                content_type=None, content_encoding=None):
        """"""
        return amqp.Message(message_data, properties={
                "delivery_mode": delivery_mode,
                "priority": priority,
                "content_type": content_type,
                "content_encoding": content_encoding})