Class DefaultOfferResource
java.lang.Object
fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
fr.gouv.vitam.storage.offers.rest.DefaultOfferResource
@Path("/offer/v1")
@ApplicationPath("webresources")
public class DefaultOfferResource
extends ApplicationStatusResource
-
Field Summary
FieldsFields inherited from class fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
STATUS_URL, TENANTS_URL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsebulkPutObjects(DataCategory type, jakarta.ws.rs.core.HttpHeaders headers, InputStream input) Bulk create or update objects.jakarta.ws.rs.core.ResponsecheckAccessRequestStatuses(List<String> accessRequestIds, jakarta.ws.rs.core.HttpHeaders headers) Check access request statuses by identifiersjakarta.ws.rs.core.ResponsecheckObjectAvailability(DataCategory type, List<String> objectNames, jakarta.ws.rs.core.HttpHeaders headers) Check object availability for immediate access on async storage offers (tape storage only).jakarta.ws.rs.core.ResponsecheckObjectExistence(DataCategory type, String idObject, String xTenantId) Test the existence of an objectjakarta.ws.rs.core.ResponsecreateAccessRequest(DataCategory type, List<String> objectNames, jakarta.ws.rs.core.HttpHeaders headers) Create access request (asynchronous read from tape to local FS) for the given @type and objects ids list.jakarta.ws.rs.core.ResponsedeleteObject(String xTenantId, String xDigestAlgorithm, DataCategory type, String idObject) Delete an Objectjakarta.ws.rs.core.ResponsegetBulkObjectMetadata(DataCategory type, String xTenantId, Boolean noCache, List<String> objectIds) Get bulk metadata of the objects by ids.jakarta.ws.rs.core.ResponsegetCapacity(String xTenantId, DataCategory type) Get the information on the offer objects collection (free and used capacity, etc)jakarta.ws.rs.core.ResponsegetContainerList(String xTenantId, DataCategory type) Get container object list.jakarta.ws.rs.core.ResponsegetObject(DataCategory type, @NotNull String objectId, jakarta.ws.rs.core.HttpHeaders headers) Get the object data or digest from its id.jakarta.ws.rs.core.ResponsegetObjectMetadata(DataCategory type, String idObject, String xTenantId, Boolean noCache) Get metadata of the object type.jakarta.ws.rs.core.ResponsegetOfferLogs(String xTenantId, DataCategory type, OfferLogRequest offerLogRequest) Get log of objects from containervoidjakarta.ws.rs.core.ResponseputObject(String objectId, DataCategory type, jakarta.ws.rs.core.HttpHeaders headers, InputStream input) Creates or updates an object.jakarta.ws.rs.core.ResponseremoveAccessRequest(String accessRequestId, jakarta.ws.rs.core.HttpHeaders headers) Methods inherited from class fr.gouv.vitam.common.server.application.resources.ApplicationStatusResource
getServerTenants, status
-
Field Details
-
RE_AUTHENTICATION_CALL_STREAM_ALREADY_CONSUMED_BUT_NO_FILE_CREATED
- See Also:
-
-
Constructor Details
-
DefaultOfferResource
Constructor- Parameters:
defaultOfferService-
-
-
Method Details
-
getCapacity
@HEAD @Path("/objects/{type}") @Produces("application/json") public jakarta.ws.rs.core.Response getCapacity(@HeaderParam("X-Tenant-Id") String xTenantId, @PathParam("type") DataCategory type) Get the information on the offer objects collection (free and used capacity, etc)- Parameters:
xTenantId- XtenantIdtype- The container type- Returns:
- information on the offer objects collection
-
getContainerList
@GET @Path("/objects/{type}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response getContainerList(@HeaderParam("X-Tenant-Id") String xTenantId, @PathParam("type") DataCategory type) Get container object list.- Parameters:
xTenantId- the tenant idtype- object type- Returns:
- an iterator with each object metadata (actually only the id)
-
getOfferLogs
@GET @Path("/objects/{type}/logs") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response getOfferLogs(@HeaderParam("X-Tenant-Id") String xTenantId, @PathParam("type") DataCategory type, OfferLogRequest offerLogRequest) Get log of objects from container- Parameters:
xTenantId- the tenant idtype- object typeofferLogRequest- request params- Returns:
- list of objects infos
-
getObject
@GET @Path("/objects/{type}/{id_object}") @Consumes("application/json") @Produces({"application/octet-stream","application/zip"}) public jakarta.ws.rs.core.Response getObject(@PathParam("type") DataCategory type, @NotNull @PathParam("id_object") @NotNull String objectId, @Context jakarta.ws.rs.core.HttpHeaders headers) Get the object data or digest from its id.HEADER X-Tenant-Id (mandatory) : tenant's identifier HEADER "X-type" (optional) : data (dfault) or digest
- Parameters:
type- Object typeobjectId- object id :.+ in order to get all path if some '/' are providedheaders- http header- Returns:
- response
- Throws:
IOException- when there is an error of get object
-
createAccessRequest
@POST @Path("/access-request/{type}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response createAccessRequest(@PathParam("type") DataCategory type, List<String> objectNames, @Context jakarta.ws.rs.core.HttpHeaders headers) Create access request (asynchronous read from tape to local FS) for the given @type and objects ids list.HEADER X-Tenant-Id (mandatory) : tenant's identifier
- Parameters:
type- Object typeobjectNames- : object names for which access is requestedheaders- http header- Returns:
- response
-
checkAccessRequestStatuses
@GET @Path("/access-request/statuses") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response checkAccessRequestStatuses(List<String> accessRequestIds, @Context jakarta.ws.rs.core.HttpHeaders headers) Check access request statuses by identifiersHEADER X-Tenant-Id (mandatory) : tenant's identifier
- Parameters:
accessRequestIds- the list of access request ids- Returns:
- response
-
removeAccessRequest
@DELETE @Path("/access-request/{accessRequestId}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response removeAccessRequest(@PathParam("accessRequestId") String accessRequestId, @Context jakarta.ws.rs.core.HttpHeaders headers) -
checkObjectAvailability
@GET @Path("/object-availability-check/{type}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response checkObjectAvailability(@PathParam("type") DataCategory type, List<String> objectNames, @Context jakarta.ws.rs.core.HttpHeaders headers) Check object availability for immediate access on async storage offers (tape storage only). For tape storage, an object is immediately accessible only when it's currently stored fully on disk. This API is not supported for synchronous storage offers. HEADER X-Tenant-Id (mandatory) : tenant's identifier- Parameters:
type- Object typeobjectNames- object names for which immediate availability is to be checkedheaders- http header- Returns:
- response
-
putObject
@PUT @Path("/objects/{type}/{objectId:.+}") @Consumes("application/octet-stream") @Produces("application/json") public jakarta.ws.rs.core.Response putObject(@PathParam("objectId") String objectId, @PathParam("type") DataCategory type, @Context jakarta.ws.rs.core.HttpHeaders headers, InputStream input) Creates or updates an object.- Parameters:
objectId- the object idtype- Object's typeheaders- http header- Returns:
- structured response with the object id
-
bulkPutObjects
@PUT @Path("/bulk/objects/{type}") @Consumes("application/octet-stream") @Produces("application/json") public jakarta.ws.rs.core.Response bulkPutObjects(@PathParam("type") DataCategory type, @Context jakarta.ws.rs.core.HttpHeaders headers, InputStream input) Bulk create or update objects.- Parameters:
type- Object's typeheaders- http header- Returns:
- structured response with the object id
-
deleteObject
@DELETE @Path("/objects/{type}/{id:.+}") @Produces("application/json") public jakarta.ws.rs.core.Response deleteObject(@HeaderParam("X-Tenant-Id") String xTenantId, @HeaderParam("X-digest-algorithm") String xDigestAlgorithm, @PathParam("type") DataCategory type, @PathParam("id") String idObject) Delete an Object- Parameters:
xTenantId- the tenantIdxDigestAlgorithm- the digest algorithmtype- Object type to deleteidObject- the id of the object to be tested- Returns:
- the response with a specific HTTP status
-
checkObjectExistence
@HEAD @Path("/objects/{type}/{id:.+}") public jakarta.ws.rs.core.Response checkObjectExistence(@PathParam("type") DataCategory type, @PathParam("id") String idObject, @HeaderParam("X-Tenant-Id") String xTenantId) Test the existence of an objectHEADER X-Tenant-Id (mandatory) : tenant's identifier
- Parameters:
type- Object type to testidObject- the id of the object to be testedxTenantId- the id of the tenant- Returns:
- the response with a specific HTTP status. If none of DIGEST or DIGEST_ALGORITHM headers is given, an existence test is done and can return 204/404 as response. If only DIGEST or only DIGEST_ALGORITHM header is given, a not implemented exception is thrown. Later, this should respond with 200/409. If both DIGEST and DIGEST_ALGORITHM header are given, a full digest check is done and can return 200/409 as response
-
getObjectMetadata
@GET @Path("/objects/{type}/{id:.+}/metadatas") @Produces("application/json") public jakarta.ws.rs.core.Response getObjectMetadata(@PathParam("type") DataCategory type, @PathParam("id") String idObject, @HeaderParam("X-Tenant-Id") String xTenantId, @HeaderParam("X-Offer-No-Cache") Boolean noCache) Get metadata of the object type.- Parameters:
type- Object type to testidObject- the id of the object to be testedxTenantId- the id of the tenant- Returns:
- metadatas
-
getBulkObjectMetadata
@GET @Path("/bulk/objects/{type}/metadata") @Produces("application/json") @Consumes("application/json") public jakarta.ws.rs.core.Response getBulkObjectMetadata(@PathParam("type") DataCategory type, @HeaderParam("X-Tenant-Id") String xTenantId, @HeaderParam("X-Offer-No-Cache") Boolean noCache, List<String> objectIds) Get bulk metadata of the objects by ids.- Parameters:
type- Object type to testxTenantId- the id of the tenant- Returns:
- metadata by object id
-
launchOfferLogCompaction
@POST @Path("/compaction") @Consumes("application/json") public void launchOfferLogCompaction() throws Exception- Throws:
Exception
-