Skip to content

Commit e936c32

Browse files
author
Alex Huang
committed
Fixed problems with inject checkin
1 parent 54cce5f commit e936c32

15 files changed

Lines changed: 590 additions & 348 deletions

File tree

engine/api/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntity.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import javax.ws.rs.GET;
2424
import javax.ws.rs.Path;
25+
import javax.ws.rs.Produces;
2526
import javax.xml.bind.annotation.XmlRootElement;
2627

2728
import org.apache.cloudstack.engine.service.api.ProvisioningService;
@@ -32,6 +33,8 @@
3233
/**
3334
* Describes a zone and operations that can be done in a zone.
3435
*/
36+
@Path("/zone/{zoneid}")
37+
@Produces({"application/json"})
3538
@XmlRootElement(name="zone")
3639
public interface ZoneEntity extends DataCenterResourceEntity, DataCenter {
3740
@GET
@@ -40,4 +43,8 @@ public interface ZoneEntity extends DataCenterResourceEntity, DataCenter {
4043

4144
@Url(clazz=ProvisioningService.class, method="getPod", name="id", type=List.class)
4245
List<String> listPodIds();
46+
47+
@Override
48+
@Path("/enable")
49+
boolean enable();
4350
}

engine/api/src/org/apache/cloudstack/engine/rest/datacenter/entity/api/PodRestTO.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

engine/api/src/org/apache/cloudstack/engine/rest/datacenter/entity/api/ZoneRestTO.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

engine/api/src/org/apache/cloudstack/engine/rest/datacenter/entity/api/ZoneRestTOs.java

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.engine.rest.service.api;
20+
21+
import java.util.List;
22+
23+
import javax.inject.Inject;
24+
import javax.ws.rs.GET;
25+
import javax.ws.rs.POST;
26+
import javax.ws.rs.PUT;
27+
import javax.ws.rs.Path;
28+
import javax.ws.rs.PathParam;
29+
import javax.ws.rs.Produces;
30+
import javax.ws.rs.QueryParam;
31+
32+
import org.apache.cloudstack.engine.datacenter.entity.api.ClusterEntity;
33+
import org.apache.cloudstack.engine.service.api.ProvisioningService;
34+
import org.springframework.stereotype.Component;
35+
import org.springframework.stereotype.Service;
36+
37+
@Component
38+
@Service("ClusterRestService")
39+
@Produces("application/json")
40+
public class ClusterRestService {
41+
@Inject
42+
ProvisioningService _provisioningService;
43+
44+
@GET @Path("/clusters")
45+
public List<ClusterEntity> listAll() {
46+
return null;
47+
}
48+
49+
50+
@GET @Path("/cluster/{clusterid}")
51+
public ClusterEntity get(@PathParam("clusterid") String clusterId) {
52+
return null;
53+
}
54+
55+
@POST @Path("/cluster/{clusterid}/enable")
56+
public String enable(@PathParam("clusterid") String clusterId) {
57+
return null;
58+
}
59+
60+
@POST @Path("/cluster/{clusterid}/disable")
61+
public String disable(@PathParam("clusterid") String clusterId) {
62+
return null;
63+
}
64+
65+
@POST @Path("/cluster/{clusterid}/deactivate")
66+
public String deactivate(@PathParam("clusterid") String clusterId) {
67+
return null;
68+
}
69+
70+
@POST @Path("/cluster/{clusterid}/reactivate")
71+
public String reactivate(@PathParam("clusterid") String clusterId) {
72+
return null;
73+
}
74+
75+
@PUT @Path("/cluster/create")
76+
public ClusterEntity create(
77+
@QueryParam("xid") String xid,
78+
@QueryParam("display-name") String displayName) {
79+
return null;
80+
}
81+
82+
@PUT @Path("/cluster/{clusterid}/update")
83+
public ClusterEntity update(
84+
@QueryParam("display-name") String displayName) {
85+
return null;
86+
}
87+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.engine.rest.service.api;
20+
21+
import java.util.List;
22+
23+
import javax.ws.rs.GET;
24+
import javax.ws.rs.POST;
25+
import javax.ws.rs.PUT;
26+
import javax.ws.rs.Path;
27+
import javax.ws.rs.PathParam;
28+
import javax.ws.rs.Produces;
29+
import javax.ws.rs.QueryParam;
30+
31+
import org.apache.cloudstack.engine.cloud.entity.api.NetworkEntity;
32+
import org.springframework.stereotype.Component;
33+
import org.springframework.stereotype.Service;
34+
35+
@Service("NetworkRestService")
36+
@Component
37+
@Produces("application/json")
38+
public class NetworkRestService {
39+
@PUT @Path("/network/create")
40+
public NetworkEntity create(
41+
@QueryParam("xid") String xid,
42+
@QueryParam("display-name") String displayName) {
43+
return null;
44+
}
45+
46+
@GET @Path("/network/{network-id}")
47+
public NetworkEntity get(@PathParam("network-id") String networkId) {
48+
return null;
49+
}
50+
51+
@GET @Path("/networks")
52+
public List<NetworkEntity> listAll() {
53+
return null;
54+
}
55+
56+
@POST @Path("/network/{network-id}/")
57+
public String deploy(@PathParam("network-id") String networkId) {
58+
return null;
59+
}
60+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.engine.rest.service.api;
20+
21+
import javax.inject.Inject;
22+
import javax.ws.rs.GET;
23+
import javax.ws.rs.POST;
24+
import javax.ws.rs.PUT;
25+
import javax.ws.rs.Path;
26+
import javax.ws.rs.PathParam;
27+
import javax.ws.rs.Produces;
28+
import javax.ws.rs.QueryParam;
29+
30+
import org.apache.cloudstack.engine.datacenter.entity.api.PodEntity;
31+
import org.apache.cloudstack.engine.service.api.ProvisioningService;
32+
import org.springframework.stereotype.Component;
33+
import org.springframework.stereotype.Service;
34+
35+
@Component
36+
@Service("PodService")
37+
@Produces({"application/json"})
38+
public class PodRestService {
39+
@Inject
40+
ProvisioningService _provisioningService;
41+
42+
@GET @Path("/pod/{pod-id}")
43+
public PodEntity getPod(@PathParam("pod-id") String podId) {
44+
return null;
45+
}
46+
47+
@POST @Path("/pod/{pod-id}/enable")
48+
public String enable(@PathParam("pod-id") String podId) {
49+
return null;
50+
}
51+
52+
@POST @Path("/pod/{pod-id}/disable")
53+
public String disable(@PathParam("pod-id") String podId) {
54+
return null;
55+
}
56+
57+
@POST @Path("/pod/{pod-id}/deactivate")
58+
public String deactivate(@PathParam("pod-id") String podId) {
59+
return null;
60+
}
61+
62+
@POST @Path("/pod/{pod-id}/reactivate")
63+
public String reactivate(@PathParam("pod-id") String podId) {
64+
return null;
65+
}
66+
67+
@PUT @Path("/pod/create")
68+
public PodEntity create(
69+
@QueryParam("xid") String xid,
70+
@QueryParam("display-name") String displayName) {
71+
return null;
72+
}
73+
74+
@PUT @Path("/pod/{pod-id}")
75+
public PodEntity update(
76+
@PathParam("pod-id") String podId,
77+
@QueryParam("display-name") String displayName) {
78+
return null;
79+
}
80+
}

0 commit comments

Comments
 (0)