Search in sources :

Example 26 with Cdn

use of org.candlepin.model.Cdn in project candlepin by candlepin.

the class CdnResource method update.

@ApiOperation(notes = "Updates a CDN @return a Cdn object", value = "update")
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/{label}")
public CdnDTO update(@PathParam("label") String label, @ApiParam(name = "cdn", required = true) CdnDTO cdnDTOInput, @Context Principal principal) {
    Cdn existing = verifyAndLookupCdn(label);
    this.populateEntity(existing, cdnDTOInput);
    cdnManager.updateCdn(existing);
    return this.translator.translate(existing, CdnDTO.class);
}
Also used : Cdn(org.candlepin.model.Cdn) Path(javax.ws.rs.Path) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) ApiOperation(io.swagger.annotations.ApiOperation) PUT(javax.ws.rs.PUT)

Aggregations

Cdn (org.candlepin.model.Cdn)26 Test (org.junit.Test)16 Consumer (org.candlepin.model.Consumer)11 HashMap (java.util.HashMap)7 Owner (org.candlepin.model.Owner)7 File (java.io.File)5 BadRequestException (org.candlepin.common.exceptions.BadRequestException)5 ArrayList (java.util.ArrayList)4 Event (org.candlepin.audit.Event)4 ForbiddenException (org.candlepin.common.exceptions.ForbiddenException)4 NotFoundException (org.candlepin.common.exceptions.NotFoundException)4 CertificateSerial (org.candlepin.model.CertificateSerial)4 ConsumerType (org.candlepin.model.ConsumerType)4 Entitlement (org.candlepin.model.Entitlement)4 ManifestFile (org.candlepin.sync.file.ManifestFile)3 ApiOperation (io.swagger.annotations.ApiOperation)2 Reader (java.io.Reader)2 Date (java.util.Date)2 Consumes (javax.ws.rs.Consumes)2 Produces (javax.ws.rs.Produces)2