Interface ContainerApi


  • @Beta
    @Consumes("application/json")
    public interface ContainerApi
    Provides access to the OpenStack Object Storage (Swift) Container 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 Detail

      • list

        @Named("container:list")
        @GET
        com.google.common.collect.FluentIterable<Container> list()
        Lists up to 10,000 containers.

        NOTE

        This method returns a list of Container objects without metadata. To retrieve the Container metadata, use the get(String) method.

        Returns:
        a list of containers ordered by name.
      • create

        @Named("container:create")
        @PUT
        @Path("/{containerName}")
        boolean create​(@PathParam("containerName")
                       String containerName)
        Creates a container, if not already present.
        Parameters:
        containerName - corresponds to Container.getName().
        Returns:
        true if the container was created, false if the container already existed.
      • create

        @Named("container:create")
        @PUT
        @Path("/{containerName}")
        boolean create​(@PathParam("containerName")
                       String containerName,
                       CreateContainerOptions options)
        Creates a container, if not already present.
        Parameters:
        containerName - corresponds to Container.getName().
        options - the options to use when creating the container.
        Returns:
        true if the container was created, false if the container already existed.
      • update

        @Named("container:update")
        @POST
        @Path("/{containerName}")
        void update​(@PathParam("containerName")
                    String containerName,
                    UpdateContainerOptions options)
        Updates the Container.
        Parameters:
        containerName - the container name corresponding to Container.getName().
        options - the container options to update.
      • updateMetadata

        @Named("container:updateMetadata")
        @POST
        @Path("/{containerName}")
        void updateMetadata​(@PathParam("containerName")
                            String containerName,
                            Map<String,​String> metadata)
        Creates or updates the Container metadata.
        Parameters:
        containerName - the container name corresponding to Container.getName().
        metadata - the container metadata to create or update.
      • deleteMetadata

        @Named("container:deleteMetadata")
        @POST
        @Path("/{containerName}")
        boolean deleteMetadata​(@PathParam("containerName")
                               String containerName,
                               Map<String,​String> metadata)
        Deletes Container metadata.
        Parameters:
        containerName - corresponds to Container.getName().
        metadata - the container metadata to delete.
        Returns:
        true if the container metadata was successfully deleted, false if not.
      • deleteIfEmpty

        @Named("container:deleteIfEmpty")
        @DELETE
        @Path("/{containerName}")
        boolean deleteIfEmpty​(@PathParam("containerName")
                              String containerName)
                       throws IllegalStateException
        Deletes a Container, if empty.
        Parameters:
        containerName - corresponds to Container.getName().
        Returns:
        true if the container was deleted or not present.
        Throws:
        IllegalStateException - if the container was not empty.