'Update alert policy using the CLC API.
:param alert_policy_id: The clc alert policy id
:return: response dictionary from the CLC API.'

def _update_alert_policy(self, alert_policy_id):

    p = self.module.params
    alias = p['alias']
    email_list = p['alert_recipients']
    metric = p['metric']
    duration = p['duration']
    threshold = p['threshold']
    policy_name = p['name']
    arguments = json.dumps({'name': policy_name, 'actions': [{'action': 'email', 'settings': {'recipients': email_list}}], 'triggers': [{'metric': metric, 'duration': duration, 'threshold': threshold}]})
    try:
        result = self.clc.v2.API.Call('PUT', ('/v2/alertPolicies/%s/%s' % (alias, alert_policy_id)), arguments)
    except APIFailedResponse as e:
        return self.module.fail_json(msg='Unable    to    update    alert    policy    "{0}".    {1}'.format(policy_name, str(e.response_text)))
    return result
