Class DefaultOfferResource


@Path("/offer/v1") @ApplicationPath("webresources") public class DefaultOfferResource extends ApplicationStatusResource
  • Field Details

    • RE_AUTHENTICATION_CALL_STREAM_ALREADY_CONSUMED_BUT_NO_FILE_CREATED

      public static final String RE_AUTHENTICATION_CALL_STREAM_ALREADY_CONSUMED_BUT_NO_FILE_CREATED
      See Also:
  • Constructor Details

    • DefaultOfferResource

      public DefaultOfferResource(DefaultOfferService defaultOfferService)
      Constructor
      Parameters:
      defaultOfferService -
  • Method Details

    • getCapacity

      @HEAD @Path("/objects/{type}") @Produces("application/json") public javax.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 - XtenantId
      type - The container type
      Returns:
      information on the offer objects collection
    • getContainerList

      @GET @Path("/objects/{type}") @Consumes("application/json") @Produces("application/json") public javax.ws.rs.core.Response getContainerList(@HeaderParam("X-Tenant-Id") String xTenantId, @PathParam("type") DataCategory type)
      Get container object list.
      Parameters:
      xTenantId - the tenant id
      type - 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 javax.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 id
      type - object type
      offerLogRequest - request params
      Returns:
      list of objects infos
    • getObject

      @GET @Path("/objects/{type}/{id_object}") @Consumes("application/json") @Produces({"application/octet-stream","application/zip"}) public javax.ws.rs.core.Response getObject(@PathParam("type") DataCategory type, @NotNull @PathParam("id_object") @NotNull String objectId, @Context javax.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 type
      objectId - object id :.+ in order to get all path if some '/' are provided
      headers - 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 javax.ws.rs.core.Response createAccessRequest(@PathParam("type") DataCategory type, List<String> objectNames, @Context javax.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 type
      objectNames - : object names for which access is requested
      headers - http header
      Returns:
      response
    • checkAccessRequestStatuses

      @GET @Path("/access-request/statuses") @Consumes("application/json") @Produces("application/json") public javax.ws.rs.core.Response checkAccessRequestStatuses(List<String> accessRequestIds, @Context javax.ws.rs.core.HttpHeaders headers)
      Check access request statuses by identifiers

      HEADER 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 javax.ws.rs.core.Response removeAccessRequest(@PathParam("accessRequestId") String accessRequestId, @Context javax.ws.rs.core.HttpHeaders headers)
    • checkObjectAvailability

      @GET @Path("/object-availability-check/{type}") @Consumes("application/json") @Produces("application/json") public javax.ws.rs.core.Response checkObjectAvailability(@PathParam("type") DataCategory type, List<String> objectNames, @Context javax.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 type
      objectNames - object names for which immediate availability is to be checked
      headers - http header
      Returns:
      response
    • putObject

      @PUT @Path("/objects/{type}/{objectId:.+}") @Consumes("application/octet-stream") @Produces("application/json") public javax.ws.rs.core.Response putObject(@PathParam("objectId") String objectId, @PathParam("type") DataCategory type, @Context javax.ws.rs.core.HttpHeaders headers, InputStream input)
      Creates or updates an object.
      Parameters:
      type - Object's type
      objectId - the object id
      headers - http header
      Returns:
      structured response with the object id
    • bulkPutObjects

      @PUT @Path("/bulk/objects/{type}") @Consumes("application/octet-stream") @Produces("application/json") public javax.ws.rs.core.Response bulkPutObjects(@PathParam("type") DataCategory type, @Context javax.ws.rs.core.HttpHeaders headers, InputStream input)
      Bulk create or update objects.
      Parameters:
      type - Object's type
      headers - http header
      Returns:
      structured response with the object id
    • deleteObject

      @DELETE @Path("/objects/{type}/{id:.+}") @Produces("application/json") public javax.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 tenantId
      xDigestAlgorithm - the digest algorithm
      type - Object type to delete
      idObject - the id of the object to be tested
      Returns:
      the response with a specific HTTP status
    • checkObjectExistence

      @HEAD @Path("/objects/{type}/{id:.+}") public javax.ws.rs.core.Response checkObjectExistence(@PathParam("type") DataCategory type, @PathParam("id") String idObject, @HeaderParam("X-Tenant-Id") String xTenantId)
      Test the existence of an object

      HEADER X-Tenant-Id (mandatory) : tenant's identifier

      Parameters:
      type - Object type to test
      idObject - the id of the object to be tested
      xTenantId - 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 javax.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 test
      idObject - the id of the object to be tested
      xTenantId - the id of the tenant
      Returns:
      metadatas
    • getBulkObjectMetadata

      @GET @Path("/bulk/objects/{type}/metadata") @Produces("application/json") @Consumes("application/json") public javax.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 test
      xTenantId - the id of the tenant
      Returns:
      metadata by object id
    • launchOfferLogCompaction

      @POST @Path("/compaction") @Consumes("application/json") public void launchOfferLogCompaction() throws Exception
      Throws:
      Exception