'Set or update an specific consumer resource types.
:param consumer: should be an AgentConsumer object, with agent_type
and host set. This acts as the unique ID for the
agent.
:param versions: should be a dictionary in the following format:
{\'QosPolicy\': \'1.1\',
\'SecurityGroup\': \'1.0\',
\'Port\': \'1.0\'}'

def set_versions(self, consumer, versions):

    for (resource_type, resource_version) in versions.items():
        self._set_version(consumer, resource_type, resource_version)
    if versions:
        self._cleanup_removed_versions(consumer, versions)
    else:
        self._handle_no_set_versions(consumer)
