2 * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.restconf.server.api;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.restconf.api.ApiPath;
13 import org.opendaylight.restconf.common.errors.RestconfFuture;
14 import org.opendaylight.restconf.nb.rfc8040.databind.OperationInputBody;
15 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
16 import org.opendaylight.restconf.server.spi.OperationOutput;
19 * An implementation of a RESTCONF server, implementing the
20 * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-3.3">RESTCONF API Resource</a>.
23 public interface RestconfServer {
25 * Return the revision of {@code ietf-yang-library} module implemented by this server, as defined in
26 * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-3.3.3">RFC8040 {+restconf}/yang-library-version</a>.
28 * @return A {@code yang-library-version} element
30 // FIXME: this is a simple coning-variadic return, similar to how OperationsContent is handled use a common
31 // construct for both cases
32 // FIXME: RestconfFuture if we transition to being used by restconf-client implementation
33 NormalizedNodePayload yangLibraryVersionGET();
36 * Invoke an RPC operation, as defined in
37 * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-3.6">RFC8040 Operation Resource</a>.
39 * @param restconfURI Base URI of the request
40 * @param operation {@code <operation>} path, really an {@link ApiPath} to an {@code rpc}
41 * @param body RPC operation
42 * @return A {@link RestconfFuture} of the {@link OperationOutput operation result}
44 // FIXME: 'operation' should really be an ApiIdentifier with non-null module, but we also support ang-ext:mount,
45 // and hence it is a path right now
46 // FIXME: use ApiPath instead of String
47 RestconfFuture<OperationOutput> operationsPOST(URI restconfURI, String operation, OperationInputBody body);