volttron.platform.vip.agent package¶
-
class
volttron.platform.vip.agent.
Agent
(identity=None, address=None, context=None, publickey=None, secretkey=None, serverkey=None, heartbeat_autostart=False, heartbeat_period=60, volttron_home='/home/docs/.volttron', agent_uuid=None, enable_store=True, enable_web=False, enable_channel=False, reconnect_interval=None, version='0.1', enable_fncs=False)[source]¶ Bases:
object
Subpackages¶
- volttron.platform.vip.agent.subsystems package
- Submodules
- volttron.platform.vip.agent.subsystems.auth module
- volttron.platform.vip.agent.subsystems.base module
- volttron.platform.vip.agent.subsystems.channel module
- volttron.platform.vip.agent.subsystems.configstore module
- volttron.platform.vip.agent.subsystems.health module
- volttron.platform.vip.agent.subsystems.heartbeat module
- volttron.platform.vip.agent.subsystems.hello module
- volttron.platform.vip.agent.subsystems.peerlist module
- volttron.platform.vip.agent.subsystems.ping module
- volttron.platform.vip.agent.subsystems.pubsub module
- volttron.platform.vip.agent.subsystems.query module
- volttron.platform.vip.agent.subsystems.rpc module
- volttron.platform.vip.agent.subsystems.volttronfncs module
- volttron.platform.vip.agent.subsystems.web module
Submodules¶
volttron.platform.vip.agent.compat module¶
-
class
volttron.platform.vip.agent.compat.
CompatPubSub
(identity=None, address=None, context=None, peer='pubsub', publish_address='inproc://vip/compat/agent/publish', subscribe_address='inproc://vip/compat/agent/subscribe')[source]¶ Bases:
object
VOLTTRON 2.x compatible agent pub/sub message exchange bus.
Accept multi-part messages from sockets connected to in_addr, which is a PULL socket, and forward them to sockets connected to out_addr, which is a XPUB socket. When subscriptions are added or removed, a message of the form ‘subscriptions/<OP>/<TOPIC>’ is broadcast to the PUB socket where <OP> is either ‘add’ or ‘remove’ and <TOPIC> is the topic being subscribed or unsubscribed. When a message is received of the form ‘subscriptions/list/<PREFIX>’, a multipart message will be broadcast with the first two received frames (topic and headers) sent unchanged and with the remainder of the message containing currently subscribed topics which start with <PREFIX>, each frame containing exactly one topic.
-
PEER
= 'pubsub'¶
-
PUBLISH_ADDRESS
= 'inproc://vip/compat/agent/publish'¶
-
SUBSCRIBE_ADDRESS
= 'inproc://vip/compat/agent/subscribe'¶
-
volttron.platform.vip.agent.connection module¶
-
class
volttron.platform.vip.agent.connection.
Connection
(address, peer=None, publickey=None, secretkey=None, serverkey=None, volttron_home=None, **kwargs)[source]¶ Bases:
object
A class that manages a connection to a peer and/or server.
-
address
¶
-
connected_since
¶
-
last_publish
¶
-
last_publish_failed
¶
-
last_rpc_call
¶
-
peer
¶
-
server
¶
-
serverkey
¶
-
volttron.platform.vip.agent.core module¶
-
class
volttron.platform.vip.agent.core.
BasicCore
(owner)[source]¶ Bases:
object
-
delay_onstart_signal
= False¶
-
delay_running_event_set
= False¶
-
-
class
volttron.platform.vip.agent.core.
Core
(owner, address=None, identity=None, context=None, publickey=None, secretkey=None, serverkey=None, volttron_home='/home/docs/.volttron', agent_uuid=None, reconnect_interval=None, version='0.1', enable_fncs=False)[source]¶ Bases:
volttron.platform.vip.agent.core.BasicCore
-
connected
¶
-
delay_onstart_signal
= True¶
-
delay_running_event_set
= True¶
-
volttron.platform.vip.agent.decorators module¶
-
class
volttron.platform.vip.agent.decorators.
dualmethod
(finstance=None, fclass=None, doc=None)[source]¶ Bases:
object
Descriptor to allow class and instance methods of the same name.
This class implements a descriptor that works similar to the classmethod() built-ins and can be used as a decorator, like the property() built-in. Instead of a method being only a class or instance method, two methods can share the same name and be accessed as an instance method or a class method based on the context.
Example:
>>> class Foo(object): ... @dualmethod ... def bar(self): ... print 'instance method for', self ... @bar.classmethod ... def bar(cls): ... print 'class method for', cls ... >>> Foo.bar() class method for <class '__main__.Foo'> >>> Foo().bar() instance method for <__main__.Foo object at 0x7fcd744f6610> >>>
volttron.platform.vip.agent.dispatch module¶
volttron.platform.vip.agent.errors module¶
-
exception
volttron.platform.vip.agent.errors.
VIPError
(errnum, msg, peer, subsystem, *args)[source]¶ Bases:
exceptions.Exception
-
exception
volttron.platform.vip.agent.errors.
Unreachable
(errnum, msg, peer, subsystem, *args)[source]¶
volttron.platform.vip.agent.example module¶
-
class
volttron.platform.vip.agent.example.
ExampleAgent
(identity=None, address=None, context=None, publickey=None, secretkey=None, serverkey=None, heartbeat_autostart=False, heartbeat_period=60, volttron_home='/home/docs/.volttron', agent_uuid=None, enable_store=True, enable_web=False, enable_channel=False, reconnect_interval=None, version='0.1', enable_fncs=False)[source]¶
volttron.platform.vip.agent.results module¶
-
volttron.platform.vip.agent.results.
counter
(start=None, minimum=0, maximum=18446744073709551615L)[source]¶
-
class
volttron.platform.vip.agent.results.
ResultsDictionary
[source]¶ Bases:
weakref.WeakValueDictionary
volttron.platform.vip.agent.utils module¶
-
volttron.platform.vip.agent.utils.
build_agent
(address='ipc://@/home/docs/.volttron/run/vip.socket', identity=None, publickey='iPdbzl2rdC9F3wm8uhzwdxKTEz-OCUTwKYOPeoNM9gA', secretkey='eIXfDeg5TogIlYdwareZ0JjOKKBXrAiRAn1CgJOWuVE', timeout=10, serverkey=None, agent_class=<class 'volttron.platform.vip.agent.Agent'>, **kwargs)[source]¶ Builds a dynamic agent connected to the specifiedd address.
All key parameters should have been encoded with
volttron.platform.vip.socket.encode_key()
Parameters: - address (str) – VIP address to connect to
- identity (str) – Agent’s identity
- publickey (str) – Agent’s Base64-encoded CURVE public key
- secretkey (str) – Agent’s Base64-encoded CURVE secret key
- serverkey (str) – Server’s Base64-encoded CURVE public key
- agent_class (class) – Class to use for creating the instance
- timeout (int) – Seconds to wait for agent to start
- kwargs – Any Agent specific parameters
Returns: an agent based upon agent_class that has been started
Return type: agent_class