Search in sources :

Example 1 with GetAclResponse

use of com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetAclResponse in project vespa by vespa-engine.

the class RealNodeRepository method getContainerAclSpecs.

@Override
public List<ContainerAclSpec> getContainerAclSpecs(String hostName) {
    try {
        final String path = String.format("/nodes/v2/acl/%s?children=true", hostName);
        final GetAclResponse response = configServerApi.get(path, GetAclResponse.class);
        return response.trustedNodes.stream().map(node -> new ContainerAclSpec(node.hostname, node.ipAddress, ContainerName.fromHostname(node.trustedBy))).collect(Collectors.toList());
    } catch (HttpException.NotFoundException e) {
        return Collections.emptyList();
    }
}
Also used : NodeAttributes(com.yahoo.vespa.hosted.node.admin.nodeagent.NodeAttributes) GetAclResponse(com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetAclResponse) ContainerName(com.yahoo.vespa.hosted.dockerapi.ContainerName) Environment(com.yahoo.vespa.hosted.node.admin.component.Environment) Node(com.yahoo.vespa.hosted.provision.Node) UpdateNodeAttributesRequestBody(com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.UpdateNodeAttributesRequestBody) Collectors(java.util.stream.Collectors) HttpException(com.yahoo.vespa.hosted.node.admin.configserver.HttpException) ArrayList(java.util.ArrayList) Objects(java.util.Objects) List(java.util.List) ContainerNodeSpec(com.yahoo.vespa.hosted.node.admin.ContainerNodeSpec) DockerImage(com.yahoo.vespa.hosted.dockerapi.DockerImage) ConfigServerApi(com.yahoo.vespa.hosted.node.admin.configserver.ConfigServerApi) GetNodesResponse(com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetNodesResponse) ContainerAclSpec(com.yahoo.vespa.hosted.node.admin.ContainerAclSpec) Optional(java.util.Optional) SslConfigServerApiImpl(com.yahoo.vespa.hosted.node.admin.configserver.SslConfigServerApiImpl) NodeMessageResponse(com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.NodeMessageResponse) UpdateNodeAttributesResponse(com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.UpdateNodeAttributesResponse) Collections(java.util.Collections) PrefixLogger(com.yahoo.vespa.hosted.node.admin.util.PrefixLogger) HttpException(com.yahoo.vespa.hosted.node.admin.configserver.HttpException) GetAclResponse(com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetAclResponse) ContainerAclSpec(com.yahoo.vespa.hosted.node.admin.ContainerAclSpec)

Aggregations

ContainerName (com.yahoo.vespa.hosted.dockerapi.ContainerName)1 DockerImage (com.yahoo.vespa.hosted.dockerapi.DockerImage)1 ContainerAclSpec (com.yahoo.vespa.hosted.node.admin.ContainerAclSpec)1 ContainerNodeSpec (com.yahoo.vespa.hosted.node.admin.ContainerNodeSpec)1 Environment (com.yahoo.vespa.hosted.node.admin.component.Environment)1 ConfigServerApi (com.yahoo.vespa.hosted.node.admin.configserver.ConfigServerApi)1 HttpException (com.yahoo.vespa.hosted.node.admin.configserver.HttpException)1 SslConfigServerApiImpl (com.yahoo.vespa.hosted.node.admin.configserver.SslConfigServerApiImpl)1 GetAclResponse (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetAclResponse)1 GetNodesResponse (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetNodesResponse)1 NodeMessageResponse (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.NodeMessageResponse)1 UpdateNodeAttributesRequestBody (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.UpdateNodeAttributesRequestBody)1 UpdateNodeAttributesResponse (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.UpdateNodeAttributesResponse)1 NodeAttributes (com.yahoo.vespa.hosted.node.admin.nodeagent.NodeAttributes)1 PrefixLogger (com.yahoo.vespa.hosted.node.admin.util.PrefixLogger)1 Node (com.yahoo.vespa.hosted.provision.Node)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 List (java.util.List)1 Objects (java.util.Objects)1