Commit 314212b2 authored by Francesco Chicchiriccò's avatar Francesco Chicchiriccò
Browse files

Adjusting the update method + adding license headers because the build was not succeeding otherwise

parent 5ed3e58f
/*
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.brooklyn.entity.webapp.chorevolution;
import org.apache.brooklyn.api.entity.ImplementedBy;
......
/*
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.brooklyn.entity.webapp.chorevolution;
import java.io.BufferedReader;
......
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* Copyright 2016 The CHOReVOLUTION project
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.brooklyn.rest.api;
import java.io.InputStream;
......@@ -24,6 +20,7 @@ import java.io.InputStream;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.MediaType;
......@@ -103,7 +100,7 @@ public interface ChoreographyApi {
@ApiParam(name = "chorSpec", value = "Choreography specifications", required = true)
InputStream chorSpec);
@POST
@PUT
@Path("/update/{choreography_id}")
@Consumes(MediaType.APPLICATION_JSON)
@ApiOperation(
......@@ -114,12 +111,13 @@ public interface ChoreographyApi {
@ApiResponse(code = 404, message = "Undefined entity or location"),
@ApiResponse(code = 412, message = "Choreography already registered")
})
public Response update(
@ApiParam(name = "choreography_id", value = "Choreography ID", required = true)
@PathParam("choreography_name") String choreography_name,
@ApiParam(name = "choreography", value = "Choreography specifications", required = true)
String choreography);
Response update(
@ApiParam(name = "choreographyId", value = "Choreography ID", required = true)
@PathParam("choreographyId") String choreographyId,
@ApiParam(name = "choreographyName", value = "Choreography name", required = true)
@PathParam("choreographyName") String choreographyName,
@ApiParam(name = "chorSpec", value = "Choreography specifications", required = true)
InputStream chorSpec);
@POST
@Path("/resize/{choreographyId}")
......
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* Copyright 2016 The CHOReVOLUTION project
*
* http://www.apache.org/licenses/LICENSE-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.brooklyn.rest.resources;
import static javax.ws.rs.core.Response.status;
......@@ -30,7 +24,6 @@ import java.io.StringReader;
import java.util.Collection;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
......@@ -207,10 +200,8 @@ public class ChoreographyResource extends AbstractBrooklynRestResource implement
}
@Override
public Response update(String choreography_name, String choreography) {
// TODO Auto-generated method stub
return null;
}
public Response update(String choreographyId, String choreographyName, InputStream chorSpec) {
return Response.accepted().build();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment