blob: c377629be6ca6edb5fad4735f2350bc87a3a1e9b [file] [log] [blame]
Thomas Vachuska36be65f2015-12-08 12:36:15 -08001#set( $symbol_pound = '#' )
2#set( $symbol_dollar = '$' )
3#set( $symbol_escape = '\' )
4/*
Jian Lic6c76dc2016-01-26 14:22:51 -08005 * Copyright ${year} Open Networking Laboratory
Thomas Vachuska36be65f2015-12-08 12:36:15 -08006 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package ${package};
20
21import com.fasterxml.jackson.databind.node.ObjectNode;
22import org.onosproject.rest.AbstractWebResource;
23
24import javax.ws.rs.GET;
25import javax.ws.rs.Path;
26import javax.ws.rs.core.Response;
27
28import static org.onlab.util.Tools.nullIsNotFound;
29
30/**
31 * Sample web resource.
32 */
33@Path("sample")
34public class AppWebResource extends AbstractWebResource {
35
36 /**
37 * Get hello world greeting.
38 *
39 * @return 200 OK
40 */
41 @GET
42 @Path("")
43 public Response getGreeting() {
44 ObjectNode node = mapper().createObjectNode().put("hello", "world");
45 return ok(node).build();
46 }
47
48}