#!/bin/bash 

function Send_Deployment_Message {
	rmq_client_executable=$1
	rmq_config_file=$2
	minion_id=$3
	deployment_id=$4
	timestamp=$5
	status=$6
	description=$7

	queue="agent-deployment-result"
	
	content=$(jq -n   --arg MinionID $minion_id \
			--arg DeploymentID $deployment_id \
			--arg InvokedOn "$timestamp" \
			--arg Status "$status" \
			--arg StatusDesc "$description" \
	'{"MinionID": ($MinionID|tonumber), "DeploymentID": ($DeploymentID|tonumber), "InvokedOn": $InvokedOn, "Status": $Status, "StatusDesc": $StatusDesc}')

	Send_Message_To_Queue "$rmq_client_executable" "$rmq_config_file" "$content" "$queue"
}

