Committed by
Gerrit Code Review
Remove old CordFabric app
Change-Id: Id8b22f3ab78adae6f09e94f54ec15bc743459cb2
Showing
14 changed files
with
0 additions
and
680 deletions
apps/cordfabric/pom.xml
deleted
100644 → 0
1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
2 | -<!-- | ||
3 | - ~ Copyright 2015-2016 Open Networking Laboratory | ||
4 | - ~ | ||
5 | - ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | - ~ you may not use this file except in compliance with the License. | ||
7 | - ~ You may obtain a copy of the License at | ||
8 | - ~ | ||
9 | - ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | - ~ | ||
11 | - ~ Unless required by applicable law or agreed to in writing, software | ||
12 | - ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | - ~ See the License for the specific language governing permissions and | ||
15 | - ~ limitations under the License. | ||
16 | - --> | ||
17 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
18 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
19 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
20 | - <parent> | ||
21 | - <artifactId>onos-apps</artifactId> | ||
22 | - <groupId>org.onosproject</groupId> | ||
23 | - <version>1.6.0-SNAPSHOT</version> | ||
24 | - <relativePath>../pom.xml</relativePath> | ||
25 | - </parent> | ||
26 | - <modelVersion>4.0.0</modelVersion> | ||
27 | - | ||
28 | - <artifactId>onos-app-cordfabric</artifactId> | ||
29 | - | ||
30 | - <packaging>bundle</packaging> | ||
31 | - <description>Simple fabric application for CORD</description> | ||
32 | - | ||
33 | - <properties> | ||
34 | - <onos.app.name>org.onosproject.cordfabric</onos.app.name> | ||
35 | - <onos.app.title>CORD Fabric App</onos.app.title> | ||
36 | - <onos.app.category>Traffic Steering</onos.app.category> | ||
37 | - <onos.app.url>http://onosproject.org</onos.app.url> | ||
38 | - <onos.app.readme>Simple fabric application for CORD.</onos.app.readme> | ||
39 | - <web.context>/onos/cordfabric</web.context> | ||
40 | - <api.version>1.0.0</api.version> | ||
41 | - <api.title>ONOS CORD Fabric REST API</api.title> | ||
42 | - <api.description> | ||
43 | - APIs for interacting with the CORD Fabric application. | ||
44 | - </api.description> | ||
45 | - <api.package>org.onosproject.cordfabric</api.package> | ||
46 | - </properties> | ||
47 | - | ||
48 | - <dependencies> | ||
49 | - <dependency> | ||
50 | - <groupId>org.onosproject</groupId> | ||
51 | - <artifactId>onos-cli</artifactId> | ||
52 | - <version>${project.version}</version> | ||
53 | - </dependency> | ||
54 | - | ||
55 | - <dependency> | ||
56 | - <groupId>org.apache.karaf.shell</groupId> | ||
57 | - <artifactId>org.apache.karaf.shell.console</artifactId> | ||
58 | - </dependency> | ||
59 | - <dependency> | ||
60 | - <groupId>org.onosproject</groupId> | ||
61 | - <artifactId>onos-rest</artifactId> | ||
62 | - <version>${project.version}</version> | ||
63 | - </dependency> | ||
64 | - <dependency> | ||
65 | - <groupId>org.onosproject</groupId> | ||
66 | - <artifactId>onlab-rest</artifactId> | ||
67 | - <version>${project.version}</version> | ||
68 | - </dependency> | ||
69 | - <dependency> | ||
70 | - <groupId>javax.ws.rs</groupId> | ||
71 | - <artifactId>javax.ws.rs-api</artifactId> | ||
72 | - <version>2.0.1</version> | ||
73 | - </dependency> | ||
74 | - <dependency> | ||
75 | - <groupId>org.glassfish.jersey.containers</groupId> | ||
76 | - <artifactId>jersey-container-servlet</artifactId> | ||
77 | - </dependency> | ||
78 | - <dependency> | ||
79 | - <groupId>com.fasterxml.jackson.core</groupId> | ||
80 | - <artifactId>jackson-databind</artifactId> | ||
81 | - </dependency> | ||
82 | - | ||
83 | - <dependency> | ||
84 | - <groupId>com.fasterxml.jackson.core</groupId> | ||
85 | - <artifactId>jackson-annotations</artifactId> | ||
86 | - </dependency> | ||
87 | - | ||
88 | - <dependency> | ||
89 | - <groupId>org.osgi</groupId> | ||
90 | - <artifactId>org.osgi.compendium</artifactId> | ||
91 | - </dependency> | ||
92 | - <dependency> | ||
93 | - <groupId>org.osgi</groupId> | ||
94 | - <artifactId>org.osgi.core</artifactId> | ||
95 | - </dependency> | ||
96 | - </dependencies> | ||
97 | - | ||
98 | - <build> | ||
99 | - <plugins> | ||
100 | - <plugin> | ||
101 | - <groupId>org.apache.felix</groupId> | ||
102 | - <artifactId>maven-bundle-plugin</artifactId> | ||
103 | - <extensions>true</extensions> | ||
104 | - <configuration> | ||
105 | - <instructions> | ||
106 | - <_wab>src/main/webapp/</_wab> | ||
107 | - <Include-Resource> | ||
108 | - WEB-INF/classes/apidoc/swagger.json=target/swagger.json, | ||
109 | - {maven-resources} | ||
110 | - </Include-Resource> | ||
111 | - <Bundle-SymbolicName> | ||
112 | - ${project.groupId}.${project.artifactId} | ||
113 | - </Bundle-SymbolicName> | ||
114 | - <Import-Package> | ||
115 | - org.slf4j, | ||
116 | - org.osgi.framework, | ||
117 | - javax.ws.rs, | ||
118 | - javax.ws.rs.core, | ||
119 | - org.glassfish.jersey, | ||
120 | - org.glassfish.jersey.servlet, | ||
121 | - com.fasterxml.jackson.databind, | ||
122 | - com.fasterxml.jackson.databind.node, | ||
123 | - org.apache.karaf.shell.commands, | ||
124 | - com.google.common.*, | ||
125 | - org.onlab.packet.*, | ||
126 | - org.onosproject.*, | ||
127 | - </Import-Package> | ||
128 | - <Web-ContextPath>${web.context}</Web-ContextPath> | ||
129 | - </instructions> | ||
130 | - </configuration> | ||
131 | - </plugin> | ||
132 | - </plugins> | ||
133 | - </build> | ||
134 | -</project> |
This diff is collapsed. Click to expand it.
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 | - | ||
17 | -package org.onosproject.cordfabric; | ||
18 | - | ||
19 | -import org.onlab.packet.VlanId; | ||
20 | - | ||
21 | -import java.util.List; | ||
22 | - | ||
23 | -/** | ||
24 | - * Service used to interact with fabric. | ||
25 | - */ | ||
26 | -public interface FabricService { | ||
27 | - | ||
28 | - /** | ||
29 | - * Remaps a vlan to the specified ports. The specified ports will be the | ||
30 | - * only ports in this vlan once the operation completes. | ||
31 | - * | ||
32 | - * @param vlan vlan object to add | ||
33 | - */ | ||
34 | - void addVlan(FabricVlan vlan); | ||
35 | - | ||
36 | - /** | ||
37 | - * Removes a vlan from all ports in the fabric. | ||
38 | - * | ||
39 | - * @param vlanId ID of vlan to remove | ||
40 | - */ | ||
41 | - void removeVlan(VlanId vlanId); | ||
42 | - | ||
43 | - /** | ||
44 | - * Returns the vlan to port mapping for all vlans/ports configured in the | ||
45 | - * fabric. | ||
46 | - * | ||
47 | - * @return mapping of vlan to port | ||
48 | - */ | ||
49 | - List<FabricVlan> getVlans(); | ||
50 | -} |
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 | - | ||
17 | -package org.onosproject.cordfabric; | ||
18 | - | ||
19 | -import com.google.common.collect.ImmutableList; | ||
20 | -import org.onlab.packet.VlanId; | ||
21 | -import org.onosproject.net.ConnectPoint; | ||
22 | - | ||
23 | -import java.util.Collection; | ||
24 | -import java.util.List; | ||
25 | - | ||
26 | -import static com.google.common.base.Preconditions.checkNotNull; | ||
27 | - | ||
28 | -/** | ||
29 | - * Vlan which spans multiple fabric ports. | ||
30 | - */ | ||
31 | -public class FabricVlan { | ||
32 | - | ||
33 | - private final VlanId vlan; | ||
34 | - | ||
35 | - private final List<ConnectPoint> ports; | ||
36 | - private final boolean iptv; | ||
37 | - | ||
38 | - public FabricVlan(VlanId vlan, Collection<ConnectPoint> ports, boolean iptv) { | ||
39 | - checkNotNull(vlan); | ||
40 | - checkNotNull(ports); | ||
41 | - this.vlan = vlan; | ||
42 | - this.ports = ImmutableList.copyOf(ports); | ||
43 | - this.iptv = iptv; | ||
44 | - } | ||
45 | - | ||
46 | - public VlanId vlan() { | ||
47 | - return vlan; | ||
48 | - } | ||
49 | - | ||
50 | - public List<ConnectPoint> ports() { | ||
51 | - return ports; | ||
52 | - } | ||
53 | - | ||
54 | - public boolean iptv() { | ||
55 | - return iptv; | ||
56 | - } | ||
57 | -} |
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 | - | ||
17 | -package org.onosproject.cordfabric; | ||
18 | - | ||
19 | -import com.fasterxml.jackson.databind.JsonNode; | ||
20 | -import com.fasterxml.jackson.databind.node.ArrayNode; | ||
21 | -import com.fasterxml.jackson.databind.node.ObjectNode; | ||
22 | -import org.onlab.packet.VlanId; | ||
23 | -import org.onosproject.codec.CodecContext; | ||
24 | -import org.onosproject.codec.JsonCodec; | ||
25 | -import org.onosproject.net.ConnectPoint; | ||
26 | - | ||
27 | -import java.util.ArrayList; | ||
28 | -import java.util.List; | ||
29 | - | ||
30 | -import static com.google.common.base.Preconditions.checkNotNull; | ||
31 | - | ||
32 | -/** | ||
33 | - * Codec for encoding/decoding a FabricVlan object to/from JSON. | ||
34 | - */ | ||
35 | -public final class FabricVlanCodec extends JsonCodec<FabricVlan> { | ||
36 | - | ||
37 | - // JSON field names | ||
38 | - private static final String VLAN = "vlan"; | ||
39 | - private static final String PORTS = "ports"; | ||
40 | - private static final String IPTV = "iptv"; | ||
41 | - | ||
42 | - @Override | ||
43 | - public ObjectNode encode(FabricVlan vlan, CodecContext context) { | ||
44 | - checkNotNull(vlan, "Vlan cannot be null"); | ||
45 | - final ObjectNode result = context.mapper().createObjectNode() | ||
46 | - .put(VLAN, vlan.vlan().toShort()); | ||
47 | - | ||
48 | - final ArrayNode jsonPorts = result.putArray(PORTS); | ||
49 | - | ||
50 | - vlan.ports().forEach(cp -> jsonPorts.add(context.codec(ConnectPoint.class).encode(cp, context))); | ||
51 | - | ||
52 | - return result; | ||
53 | - } | ||
54 | - | ||
55 | - @Override | ||
56 | - public FabricVlan decode(ObjectNode json, CodecContext context) { | ||
57 | - short vlan = json.path(VLAN).shortValue(); | ||
58 | - boolean iptv = json.path(IPTV).booleanValue(); | ||
59 | - List<ConnectPoint> ports = new ArrayList<>(); | ||
60 | - | ||
61 | - ArrayNode portArray = (ArrayNode) json.path(PORTS); | ||
62 | - for (JsonNode o : portArray) { | ||
63 | - ports.add(context.codec(ConnectPoint.class).decode((ObjectNode) o, context)); | ||
64 | - } | ||
65 | - | ||
66 | - return new FabricVlan(VlanId.vlanId(vlan), ports, iptv); | ||
67 | - } | ||
68 | -} |
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 | - | ||
17 | -package org.onosproject.cordfabric; | ||
18 | - | ||
19 | -import com.fasterxml.jackson.databind.ObjectMapper; | ||
20 | -import com.fasterxml.jackson.databind.node.ObjectNode; | ||
21 | -import org.onlab.packet.VlanId; | ||
22 | -import org.onosproject.rest.AbstractWebResource; | ||
23 | - | ||
24 | -import javax.ws.rs.Consumes; | ||
25 | -import javax.ws.rs.DELETE; | ||
26 | -import javax.ws.rs.GET; | ||
27 | -import javax.ws.rs.POST; | ||
28 | -import javax.ws.rs.Path; | ||
29 | -import javax.ws.rs.PathParam; | ||
30 | -import javax.ws.rs.Produces; | ||
31 | -import javax.ws.rs.core.MediaType; | ||
32 | -import javax.ws.rs.core.Response; | ||
33 | -import java.io.IOException; | ||
34 | -import java.io.InputStream; | ||
35 | -import java.util.List; | ||
36 | - | ||
37 | -/** | ||
38 | - * Web resource for interacting with the fabric. | ||
39 | - */ | ||
40 | -@Path("vlans") | ||
41 | -public class FabricWebResource extends AbstractWebResource { | ||
42 | - | ||
43 | - private static final FabricVlanCodec VLAN_CODEC = new FabricVlanCodec(); | ||
44 | - | ||
45 | - /** | ||
46 | - * Get all CORD fabric VLANs. | ||
47 | - * | ||
48 | - * @return array of cord VLANs in the system. | ||
49 | - */ | ||
50 | - @GET | ||
51 | - @Produces(MediaType.APPLICATION_JSON) | ||
52 | - public Response getVlans() { | ||
53 | - FabricService fabricService = get(FabricService.class); | ||
54 | - List<FabricVlan> vlans = fabricService.getVlans(); | ||
55 | - ObjectNode result = new ObjectMapper().createObjectNode(); | ||
56 | - result.set("vlans", new FabricVlanCodec().encode(vlans, this)); | ||
57 | - | ||
58 | - return ok(result.toString()).build(); | ||
59 | - } | ||
60 | - | ||
61 | - /** | ||
62 | - * Create a CORD fabric VLAN. | ||
63 | - * | ||
64 | - * @param input JSON stream describing new VLAN | ||
65 | - * @return status of the request - CREATED if the JSON is correct, | ||
66 | - * INTERNAL_SERVER_ERROR if the JSON is invalid | ||
67 | - * @throws IOException if the JSON is invalid | ||
68 | - */ | ||
69 | - @POST | ||
70 | - @Path("add") | ||
71 | - @Consumes(MediaType.APPLICATION_JSON) | ||
72 | - public Response addVlan(InputStream input) throws IOException { | ||
73 | - ObjectMapper mapper = new ObjectMapper(); | ||
74 | - ObjectNode vlanJson = (ObjectNode) mapper.readTree(input); | ||
75 | - FabricService fabricService = get(FabricService.class); | ||
76 | - | ||
77 | - fabricService.addVlan(VLAN_CODEC.decode(vlanJson, this)); | ||
78 | - | ||
79 | - return Response.ok().build(); | ||
80 | - } | ||
81 | - | ||
82 | - /** | ||
83 | - * Delete a CORD fabric VLAN. | ||
84 | - * | ||
85 | - * @param vlan identifier of the VLAN to remove | ||
86 | - * @return status of the request - OK | ||
87 | - */ | ||
88 | - @DELETE | ||
89 | - @Path("{vlan}") | ||
90 | - public Response deleteVlan(@PathParam("vlan") String vlan) { | ||
91 | - VlanId vlanId = VlanId.vlanId(Short.parseShort(vlan)); | ||
92 | - | ||
93 | - FabricService fabricService = get(FabricService.class); | ||
94 | - | ||
95 | - fabricService.removeVlan(vlanId); | ||
96 | - | ||
97 | - return Response.ok().build(); | ||
98 | - } | ||
99 | -} |
apps/cordfabric/src/main/java/org/onosproject/cordfabric/cli/FabricAddCommand.java
deleted
100644 → 0
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 | - | ||
17 | -package org.onosproject.cordfabric.cli; | ||
18 | - | ||
19 | -import org.apache.karaf.shell.commands.Argument; | ||
20 | -import org.apache.karaf.shell.commands.Command; | ||
21 | -import org.onlab.packet.VlanId; | ||
22 | -import org.onosproject.cli.AbstractShellCommand; | ||
23 | -import org.onosproject.cordfabric.FabricService; | ||
24 | -import org.onosproject.cordfabric.FabricVlan; | ||
25 | -import org.onosproject.net.ConnectPoint; | ||
26 | - | ||
27 | -import java.util.ArrayList; | ||
28 | -import java.util.List; | ||
29 | - | ||
30 | -/** | ||
31 | - * Adds a vlan to the fabric. | ||
32 | - */ | ||
33 | -@Command(scope = "onos", name = "add-fabric-vlan", | ||
34 | - description = "Adds a VLAN to the fabric") | ||
35 | -public class FabricAddCommand extends AbstractShellCommand { | ||
36 | - | ||
37 | - @Argument(index = 0, name = "vlanid", description = "VLAN ID", | ||
38 | - required = true, multiValued = false) | ||
39 | - private String vlanIdString = null; | ||
40 | - | ||
41 | - @Argument(index = 1, name = "ports", | ||
42 | - description = "List of ports in the VLAN", | ||
43 | - required = true, multiValued = true) | ||
44 | - private String[] portStrings = null; | ||
45 | - | ||
46 | - @Override | ||
47 | - protected void execute() { | ||
48 | - FabricService service = AbstractShellCommand.get(FabricService.class); | ||
49 | - | ||
50 | - VlanId vlan = VlanId.vlanId(Short.parseShort(vlanIdString)); | ||
51 | - | ||
52 | - if (portStrings.length < 2) { | ||
53 | - throw new IllegalArgumentException("Must have at least 2 ports"); | ||
54 | - } | ||
55 | - | ||
56 | - List<ConnectPoint> ports = new ArrayList<>(portStrings.length); | ||
57 | - | ||
58 | - for (String portString : portStrings) { | ||
59 | - ports.add(ConnectPoint.deviceConnectPoint(portString)); | ||
60 | - } | ||
61 | - | ||
62 | - service.addVlan(new FabricVlan(vlan, ports, false)); | ||
63 | - } | ||
64 | -} |
apps/cordfabric/src/main/java/org/onosproject/cordfabric/cli/FabricRemoveCommand.java
deleted
100644 → 0
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 | - | ||
17 | -package org.onosproject.cordfabric.cli; | ||
18 | - | ||
19 | -import org.apache.karaf.shell.commands.Argument; | ||
20 | -import org.apache.karaf.shell.commands.Command; | ||
21 | -import org.onlab.packet.VlanId; | ||
22 | -import org.onosproject.cli.AbstractShellCommand; | ||
23 | -import org.onosproject.cordfabric.FabricService; | ||
24 | - | ||
25 | -/** | ||
26 | - * Removes a vlan from the fabric. | ||
27 | - */ | ||
28 | -@Command(scope = "onos", name = "remove-fabric-vlan", | ||
29 | - description = "Removes a VLAN from the fabric") | ||
30 | -public class FabricRemoveCommand extends AbstractShellCommand { | ||
31 | - | ||
32 | - @Argument(index = 0, name = "vlanid", description = "VLAN ID", | ||
33 | - required = true, multiValued = false) | ||
34 | - private String vlanIdString = null; | ||
35 | - | ||
36 | - @Override | ||
37 | - protected void execute() { | ||
38 | - FabricService service = AbstractShellCommand.get(FabricService.class); | ||
39 | - | ||
40 | - VlanId vlan = VlanId.vlanId(Short.parseShort(vlanIdString)); | ||
41 | - | ||
42 | - service.removeVlan(vlan); | ||
43 | - } | ||
44 | -} |
apps/cordfabric/src/main/java/org/onosproject/cordfabric/cli/FabricShowCommand.java
deleted
100644 → 0
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 | - | ||
17 | -package org.onosproject.cordfabric.cli; | ||
18 | - | ||
19 | -import org.apache.karaf.shell.commands.Command; | ||
20 | -import org.onosproject.cli.AbstractShellCommand; | ||
21 | -import org.onosproject.cordfabric.FabricService; | ||
22 | -import org.onosproject.cordfabric.FabricVlan; | ||
23 | - | ||
24 | -import java.util.List; | ||
25 | - | ||
26 | -/** | ||
27 | - * Shows the vlans in the fabric. | ||
28 | - */ | ||
29 | -@Command(scope = "onos", name = "fabric", | ||
30 | - description = "Shows the fabric vlans") | ||
31 | -public class FabricShowCommand extends AbstractShellCommand { | ||
32 | - | ||
33 | - private static final String VLAN_HEADER_LINE_FORMAT = "VLAN %s"; | ||
34 | - private static final String PORT_LINE_FORMAT = "\t%s"; | ||
35 | - | ||
36 | - @Override | ||
37 | - protected void execute() { | ||
38 | - FabricService service = AbstractShellCommand.get(FabricService.class); | ||
39 | - | ||
40 | - List<FabricVlan> vlans = service.getVlans(); | ||
41 | - | ||
42 | - vlans.forEach(fabricVlan -> { | ||
43 | - print(VLAN_HEADER_LINE_FORMAT, fabricVlan.vlan()); | ||
44 | - fabricVlan.ports().forEach(cp -> print(PORT_LINE_FORMAT, cp)); | ||
45 | - }); | ||
46 | - } | ||
47 | -} |
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 | - | ||
17 | -/** | ||
18 | - * Console commands for managing fabric of VLANs. | ||
19 | - */ | ||
20 | -package org.onosproject.cordfabric.cli; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | - | ||
17 | -/** | ||
18 | - * Service for managing fabric of VLANs. | ||
19 | - */ | ||
20 | -package org.onosproject.cordfabric; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> | ||
17 | - | ||
18 | - <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0"> | ||
19 | - <command> | ||
20 | - <action class="org.onosproject.cordfabric.cli.FabricShowCommand"/> | ||
21 | - </command> | ||
22 | - <command> | ||
23 | - <action class="org.onosproject.cordfabric.cli.FabricAddCommand"/> | ||
24 | - <completers> | ||
25 | - <ref component-id="placeholderCompleter"/> | ||
26 | - <ref component-id="connectPointCompleter"/> | ||
27 | - </completers> | ||
28 | - </command> | ||
29 | - <command> | ||
30 | - <action class="org.onosproject.cordfabric.cli.FabricRemoveCommand"/> | ||
31 | - </command> | ||
32 | - </command-bundle> | ||
33 | - | ||
34 | - <bean id="connectPointCompleter" class="org.onosproject.cli.net.ConnectPointCompleter"/> | ||
35 | - <bean id="placeholderCompleter" class="org.onosproject.cli.PlaceholderCompleter"/> | ||
36 | -</blueprint> |
1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
2 | -<!-- | ||
3 | - ~ Copyright 2015 Open Networking Laboratory | ||
4 | - ~ | ||
5 | - ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | - ~ you may not use this file except in compliance with the License. | ||
7 | - ~ You may obtain a copy of the License at | ||
8 | - ~ | ||
9 | - ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | - ~ | ||
11 | - ~ Unless required by applicable law or agreed to in writing, software | ||
12 | - ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | - ~ See the License for the specific language governing permissions and | ||
15 | - ~ limitations under the License. | ||
16 | - --> | ||
17 | -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" | ||
18 | - xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
19 | - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
20 | - id="ONOS" version="2.5"> | ||
21 | - <display-name>CORD Fabric REST API v1.0</display-name> | ||
22 | - | ||
23 | - <servlet> | ||
24 | - <servlet-name>JAX-RS Service</servlet-name> | ||
25 | - <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> | ||
26 | - <init-param> | ||
27 | - <param-name>jersey.config.server.provider.classnames</param-name> | ||
28 | - <param-value> | ||
29 | - org.onosproject.cordfabric.FabricWebResource | ||
30 | - </param-value> | ||
31 | - </init-param> | ||
32 | - <load-on-startup>1</load-on-startup> | ||
33 | - </servlet> | ||
34 | - | ||
35 | - <servlet-mapping> | ||
36 | - <servlet-name>JAX-RS Service</servlet-name> | ||
37 | - <url-pattern>/*</url-pattern> | ||
38 | - </servlet-mapping> | ||
39 | - | ||
40 | -</web-app> |
... | @@ -46,7 +46,6 @@ | ... | @@ -46,7 +46,6 @@ |
46 | <module>bgprouter</module> | 46 | <module>bgprouter</module> |
47 | <module>test</module> | 47 | <module>test</module> |
48 | <module>segmentrouting</module> | 48 | <module>segmentrouting</module> |
49 | - <module>cordfabric</module> | ||
50 | <module>xos-integration</module> | 49 | <module>xos-integration</module> |
51 | <module>pcep-api</module> | 50 | <module>pcep-api</module> |
52 | <module>iptopology-api</module> | 51 | <module>iptopology-api</module> | ... | ... |
-
Please register or login to post a comment