summaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/bindings/GetWireguardResponse.java
blob: a71b2a74b31691d6871fd3c7fc87e6fb36c5d68f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

/**
 * A response from the /nodes/v2/wireguard api.
 *
 * @author gjoranv
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GetWireguardResponse {

    public final List<Configserver> configservers;

    @JsonCreator
    public GetWireguardResponse(@JsonProperty("configservers") List<Configserver> configservers) {
        this.configservers = configservers;
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Configserver {

        @JsonProperty("hostname")
        public final String hostname;

        @JsonProperty("ipAddresses")
        public final List<String> ipAddresses;

        @JsonProperty("wireguardPubkey")
        public final String wireguardPubkey;

        @JsonCreator
        public Configserver(@JsonProperty("hostname") String hostname,
                            @JsonProperty("ipAddresses") List<String> ipAddresses,
                            @JsonProperty("wireguardPubkey") String wireguardPubkey) {
            this.hostname = hostname;
            this.ipAddresses = ipAddresses;
            this.wireguardPubkey = wireguardPubkey;
        }
    }

}