Interface CDNApi

  • All Superinterfaces:
    AutoCloseable, Closeable

    @Beta
    @Consumes("application/json")
    public interface CDNApi
    extends Closeable
    Provides access to the Rackspace Cloud Files CDN API features.

    NOTE

    Before a container can be CDN enabled, it must exist in the storage system. To CDN enable the container, perform PUT request against it using the publicURL noted in the service catalog for Cloud Files during Authentication and set the X-CDN-Enabled header to true.
    • Method Detail

      • list

        @Named("cdn:list")
        @GET
        @Path("/")
        com.google.common.collect.FluentIterable<CDNContainer> list()
        Lists up to 10,000 CDN containers.
        Returns:
        a list of CDN enabled containers ordered by name.
      • list

        @Named("cdn:list")
        @GET
        @Path("/")
        com.google.common.collect.FluentIterable<CDNContainer> list​(ListCDNContainerOptions options)
        Lists CDN containers, with the given options.
        Parameters:
        options - the options to control output.
        Returns:
        a list of CDN enabled containers ordered by name.
      • get

        @Named("cdn:get")
        @HEAD
        @Path("/{container}")
        @Nullable
        CDNContainer get​(@PathParam("container")
                         String containerName)
        Gets the specified CDN Container.
        Parameters:
        containerName - the name of the CDN Container
        Returns:
        the CDNContainer or null, if not found.
      • enable

        @Named("cdn:enable")
        @PUT
        @Path("/{containerName}")
        @Nullable
        URI enable​(@PathParam("containerName")
                   String containerName)
        Enables the CDNContainer.
        Parameters:
        containerName - corresponds to CDNContainer.getName().
        Returns:
        the CDN container URI or null, if not found.
      • enable

        @Named("cdn:enable")
        @PUT
        @Path("/{containerName}")
        @Nullable
        URI enable​(@PathParam("containerName")
                   String containerName,
                   @HeaderParam("X-Ttl")
                   int ttl)
        Enables the CDNContainer with a TTL.
        Parameters:
        containerName - corresponds to CDNContainer.getName().
        ttl - the TTL for the CDN Container.
        Returns:
        the CDN container URI or null, if not found.
      • disable

        @Named("cdn:disable")
        @PUT
        @Path("/{containerName}")
        boolean disable​(@PathParam("containerName")
                        String containerName)
        Disables the CDNContainer.
        Parameters:
        containerName - corresponds to CDNContainer.getName().
        Returns:
        true if the container was disabled, false if not.
      • purgeObject

        @Named("cdn:purge")
        @DELETE
        @Path("/{containerName}/{objectName}")
        boolean purgeObject​(@PathParam("containerName")
                            String containerName,
                            @PathParam("objectName")
                            String objectName,
                            Iterable<String> emails)
        Purges an object from the CDN.
        Parameters:
        containerName - corresponds to CDNContainer.getName().
        objectName - the object in the CDNContainer to purge.
        emails - the email addresses to notify after purging.
        Returns:
        true if the object was successfully purged, false if not.