@Path(value="/offer/v1") @ApplicationPath(value="webresources") public class DefaultOfferResource extends ApplicationStatusResource
STATUS_URL, TENANTS_URL
Constructor and Description |
---|
DefaultOfferResource(DefaultOfferService defaultOfferService)
Constructor
|
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
countObjects(String xTenantId,
DataCategory type)
Count the number of objects on the offer objects defined container (exlude directories)
|
javax.ws.rs.core.Response |
deleteObject(String xTenantId,
String xDigest,
String xDigestAlgorithm,
DataCategory type,
String idObject)
Delete an Object
|
javax.ws.rs.core.Response |
getCapacity(String xTenantId,
DataCategory type)
Get the information on the offer objects collection (free and used capacity, etc)
|
javax.ws.rs.core.Response |
getContainerList(boolean xcursor,
String xcursorId,
String xTenantId,
DataCategory type)
Get container object list
|
javax.ws.rs.core.Response |
getObject(DataCategory type,
String objectId,
javax.ws.rs.core.HttpHeaders headers)
Get the object data or digest from its id.
|
javax.ws.rs.core.Response |
getObjectMetadata(DataCategory type,
String idObject,
String xTenantId)
Get metadata of the object type.
|
javax.ws.rs.core.Response |
getOfferLogs(String xTenantId,
DataCategory type,
OfferLogRequest offerLogRequest)
Get log of objects from container
|
javax.ws.rs.core.Response |
headObject(DataCategory type,
String idObject,
String xTenantId,
String xDigest,
String xDigestAlgorithm)
Test the existence of an object
HEADER X-Tenant-Id (mandatory) : tenant's identifier
|
javax.ws.rs.core.Response |
postObject(String objectGUID,
DataCategory type,
javax.ws.rs.core.HttpHeaders headers,
ObjectInit objectInit)
Initialise a new object.
|
javax.ws.rs.core.Response |
putObject(DataCategory type,
String objectId,
javax.ws.rs.core.HttpHeaders headers,
InputStream input)
Write a new chunk in an object or end its creation.
Replaces units and objectGroups object type if exist |
getServerTenants, status
public DefaultOfferResource(DefaultOfferService defaultOfferService)
defaultOfferService
- @HEAD @Path(value="/objects/{type}") @Produces(value="application/json") public javax.ws.rs.core.Response getCapacity(@HeaderParam(value="X-Tenant-Id") String xTenantId, @PathParam(value="type") DataCategory type)
xTenantId
- XtenantIdtype
- The container type@GET @Path(value="/objects/{type}") @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response getContainerList(@HeaderParam(value="X-Cursor") boolean xcursor, @HeaderParam(value="X-Cursor-Id") String xcursorId, @HeaderParam(value="X-Tenant-Id") String xTenantId, @PathParam(value="type") DataCategory type)
xcursor
- if true means new query, if false means end of query from client sidexcursorId
- if present, means continue on cursorxTenantId
- the tenant idtype
- object type@GET @Path(value="/objects/{type}/logs") @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response getOfferLogs(@HeaderParam(value="X-Tenant-Id") String xTenantId, @PathParam(value="type") DataCategory type, OfferLogRequest offerLogRequest)
xTenantId
- the tenant idtype
- object typeofferLogRequest
- request params@GET @Path(value="/count/objects/{type}") @Produces(value="application/json") public javax.ws.rs.core.Response countObjects(@HeaderParam(value="X-Tenant-Id") String xTenantId, @PathParam(value="type") DataCategory type)
xTenantId
- type
- @GET @Path(value="/objects/{type}/{id_object}") @Consumes(value="application/json") @Produces(value={"application/octet-stream","application/zip"}) public javax.ws.rs.core.Response getObject(@PathParam(value="type") DataCategory type, @NotNull @PathParam(value="id_object") String objectId, @Context javax.ws.rs.core.HttpHeaders headers) throws IOException
HEADER X-Tenant-Id (mandatory) : tenant's identifier HEADER "X-type" (optional) : data (dfault) or digest
type
- Object typeobjectId
- object id :.+ in order to get all path if some '/' are providedheaders
- http headerIOException
- when there is an error of get object@POST @Path(value="/objects/{type}/{guid:.+}") @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response postObject(@PathParam(value="guid") String objectGUID, @PathParam(value="type") DataCategory type, @Context javax.ws.rs.core.HttpHeaders headers, ObjectInit objectInit)
HEADER X-Command (mandatory) : INIT
HEADER X-Tenant-Id (mandatory) : tenant's identifier
type
- New object's typeobjectGUID
- the GUID Of the objectheaders
- http headerobjectInit
- data for object creation@PUT @Path(value="/objects/{type}/{id:.+}") @Consumes(value="application/octet-stream") @Produces(value="application/json") public javax.ws.rs.core.Response putObject(@PathParam(value="type") DataCategory type, @PathParam(value="id") String objectId, @Context javax.ws.rs.core.HttpHeaders headers, InputStream input)
HEADER X-Command (mandatory) : WRITE/END HEADER X-Tenant-Id (mandatory) : tenant's identifier
type
- Object type to updateobjectId
- object idheaders
- http headerinput
- object data@DELETE @Path(value="/objects/{type}/{id:.+}") @Produces(value="application/json") public javax.ws.rs.core.Response deleteObject(@HeaderParam(value="X-Tenant-Id") String xTenantId, @HeaderParam(value="X-digest") String xDigest, @HeaderParam(value="X-digest-algorithm") String xDigestAlgorithm, @PathParam(value="type") DataCategory type, @PathParam(value="id") String idObject)
xTenantId
- the tenantIdxDigest
- the digest of the object to deletexDigestAlgorithm
- the digest algorithmtype
- Object type to deleteidObject
- the id of the object to be tested@HEAD @Path(value="/objects/{type}/{id:.+}") public javax.ws.rs.core.Response headObject(@PathParam(value="type") DataCategory type, @PathParam(value="id") String idObject, @HeaderParam(value="X-Tenant-Id") String xTenantId, @HeaderParam(value="X-digest") String xDigest, @HeaderParam(value="X-digest-algorithm") String xDigestAlgorithm)
type
- Object type to testidObject
- the id of the object to be testedxTenantId
- the id of the tenantxDigest
- the digestxDigestAlgorithm
- the digest algorithm@GET @Path(value="/objects/{type}/{id:.+}/metadatas") @Produces(value="application/json") public javax.ws.rs.core.Response getObjectMetadata(@PathParam(value="type") DataCategory type, @PathParam(value="id") String idObject, @HeaderParam(value="X-Tenant-Id") String xTenantId)
type
- Object type to testidObject
- the id of the object to be testedxTenantId
- the id of the tenantCopyright © 2018 Vitam. All rights reserved.