Interface ObjectApi


@Beta public interface ObjectApi
Provides access to the OpenStack Object Storage (Swift) Object API features.

This API is new to jclouds and hence is in Beta. That means we need people to use it and give us feedback. Based on that feedback, minor changes to the interfaces may happen. This code will replace org.jclouds.openstack.swift.SwiftClient in jclouds 2.0 and it is recommended you adopt it sooner than later.

  • Method Details

    • list

      @Consumes("application/json") @Named("object:list") @GET @Nullable ObjectList list()
      Lists up to 10,000 objects.
      Returns:
      an ObjectList of SwiftObject ordered by name or null.
    • list

      @Consumes("application/json") @Named("object:list") @GET @Nullable ObjectList list(ListContainerOptions options)
      Lists up to 10,000 objects. To control a large list of containers beyond 10,000 objects, use the marker and endMarker parameters in the ListContainerOptions class.
      Parameters:
      options - the ListContainerOptions for controlling the returned list.
      Returns:
      an ObjectList of SwiftObject ordered by name or null.
    • put

      @Named("object:put") @PUT @Path("/{objectName}") String put(@PathParam("objectName") String objectName, Payload payload)
      Creates or updates a SwiftObject.
      Parameters:
      objectName - corresponds to SwiftObject.getName().
      payload - corresponds to SwiftObject.getPayload().
      Returns:
      SwiftObject.getETag() of the object.
    • put

      @Named("object:put") @PUT @Path("/{objectName}") String put(@PathParam("objectName") String objectName, Payload payload, PutOptions options)
      Creates or updates a SwiftObject.
      Parameters:
      objectName - corresponds to SwiftObject.getName().
      payload - corresponds to SwiftObject.getPayload().
      options - options to control creating the SwiftObject.
      Returns:
      SwiftObject.getETag() of the object.
    • getWithoutBody

      @Named("object:getWithoutBody") @HEAD @Path("/{objectName}") @Nullable SwiftObject getWithoutBody(@PathParam("objectName") String objectName)
      Gets the SwiftObject metadata without its body.
      Parameters:
      objectName - corresponds to SwiftObject.getName().
      Returns:
      the SwiftObject or null, if not found.
    • get

      @Named("object:get") @GET @Path("/{objectName}") @Nullable SwiftObject get(@PathParam("objectName") String objectName)
      Gets the SwiftObject including its body.
      Parameters:
      objectName - corresponds to SwiftObject.getName().
      Returns:
      the SwiftObject or null, if not found.
    • get

      @Named("object:get") @GET @Path("/{objectName}") @Nullable SwiftObject get(@PathParam("objectName") String objectName, GetOptions options)
      Gets the SwiftObject including its body.
      Parameters:
      objectName - corresponds to SwiftObject.getName().
      options - options to control the download.
      Returns:
      the SwiftObject or null, if not found.
    • updateMetadata

      @Named("object:updateMetadata") @POST @Path("/{objectName}") @Produces("") void updateMetadata(@PathParam("objectName") String objectName, Map<String,String> metadata)
      Creates or updates the metadata for a SwiftObject.
      Parameters:
      objectName - corresponds to SwiftObject.getName().
      metadata - the metadata to create or update.
    • updateHeaders

      @Named("object:updateMetadata") @POST @Path("/{objectName}") @Produces("") void updateHeaders(@PathParam("objectName") String objectName, Map<String,String> metadata)
      Creates or updates the metadata for a SwiftObject without escaping the key. This will also update metadata such as content-disposition.
      Parameters:
      objectName - corresponds to SwiftObject.getName().
      metadata - the metadata to create or update.
    • deleteMetadata

      @Named("object:deleteMetadata") @POST @Path("/{objectName}") boolean deleteMetadata(@PathParam("objectName") String objectName, Map<String,String> metadata)
      Deletes the metadata from a SwiftObject.
      Parameters:
      objectName - corresponds to SwiftObject.getName().
      metadata - corresponds to SwiftObject.getMetadata().
      Returns:
      true if the metadata was successfully deleted, false if not.
    • delete

      @Named("object:delete") @DELETE @Path("/{objectName}") void delete(@PathParam("objectName") String objectName)
      Deletes an object, if present.
      Parameters:
      objectName - corresponds to SwiftObject.getName().
    • copy

      @Deprecated @Named("object:copy") @PUT @Path("/{destinationObject}") void copy(@PathParam("destinationObject") String destinationObject, @PathParam("sourceContainer") String sourceContainer, @PathParam("sourceObject") String sourceObject)
      Deprecated.
      call copy(String, String, String, CopyOptions) instead
      Copies an object from one container to another.

      NOTE

      This is a server side copy.
      Parameters:
      destinationObject - the destination object name.
      sourceContainer - the source container name.
      sourceObject - the source object name.
      Throws:
      KeyNotFoundException - if the source or destination container do not exist.
    • copy

      @Named("object:copy") @PUT @Path("/{destinationObject}") void copy(@PathParam("destinationObject") String destinationObject, @PathParam("sourceContainer") String sourceContainer, @PathParam("sourceObject") String sourceObject, CopyOptions options)
      Copies an object from one container to another.

      NOTE

      This is a server side copy.
      Parameters:
      destinationObject - the destination object name.
      sourceContainer - the source container name.
      sourceObject - the source object name.
      options - conditional copy
      Throws:
      KeyNotFoundException - if the source or destination container do not exist.
    • copy

      @Deprecated @Named("object:copy") @PUT @Path("/{destinationObject}") void copy(@PathParam("destinationObject") String destinationObject, @PathParam("sourceContainer") String sourceContainer, @PathParam("sourceObject") String sourceObject, Map<String,String> userMetadata, Map<String,String> objectMetadata)
      Deprecated.
      call copy(String, String, String, Map, Map, CopyOptions) instead
      Copies an object from one container to another, replacing metadata.

      NOTE

      This is a server side copy.
      Parameters:
      destinationObject - the destination object name.
      sourceContainer - the source container name.
      sourceObject - the source object name.
      userMetadata - Freeform metadata for the object, automatically prefixed/escaped
      objectMetadata - Unprefixed/unescaped metadata, such as Content-Disposition
      Throws:
      KeyNotFoundException - if the source or destination container do not exist.
    • copy

      @Named("object:copy") @PUT @Path("/{destinationObject}") void copy(@PathParam("destinationObject") String destinationObject, @PathParam("sourceContainer") String sourceContainer, @PathParam("sourceObject") String sourceObject, Map<String,String> userMetadata, Map<String,String> objectMetadata, CopyOptions options)
      Copies an object from one container to another, replacing metadata.

      NOTE

      This is a server side copy.
      Parameters:
      destinationObject - the destination object name.
      sourceContainer - the source container name.
      sourceObject - the source object name.
      userMetadata - Freeform metadata for the object, automatically prefixed/escaped
      objectMetadata - Unprefixed/unescaped metadata, such as Content-Disposition
      options - conditional copy
      Throws:
      KeyNotFoundException - if the source or destination container do not exist.
    • copyAppendMetadata

      @Deprecated @Named("object:copy") @PUT @Path("/{destinationObject}") void copyAppendMetadata(@PathParam("destinationObject") String destinationObject, @PathParam("sourceContainer") String sourceContainer, @PathParam("sourceObject") String sourceObject, Map<String,String> userMetadata, Map<String,String> objectMetadata)
      Deprecated.
      call copyAppendMetadata(String, String, String, Map, Map, CopyOptions) instead
      Copies an object from one container to another, appending metadata.

      NOTE

      This is a server side copy.
      Parameters:
      destinationObject - the destination object name.
      sourceContainer - the source container name.
      sourceObject - the source object name.
      userMetadata - Freeform metadata for the object, automatically prefixed/escaped
      objectMetadata - Unprefixed/unescaped metadata, such as Content-Disposition
      Throws:
      KeyNotFoundException - if the source or destination container do not exist.
    • copyAppendMetadata

      @Named("object:copy") @PUT @Path("/{destinationObject}") void copyAppendMetadata(@PathParam("destinationObject") String destinationObject, @PathParam("sourceContainer") String sourceContainer, @PathParam("sourceObject") String sourceObject, Map<String,String> userMetadata, Map<String,String> objectMetadata, CopyOptions options)
      Copies an object from one container to another, appending metadata.

      NOTE

      This is a server side copy.
      Parameters:
      destinationObject - the destination object name.
      sourceContainer - the source container name.
      sourceObject - the source object name.
      userMetadata - Freeform metadata for the object, automatically prefixed/escaped
      objectMetadata - Unprefixed/unescaped metadata, such as Content-Disposition
      options - conditional copy
      Throws:
      KeyNotFoundException - if the source or destination container do not exist.