aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/bindings/GetNodesResponse.java
blob: b744c935247f2e26d3aa0671296c28557ddd8f24 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
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.JsonProperty;

import java.util.Collections;
import java.util.List;

/**
 * This class represents a response from the /nodes/v2/node/ API. It is designed to be
 * usable by any module, by not depending itself on any module-specific classes.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class GetNodesResponse {

    public final List<NodeRepositoryNode> nodes;

    @JsonCreator
    public GetNodesResponse(@JsonProperty("nodes") List<NodeRepositoryNode> nodes) {
        this.nodes = Collections.unmodifiableList(nodes);
    }

}