name: Enable node_cleanup maintenance task and change the delete_window
testcases:
- name: get_login_token
  steps:
  - type: get_login_token

- name: enable_node_cleanup_task
  steps:
  - type: http
    method: PATCH
    url: '{{.pfserver_webadmin_url}}/api/v1/config/maintenance_task/node_cleanup'
    ignore_verify_ssl: true
    body: >-
      {
        "status": "enabled"
      }
    headers:
      "Authorization": "{{.get_login_token.result.token}}"
      "Content-Type": "application/json"
    assertions:
      - result.statuscode ShouldEqual 200

- name: change_delete_window
  steps:
  - type: http
    method: PATCH
    url: '{{.pfserver_webadmin_url}}/api/v1/config/maintenance_task/node_cleanup'
    ignore_verify_ssl: true
    body: >-
      {
        "delete_window": {
          "interval": "{{.node_cleanup.delete_window.interval}}",
          "unit": "{{.node_cleanup.delete_window.unit}}"
        }
      }
    headers:
      "Authorization": "{{.get_login_token.result.token}}"
      "Content-Type": "application/json"
    assertions:
      - result.statuscode ShouldEqual 200
