All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.elasticsearch.license.RestGetFeatureUsageAction Maven / Gradle / Ivy

There is a newer version: 8.16.0
Show newest version
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

package org.elasticsearch.license;

import org.elasticsearch.client.internal.node.NodeClient;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;

import java.io.IOException;
import java.util.List;

import static org.elasticsearch.rest.RestRequest.Method.GET;

public class RestGetFeatureUsageAction extends BaseRestHandler {

    @Override
    public String getName() {
        return "get_feature_usage";
    }

    @Override
    public List routes() {
        return List.of(new Route(GET, "/_license/feature_usage"));
    }

    @Override
    protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
        return channel -> client.execute(
            TransportGetFeatureUsageAction.TYPE,
            new GetFeatureUsageRequest(),
            new RestToXContentListener<>(channel)
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy