Codify RestconfServer.yangLibraryVersionGET()
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / server / api / RestconfServer.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.restconf.server.api;
9
10 import java.net.URI;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.restconf.common.errors.RestconfFuture;
13 import org.opendaylight.restconf.nb.rfc8040.databind.OperationInputBody;
14 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
15 import org.opendaylight.restconf.server.spi.OperationOutput;
16
17 /**
18  * An implementation of a RESTCONF server, implementing the
19  * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-3.3">RESTCONF API Resource</a>.
20  */
21 @NonNullByDefault
22 public interface RestconfServer {
23     /**
24      * Return the revision of {@code ietf-yang-library} module implemented by this server, as defined in
25      * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-3.3.3">RFC8040 {+restconf}/yang-library-version</a>.
26      *
27      * @return A {@code yang-library-version} element
28      */
29     // FIXME: this is a simple coning-variadic return, similar to how OperationsContent is handled use a common
30     //        construct for both cases
31     // FIXME: RestconfFuture if we transition to being used by restconf-client implementation
32     NormalizedNodePayload yangLibraryVersionGET();
33
34     // FIXME: use ApiPath instead of String
35     RestconfFuture<OperationOutput> invokeRpc(URI restconfURI, String apiPath, OperationInputBody body);
36 }