sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.segmentrouting; |
| 17 | |
| 18 | import java.util.List; |
| 19 | |
| 20 | /** |
| 21 | * Segment Routing Service for REST API. |
| 22 | */ |
| 23 | public 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 |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 36 | * @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 |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 40 | */ |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 41 | TunnelHandler.Result createTunnel(Tunnel tunnel); |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 42 | |
| 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 |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 54 | * @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. |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 58 | */ |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 59 | PolicyHandler.Result createPolicy(Policy policy); |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 60 | |
| 61 | /** |
| 62 | * Removes a tunnel. |
| 63 | * |
| 64 | * @param tunnel tunnel reference to remove |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 65 | * @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. |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 68 | */ |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 69 | TunnelHandler.Result removeTunnel(Tunnel tunnel); |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 70 | |
| 71 | /** |
| 72 | * Removes a policy. |
| 73 | * |
| 74 | * @param policy policy reference to remove |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 75 | * @return POLICY_NOT_FOUND if the policy to remove does not exists, |
| 76 | * SUCCESS if it is removed successfully |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 77 | */ |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 78 | PolicyHandler.Result removePolicy(Policy policy); |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 79 | } |