@Path(value="/offer/v1") @ApplicationPath(value="webresources") public class DefaultOfferResource extends ApplicationStatusResource
Modifier and Type | Field and Description |
---|---|
static String |
RE_AUTHENTICATION_CALL_STREAM_ALREADY_CONSUMED_BUT_NO_FILE_CREATED |
STATUS_URL, TENANTS_URL
Constructor and Description |
---|
DefaultOfferResource(DefaultOfferService defaultOfferService)
Constructor
|
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
bulkPutObjects(DataCategory type,
javax.ws.rs.core.HttpHeaders headers,
InputStream input)
Bulk create or update objects.
|
javax.ws.rs.core.Response |
checkObjectExistence(DataCategory type,
String idObject,
String xTenantId)
Test the existence of an object
|
javax.ws.rs.core.Response |
createReadOrderRequest(DataCategory type,
List<String> objectsIds,
javax.ws.rs.core.HttpHeaders headers)
Create read order (asynchronous read from tape to local FS) for the given @type and objects ids list.
|
javax.ws.rs.core.Response |
deleteObject(String xTenantId,
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,
@NotNull 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,
Boolean noCache)
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 |
getReadOrderRequest(String readOrderRequestId,
javax.ws.rs.core.HttpHeaders headers)
Get read order request
|
javax.ws.rs.core.Response |
putObject(String objectId,
DataCategory type,
javax.ws.rs.core.HttpHeaders headers,
InputStream input)
Creates or updates an object.
|
javax.ws.rs.core.Response |
removeReadOrderRequest(String readOrderRequestId,
javax.ws.rs.core.HttpHeaders headers) |
getServerTenants, status
public static final String RE_AUTHENTICATION_CALL_STREAM_ALREADY_CONSUMED_BUT_NO_FILE_CREATED
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="/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") @NotNull String objectId, @Context javax.ws.rs.core.HttpHeaders headers)
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="/readorder/{type}") @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response createReadOrderRequest(@PathParam(value="type") DataCategory type, List<String> objectsIds, @Context javax.ws.rs.core.HttpHeaders headers)
HEADER X-Tenant-Id (mandatory) : tenant's identifier HEADER "X-type" (optional) : data (dfault) or digest
type
- Object typeobjectsIds
- objects ids :.+ in order to get all path if some '/' are providedheaders
- http header@GET @Path(value="/readorder/{readOrderRequestId}") @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response getReadOrderRequest(@PathParam(value="readOrderRequestId") String readOrderRequestId, @Context javax.ws.rs.core.HttpHeaders headers)
HEADER X-Tenant-Id (mandatory) : tenant's identifier HEADER "X-type" (optional) : data (dfault) or digest
readOrderRequestId
- the read request ID@DELETE @Path(value="/readorder/{readOrderRequestId}") @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response removeReadOrderRequest(@PathParam(value="readOrderRequestId") String readOrderRequestId, @Context javax.ws.rs.core.HttpHeaders headers)
@PUT @Path(value="/objects/{type}/{objectId:.+}") @Consumes(value="application/octet-stream") @Produces(value="application/json") public javax.ws.rs.core.Response putObject(@PathParam(value="objectId") String objectId, @PathParam(value="type") DataCategory type, @Context javax.ws.rs.core.HttpHeaders headers, InputStream input)
type
- Object's typeobjectId
- the object idheaders
- http header@PUT @Path(value="/bulk/objects/{type}") @Consumes(value="application/octet-stream") @Produces(value="application/json") public javax.ws.rs.core.Response bulkPutObjects(@PathParam(value="type") DataCategory type, @Context javax.ws.rs.core.HttpHeaders headers, InputStream input)
type
- Object's typeheaders
- http header@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-algorithm") String xDigestAlgorithm, @PathParam(value="type") DataCategory type, @PathParam(value="id") String idObject)
xTenantId
- the tenantIdxDigestAlgorithm
- 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 checkObjectExistence(@PathParam(value="type") DataCategory type, @PathParam(value="id") String idObject, @HeaderParam(value="X-Tenant-Id") String xTenantId)
HEADER X-Tenant-Id (mandatory) : tenant's identifier
type
- Object type to testidObject
- the id of the object to be testedxTenantId
- the id of the tenant@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, @HeaderParam(value="X-Offer-No-Cache") Boolean noCache)
type
- Object type to testidObject
- the id of the object to be testedxTenantId
- the id of the tenantCopyright © 2019 Vitam. All rights reserved.