本文整理汇总了Java中org.codehaus.enunciate.jaxrs.StatusCodes类的典型用法代码示例。如果您正苦于以下问题:Java StatusCodes类的具体用法?Java StatusCodes怎么用?Java StatusCodes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StatusCodes类属于org.codehaus.enunciate.jaxrs包,在下文中一共展示了StatusCodes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createL2gateway
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Creates L2gateway.
* @param input l2gateway attributes
* @return success or error code
*/
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_BAD_REQUEST, condition = "Bad Request"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_CONFLICT, condition = "Conflict"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createL2gateway(final NeutronL2gatewayRequest input) {
LOG.debug("CreateL2gateway NeutronL2gatewayRequest");
return create(input);
}
示例2: showVpnIPSecPolicy
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Returns a specific VPN IPSEC Policy.
*/
@Path("{policyID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showVpnIPSecPolicy(@PathParam("policyID") String policyUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(policyUUID, fields);
}
示例3: showRouter
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Returns a specific Router.
*/
@Path("{routerUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackRouters.class)
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showRouter(@PathParam("routerUUID") String routerUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(routerUUID, fields);
}
示例4: showPort
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Returns a specific Port.
*/
@Path("{portUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackPorts.class)
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showPort(@PathParam("portUUID") String portUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(portUUID, fields);
}
示例5: showVpnIPSecSiteConnection
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Returns a specific VPN IPSEC SiteConnection.
*/
@Path("{connectionID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showVpnIPSecSiteConnection(@PathParam("connectionID") String connectionID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(connectionID, fields);
}
示例6: showNetwork
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Returns a specific Network.
*/
@Path("{netUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackNetworks.class)
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showNetwork(@PathParam("netUUID") String netUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(netUUID, fields);
}
示例7: showLoadBalancerHealthMonitor
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Returns a specific LoadBalancerHealthMonitor.
*/
@Path("{loadBalancerHealthMonitorID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showLoadBalancerHealthMonitor(
@PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(loadBalancerHealthMonitorID, fields);
}
示例8: updateTapFlow
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Updates a Tap Flow.
*/
@Path("{tapServiceUUID}/flows/{tapFlowUUID}")
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response updateTapFlow(@PathParam("tapServiceUUID") String tapServiceUUID,
@PathParam("tapFlowUUID") String tapFlowUUID,
final NeutronTapFlowRequest input) {
INeutronTapFlowCRUD tapFlowInterface = getNeutronCRUD();
if (!tapFlowInterface.tapFlowExists(tapServiceUUID, tapFlowUUID)) {
throw new ResourceNotFoundException("Specified UUID does not Exist");
}
NeutronTapFlow singleton = input.getSingleton();
singleton.setTapFlowServiceID(tapServiceUUID);
tapFlowInterface.updateTapFlow(singleton);
return Response.status(HttpURLConnection.HTTP_OK).entity(input).build();
}
示例9: deleteTapFlow
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Deletes a Tap Flow.
*/
@Path("{tapServiceUUID}/flows/{tapFlowUUID}")
@DELETE
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response deleteTapFlow(@PathParam("tapServiceUUID") String tapServiceUUID,
@PathParam("tapFlowUUID") String tapFlowUUID) {
INeutronTapFlowCRUD tapFlowInterface = getNeutronCRUD();
if (!tapFlowInterface.tapFlowExists(tapServiceUUID, tapFlowUUID)) {
throw new ResourceNotFoundException("Specified UUID does not Exist");
}
tapFlowInterface.deleteTapFlow(tapServiceUUID, tapFlowUUID);
return Response.status(HttpURLConnection.HTTP_NO_CONTENT).build();
}
示例10: showLoadBalancer
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Returns a specific LoadBalancer.
*/
@Path("{loadBalancerID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showLoadBalancer(@PathParam("loadBalancerID") String loadBalancerID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(loadBalancerID, fields);
}
示例11: showMeteringLabel
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Returns a specific metering label.
*/
@Path("{labelUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showMeteringLabel(@PathParam("labelUUID") String labelUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(labelUUID, fields);
}
示例12: listSFCPortPairs
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Returns a list of all SFC Port Pairs.
*/
@GET
@Produces({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listSFCPortPairs(
// return fields
@QueryParam("fields") List<String> fields,
@QueryParam("id") String queryID,
@QueryParam("name") String queryName,
@QueryParam("tenant_id") String queryTenantID,
@QueryParam("ingress") String queryIngressPort,
@QueryParam("egress") String queryEgressPort) {
INeutronSFCPortPairCRUD sfcPortPairInterface = getNeutronCRUD();
List<NeutronSFCPortPair> allSFCPortPair = sfcPortPairInterface.getAll();
List<NeutronSFCPortPair> ans = new ArrayList<>();
for (NeutronSFCPortPair sfcPortPair : allSFCPortPair) {
if ((queryID == null || queryID.equals(sfcPortPair.getID()))
&& (queryName == null || queryName.equals(sfcPortPair.getName()))
&& (queryIngressPort == null || queryIngressPort.equals(sfcPortPair.getIngressPortUUID()))
&& (queryEgressPort == null || queryEgressPort.equals(sfcPortPair.getEgressPortUUID()))
&& (queryTenantID == null || queryTenantID.equals(sfcPortPair.getTenantID()))) {
if (fields.size() > 0) {
ans.add(sfcPortPair.extractFields(fields));
} else {
ans.add(sfcPortPair);
}
}
}
return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronSFCPortPairRequest(ans)).build();
}
示例13: updateFirewallPolicy
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Updates a Firewall Policy.
*/
@Path("{firewallPolicyUUID}")
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackSubnets.class)
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response updateFirewallPolicy(@PathParam("firewallPolicyUUID") String firewallPolicyUUID,
final NeutronFirewallPolicyRequest input) {
return update(firewallPolicyUUID, input);
}
示例14: createSFCPortPair
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Creates new SFC Port Pair.
*/
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createSFCPortPair(final NeutronSFCPortPairRequest input) {
return create(input);
}
示例15: updateSFCPortPair
import org.codehaus.enunciate.jaxrs.StatusCodes; //导入依赖的package包/类
/**
* Updates an existing SFC Port Pair.
*/
@Path("{portPairUUID}")
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response updateSFCPortPair(@PathParam("portPairUUID") String sfcPortPairUUID,
final NeutronSFCPortPairRequest input) {
return update(sfcPortPairUUID, input);
}