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 thepublicURL
noted in the service catalog for Cloud Files during Authentication and set theX-CDN-Enabled
header totrue
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
disable(String containerName)
Disables theCDNContainer
.URI
enable(String containerName)
Enables theCDNContainer
.URI
enable(String containerName, int ttl)
Enables theCDNContainer
with a TTL.CDNContainer
get(String containerName)
Gets the specified CDN Container.com.google.common.collect.FluentIterable<CDNContainer>
list()
Lists up to 10,000 CDN containers.com.google.common.collect.FluentIterable<CDNContainer>
list(ListCDNContainerOptions options)
Lists CDN containers, with the given options.boolean
purgeObject(String containerName, String objectName, Iterable<String> emails)
Purges an object from the CDN.boolean
update(String containerName, UpdateCDNContainerOptions options)
Updates a CDN container with the suppliedUpdateCDNContainerOptions
options.
-
-
-
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 theCDNContainer
.- Parameters:
containerName
- corresponds toCDNContainer.getName()
.- Returns:
- the CDN container
URI
ornull
, if not found.
-
enable
@Named("cdn:enable") @PUT @Path("/{containerName}") @Nullable URI enable(@PathParam("containerName") String containerName, @HeaderParam("X-Ttl") int ttl)
Enables theCDNContainer
with a TTL.- Parameters:
containerName
- corresponds toCDNContainer.getName()
.ttl
- the TTL for the CDN Container.- Returns:
- the CDN container
URI
ornull
, if not found.
-
disable
@Named("cdn:disable") @PUT @Path("/{containerName}") boolean disable(@PathParam("containerName") String containerName)
Disables theCDNContainer
.- Parameters:
containerName
- corresponds toCDNContainer.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 toCDNContainer.getName()
.objectName
- the object in theCDNContainer
to purge.emails
- the email addresses to notify after purging.- Returns:
true
if the object was successfully purged,false
if not.
-
update
@Named("cdn:update") @POST @Path("/{containerName}") boolean update(@PathParam("containerName") String containerName, UpdateCDNContainerOptions options)
Updates a CDN container with the suppliedUpdateCDNContainerOptions
options.- Parameters:
containerName
- corresponds toCDNContainer.getName()
.options
- theUpdateCDNContainerOptions
options.
-
-