vcplatform.vcconnection module

class vcplatform.vcconnection.VCConnection(**kwargs)[source]

Bases: volttron.platform.vip.agent.Agent

This agent will connect to an instance with volttron.central agent connected to it. The volttron.central agent will use this agent to communicate with the platform.agent(vcp) running on the current instance of the platform.

agent_status(agent_uuid)[source]

Retrieves the status of a particular agent executing on the vcp instance. The agent does not have to be executing in order to receive it’s status.

Parameters:

agent_uuid

Returns:

call(platform_method, *args, **kwargs)[source]
delete_agent_config(agent_identity, config_name)[source]

Deletes the configuration from the config store of the passed agent identity.

Parameters:
  • agent_identity

  • config_name

Returns:

The stored configuration.

get_agent_config(agent_identity, config_name, raw=True)[source]

Retrieve the configuration from the config store of the passed agent identity.

Parameters:
  • agent_identity

  • config_name

  • raw

Returns:

The stored configuration.

get_devices()[source]

Retrieves configuration entries from the config store that begin with ‘devices’.

Returns:

dictionary of devices.

get_health()[source]

Retrieve the health of the vcp agent.

Returns:

get_instance_name()[source]
get_instance_uuid()[source]

Retrieve the instance uuid for the vcp agent’s instance.

Returns:

get_vip_addresses()[source]

Retrieves the vip addresses that were specified in the configuration file or via command line.

Returns:

install_agent(local_wheel_file)[source]

Installs :param local_wheel_file: :return:

is_connected()[source]
is_peer_connected(peer='volttron.central')[source]
kill()[source]

Dummy method to use install_agent_vctl

list_agent_configs(agent_identity)[source]

List the agent configuration files stored on the volttron instance associated with this agent.

Parameters:

agent_identity – Agent identity to retrieve configuration from.

Returns:

A list of the configuration names.

list_agents()[source]

Calls list_agents method on the vcp main agent instance.

Note

This method only valid for installed agents not dynamic agents.

Returns:

publish_bacnet_props(proxy_identity, publish_topic, address, device_id, filter=[])[source]
publish_to_vc(topic, message=None, headers={})[source]

This method allows the main_agent to publish a message up to the volttron.central instance.

Parameters:
  • topic

  • message

  • headers

restart(agent_uuid)[source]

Performs the stop and start operations on the vcp instance for an agent.

Parameters:

agent_uuid

Returns:

restart_agent(agent_uuid)[source]

Calls restart method on the vcp main agent instance.

Note

This method only valid for installed agents not dynamic agents.

Parameters:

agent_uuid

Returns:

route_to_agent_method(id, agent_method, params)[source]

Calls a method on an installed agent running on the platform.

Note

This method only valid for installed agents not dynamic agents.

Parameters:
  • id

  • agent_method

  • params

Returns:

set_main_agent(main_agent)[source]

The main agent is the VCP that is using this agent to connect to the remote volttron instance.

Parameters:

main_agent – the agent that instantiated this one.

start_agent(agent_uuid)[source]

Start an agent that is already present on the vcp instance.

Parameters:

agent_uuid

Returns:

start_bacnet_scan(iam_topic, proxy_identity, low_device_id=None, high_device_id=None, target_address=None, scan_length=5)[source]

Starts a bacnet scan using the the named proxy_identity as the callee.

Parameters:
  • iam_topic

  • proxy_identity

  • low_device_id

  • high_device_id

  • target_address

  • scan_length

Returns:

status_agents()[source]

Return all of the installed agents’ statuses for the vcp instance.

Returns:

stop_agent(agent_uuid)[source]

Stop an agent already running on the vcp instance.

Parameters:

agent_uuid

Returns:

store_agent_config(agent_identity, config_name, raw_contents, config_type='raw')[source]

Store an agent configuration on the volttron instance associated with this agent.

Parameters:
  • agent_identity

  • config_name

  • raw_contents

  • config_type

Returns:

None

subscribe_to_vcp(prefix, prefix_on_vc)[source]

Allows volttron.central to listen to the message bus on vcp instance.

Parameters:
  • prefix – The prefix to listen for.

  • prefix_on_vc – The prefix to publish to on volttron central instance.