# @file
#
#  Unit test data strategy.yaml file for testing the NextHopStrategyFactory
#
#  @section license License
#
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you under the Apache License, Version 2.0 (the
#  "License"); you may not use this file except in compliance
#  with the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#
#  @section details Details
#
#
# unit test 'peering' with combined hosts and strategies, peering.yaml example
#
hosts:
  - &p1 # shorthand name of host object, with an "anchor name"
    host: p1.bar.com # name or IP of host
    hash_string: slsklslsk # optional hash string that replaces the hostname in consistent hashing.
    protocol:
      - scheme: http
        port: 80
        health_check_url: http://192.168.1.1:80
      - scheme: https
        port: 443
        health_check_url: https://192.168.1.1:443
  - &p2
    host: p2.bar.com
    protocol:
      - scheme: http
        port: 80
        health_check_url: http://192.168.1.2:80
      - scheme: https
        port: 443
        health_check_url: https://192.168.1.2:443
  - &p3
    host: p3.bar.com
    protocol:
      - scheme: http
        port: 80
        health_check_url: http://192.168.1.3:80
      - scheme: https
        port: 443
        health_check_url: https://192.168.1.3:443
  - &p4
    host: p4.bar.com
    protocol:
      - scheme: http
        port: 8080
        health_check_url: http://192.168.1.4:8080
      - scheme: https
        port: 8443
        health_check_url: https://192.168.1.5:8443
  - &m1
    host: m1.bar.com
    protocol:
      - scheme: http
        port: 80
        health_check_url: http://192.168.2.1:80
      - scheme: https
        port: 443
        health_check_url: https://192.168.2.1:443
  - &m2
    host: m2.bar.com
    protocol:
      - scheme: http
        port: 80
        health_check_url: http://192.168.2.2:80
      - scheme: https
        port: 443
        health_check_url: https://192.168.2.2:443
  - &m3
    host: m3.bar.com
    protocol:
      - scheme: http
        port: 80
        health_check_url: http://192.168.2.3:80
      - scheme: https
        port: 443
        health_check_url: https://192.168.2.3:443
groups:
  - &g1
    - <<: *p1
      weight: 0.25
    - <<: *p2
      weight: 0.25
    - <<: *p3
      weight: 0.25
    - <<: *p4
      weight: 0.25
  - &g2
    - <<: *m1
      weight: 0.33
    - <<: *m2
      weight: 0.33
    - <<: *m3
      weight: 0.33
strategies:
  - strategy: "peering-group-1"
    policy: consistent_hash
    go_direct: false
    parent_is_proxy: true
    cache_peer_result: false
    groups:
      - *g1
      - *g2
    scheme: http
    failover:
      max_simple_retries: 2
      ring_mode:
        peering_ring
      self:
        p3.bar.com
      response_codes: # defines the responses codes for failover in exhaust_ring mode
        - 404
      health_check: # specifies the list of healthchecks that should be considered for failover. A list of enums: 'passive' or 'active'
        - passive
        - active
