name: Check if node01 is offline
testcases:
- name: get_login_token
  steps:
  - type: get_login_token

- name: check_offline_status
  steps:
  - type: http
    method: POST
    url: '{{.pfserver_webadmin_url}}/api/v1/nodes/search'
    ignore_verify_ssl: true
    body: >-
      {
        "cursor": 0,
        "fields": [
          "online"
        ],
        "limit": 1,
        "query": {
          "op": "and",
          "values": [
            {
              "op": "or",
              "values": [
                {
                  "field": "mac",
                  "op": "equals",
                  "value": "{{.node01_ens7_mac_address}}"
                }
              ]
            }
          ]
        }
      }
    headers:
      "Authorization": "{{.get_login_token.result.token}}"
      "Content-Type": "application/json"
    assertions:
      - result.statuscode ShouldEqual 200
      - result.bodyjson.items.items0.online ShouldEqual off
  
