An Ansible module that enables Continuous Delivery with Red Hat 3scale API Management Platform (3scale AMP)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
1.1 KiB

---
- set_fact:
threescale_cicd_tmp_metrics_to_delete: []
- set_fact:
threescale_cicd_tmp_metrics_to_delete: '{{ threescale_cicd_tmp_metrics_to_delete|union([threescale_cicd_tmp_metric.id]) }}'
with_items: '{{ threescale_cicd_existing_metrics_details }}'
loop_control:
loop_var: threescale_cicd_tmp_metric
when: 'threescale_cicd_tmp_metric.system_name != "hits" and threescale_cicd_tmp_metric.system_name not in threescale_cicd_api_operations'
- name: Delete the method
uri:
url: "https://{{ inventory_hostname }}/admin/api/services/{{ threescale_cicd_api_service_id }}/metrics/{{ threescale_cicd_metric_id }}/methods/{{ threescale_cicd_tmp_metric }}.json?access_token={{ threescale_cicd_access_token|urlencode }}"
validate_certs: no
method: DELETE
register: threescale_cicd_tmpresponse
changed_when: 'threescale_cicd_tmpresponse.status == 200'
with_items: '{{ threescale_cicd_tmp_metrics_to_delete }}'
loop_control:
loop_var: threescale_cicd_tmp_metric
- name: Wait for a couple seconds
pause:
seconds: '{{ threescale_cicd_throttling }}'