blob: 44bd453cb50d115b27c52755c738de10655e0980 [file] [log] [blame]
sangho27462c62015-05-14 00:39:53 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.segmentrouting;
17
18import java.util.List;
19
20/**
21 * Segment Routing Service for REST API.
22 */
23public interface SegmentRoutingService {
24
25 /**
26 * Returns all tunnels.
27 *
28 * @return list of tunnels
29 */
30 List<Tunnel> getTunnels();
31
32 /**
33 * Creates a tunnel.
34 *
35 * @param tunnel tunnel reference to create
sanghobd812f82015-06-29 14:58:47 -070036 * @return WRONG_PATH if the tunnel path is wrong, ID_EXISTS if the tunnel ID
37 * exists already, TUNNEL_EXISTS if the same tunnel exists, INTERNAL_ERROR
38 * if the tunnel creation failed internally, SUCCESS if the tunnel is created
39 * successfully
sangho27462c62015-05-14 00:39:53 -070040 */
sanghobd812f82015-06-29 14:58:47 -070041 TunnelHandler.Result createTunnel(Tunnel tunnel);
sangho27462c62015-05-14 00:39:53 -070042
43 /**
44 * Returns all policies.
45 *
46 * @return list of policy
47 */
48 List<Policy> getPolicies();
49
50 /**
51 * Creates a policy.
52 *
53 * @param policy policy reference to create
sanghobd812f82015-06-29 14:58:47 -070054 * @return ID_EXISTS if the same policy ID exists,
55 * POLICY_EXISTS if the same policy exists, TUNNEL_NOT_FOUND if the tunnel
56 * does not exists, UNSUPPORTED_TYPE if the policy type is not supported,
57 * SUCCESS if the policy is created successfully.
sangho27462c62015-05-14 00:39:53 -070058 */
sanghobd812f82015-06-29 14:58:47 -070059 PolicyHandler.Result createPolicy(Policy policy);
sangho27462c62015-05-14 00:39:53 -070060
61 /**
62 * Removes a tunnel.
63 *
64 * @param tunnel tunnel reference to remove
sanghobd812f82015-06-29 14:58:47 -070065 * @return TUNNEL_NOT_FOUND if the tunnel to remove does not exists,
66 * INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS
67 * if the tunnel is created successfully.
sangho27462c62015-05-14 00:39:53 -070068 */
sanghobd812f82015-06-29 14:58:47 -070069 TunnelHandler.Result removeTunnel(Tunnel tunnel);
sangho27462c62015-05-14 00:39:53 -070070
71 /**
72 * Removes a policy.
73 *
74 * @param policy policy reference to remove
sanghobd812f82015-06-29 14:58:47 -070075 * @return POLICY_NOT_FOUND if the policy to remove does not exists,
76 * SUCCESS if it is removed successfully
sangho27462c62015-05-14 00:39:53 -070077 */
sanghobd812f82015-06-29 14:58:47 -070078 PolicyHandler.Result removePolicy(Policy policy);
sangho27462c62015-05-14 00:39:53 -070079}