Manage the accounts, containers, and objects in the Object Storage system.
To run the cURL command examples for these requests, set these environment variables:
publicURL
. The public URL that is the
HTTP endpoint from where you can access Object
Storage. It includes the Cloud Files API version
number and your account name. For example,
https://<IP_ADDRESS>/v1/my_account
.
token
. The authentication token for
Cloud Files.
To obtain these values, run the
As shown in this example, the public URL appears in the
StorageURL
field, and the token appears in
the Auth Token
field:
StorageURL: https://<IP_ADDRESS>/v1/my_account Auth Token: {token} Account: my_account Containers: 2 Objects: 3 Bytes: 47 Meta Book: MobyDick X-Timestamp:<PHONE_NUMBER>.35964 X-Trans-Id: txee55498935404a2caad89-0052dd3b77 Content-Type: text/plain; charset=utf-8 Accept-Ranges: bytes
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
List containers for a specified account. Create, update, and delete account metadata. Show account metadata.
Shows details for a specified account and lists containers, sorted by name, in the account.
The sort order for the name is based on a binary comparison, a single built-in
collating sequence that compares string data by using
the SQLite
This operation does not accept a request body.
Example requests and responses:
Show account details and list containers, and ask for a JSON response:
curl -i
$publicURL?format=json -X GET -H
"X-Auth-Token: $token"
See the example response below.
List containers and ask for an XML response:
curl -i $publicURL?format=xml -X GET
-H "X-Auth-Token:
$token"
See the example response below.
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
The response body returns a list of containers. The
default response (text/plain
) returns one
container per line.
If you use query parameters to page through a long
list of containers, you have reached the end of the
list if the number of items in the returned list is
less than the request limit
value. The
list contains more items if the number of items in the
returned list equals the limit
value.
If the request succeeds, the operation returns one of these status codes:
marker
, limit
, or
end_marker
query parameters,
and you have reached the end of the
list.
| Parameter | Style | Type | Description |
|---|---|---|---|
| limit (Optional) | query | xsd:int |
For an integer value
|
| marker (Optional) | query | xsd:string |
For a string value
|
| end_marker (Optional) | query | xsd:string |
For a string value
|
| format (Optional) | query | xsd:string |
The response format. Valid values are
If you append the If you append the |
| prefix (Optional) | query | xsd:string |
Prefix value. Object names in the response begin with this value. |
| delimiter (Optional) | query | xsd:char |
Delimiter value, which returns the object names that are nested in the container. |
| X-Auth-Token | header | xsd:string |
Authentication token. |
| X-Newest (Optional) | header | xsd:boolean |
If set to
|
| Accept (Optional) | header | xsd:string |
Instead of using the |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
The length of the response body that contains the list of names. If the operation fails, this value is the length of the error text in the response body. |
| Content-Type | header | xsd:string |
The MIME type of the list of names. If the operation fails, this value is the MIME type of the error text in the response body. |
| X-Account-Object-Count | header | xsd:int |
The number of objects in the account. |
| X-Account-Bytes-Used | header | xsd:int |
The total number of bytes that are stored in Object Storage for the account. |
| X-Account-Container-Count | header | xsd:int |
The number of containers. |
| X-Account-Meta-{name} (Optional) | header | xsd:string |
The custom account metadata item, where
One |
| X-Account-Meta-Temp-URL-Key (Optional) | header | xsd:string |
The secret key value for temporary URLs. If not set, this header is not returned by this operation. |
| X-Account-Meta-Temp-URL-Key-2 (Optional) | header | xsd:string |
A second secret key value for temporary URLs. If not set, this header is not returned by this operation. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
| name | plain | xsd:string |
The name of the container. |
| count | plain | xsd:int |
The number of objects in the container. |
| bytes | plain | xsd:int |
The total number of bytes that are stored in Object Storage for the account. |
HTTP/1.1 200 OK Content-Length: 96 X-Account-Object-Count: 1 X-Timestamp:<PHONE_NUMBER>.35964 X-Account-Meta-Subject: Literature X-Account-Bytes-Used: 14 X-Account-Container-Count: 2 Content-Type: application/json; charset=utf-8 Accept-Ranges: bytes X-Trans-Id: tx274a77a8975c4a66aeb24-0052d95365 Date: Fri, 17 Jan 2014 15:59:33 GMT
[ { "count":0, "bytes":0, "name":"janeausten" }, { "count":1, "bytes":14, "name":"marktwain" } ]
HTTP/1.1 200 OK Content-Length: 262 X-Account-Object-Count: 1 X-Timestamp:<PHONE_NUMBER>.35964 X-Account-Meta-Subject: Literature X-Account-Bytes-Used: 14 X-Account-Container-Count: 2 Content-Type: application/xml; charset=utf-8 Accept-Ranges: bytes X-Trans-Id: tx69f60bc9f7634a01988e6-0052d9544b Date: Fri, 17 Jan 2014 16:03:23 GMT
<?xml version="1.0" encoding="UTF-8"?> <account name="my_account"> <container> <name>janeausten</name> <count>0</count> <bytes>0</bytes> </container> <container> <name>marktwain</name> <count>1</count> <bytes>14</bytes> </container> </account>
Creates, updates, or deletes account metadata.
To create, update, or delete metadata, use the
X-Account-Meta-{name}
header, where
{name}
is the name of the metadata
item.
Subsequent requests for the same key and value pair overwrite the previous value.
To delete a metadata header, send an empty value for
that particular header, such as for the
X-Account-Meta-Book
header. If the
tool you use to communicate with Object Storage, such
as an older version of cURL, does not support empty
headers, send the
X-Remove-Account-Meta-{name}
:
X-Remove-Account-Meta-Book:
x
. The operation ignores the arbitrary
value.
If the container already has other custom metadata items, a request to create, update, or delete metadata does not affect those items.
This operation does not accept a request body.
Example requests and responses:
Create account metadata:
curl -i
$publicURL -X POST -H "X-Auth-Token:
$token" -H "X-Account-Meta-Book: MobyDick"
-H "X-Account-Meta-Subject:
Literature"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx8c2dd6aee35442a4a5646-0052d954fb Date: Fri, 17 Jan 2014 16:06:19 GMT
Update account metadata:
curl -i
$publicURL -X POST -H "X-Auth-Token:
$token" -H "X-Account-Meta-Subject:
AmericanLiterature"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx1439b96137364ab581156-0052d95532 Date: Fri, 17 Jan 2014 16:07:14 GMT
Delete account metadata:
curl -i
$publicURL -X POST -H "X-Auth-Token:
$token" -H "X-Remove-Account-Meta-Subject:
x"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx411cf57701424da99948a-0052d9556f Date: Fri, 17 Jan 2014 16:08:15 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
If the request succeeds, the operation returns the
To confirm your changes, issue a show account metadata request.
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token | header | xsd:string |
Authentication token. |
| X-Account-Meta-Temp-URL-Key (Optional) | header | xsd:string |
The secret key value for temporary URLs. |
| X-Account-Meta-Temp-URL-Key-2 (Optional) | header | xsd:string |
A second secret key value for temporary URLs. The second key enables you to rotate keys by having an old and new key active at the same time. |
| X-Account-Meta-{name} (Optional) | header | xsd:string |
The account metadata. The You must specify a |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| Content-Type | header | xsd:string |
If the operation fails, this value is the MIME type of the error text in the response body. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Shows metadata for a specified account.
Metadata for the account includes:
Number of containers
Number of objects
Total number of bytes that are stored in Object Storage for the account
Because the storage system can store large amounts of data, take care when you represent the total bytes response as an integer; when possible, convert it to a 64-bit unsigned integer if your platform supports that primitive type.
This operation does not accept a request body.
Do not include metadata headers in this request.
Show account metadata request:
curl -i $publicURL -X
HEAD -H "X-Auth-Token: $token"
HTTP/1.1 204 No Content Content-Length: 0 X-Account-Object-Count: 1 X-Account-Meta-Book: MobyDick X-Timestamp:<PHONE_NUMBER>.35964 X-Account-Bytes-Used: 14 X-Account-Container-Count: 2 Content-Type: text/plain; charset=utf-8 Accept-Ranges: bytes X-Trans-Id: txafb3504870144b8ca40f7-0052d955d4 Date: Fri, 17 Jan 2014 16:09:56 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
If the account or authentication token is not valid,
the operation returns the
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token | header | xsd:string |
Authentication token. |
| X-Newest (Optional) | header | xsd:boolean |
If set to
|
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Account-Object-Count | header | xsd:int |
The number of objects in the account. |
| X-Account-Container-Count | header | xsd:int |
The number of containers. |
| X-Account-Bytes-Used | header | xsd:int |
The total number of bytes that are stored in Object Storage for the account. |
| X-Account-Meta-{name} (Optional) | header | xsd:string |
The custom account metadata item, where
One |
| X-Account-Meta-Temp-URL-Key (Optional) | header | xsd:string |
The secret key value for temporary URLs. If not set, this header is not returned by this operation. |
| X-Account-Meta-Temp-URL-Key-2 (Optional) | header | xsd:string |
A second secret key value for temporary URLs. If not set, this header is not returned by this operation. |
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| Content-Type | header | xsd:string |
If the operation fails, this value is the MIME type of the error text in the response body. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
List objects in a specified container. Create, show details for, and delete containers. Create, update, show, and delete container metadata.
Shows details for a specified container and lists objects, sorted by name, in the container.
Specify query parameters in the request to filter
the list and return a subset of object names. Omit
query parameters to return the complete list of object
names that are stored in the container, up to 10,000
names. The 10,000 maximum value is configurable. To
view the value for the cluster, issue a
/info
request.
Example requests and responses:
Show container details for and list objects
in the marktwain
container, and
ask for a JSON
response:
curl -i
$publicURL/marktwain?format=json -X GET -H
"X-Auth-Token: $token"
Show container details for and list objects
in the marktwain
container, and
ask for an XML
response:
curl -i
$publicURL/marktwain?format=xml -X GET -H
"X-Auth-Token: $token"
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
If you use query parameters to page through a long
list of objects, you have reached the end of the list
if the number of items in the returned list is less
than the request limit
value. The list
contains more items if the number of items in the
returned list equals the limit
value.
If the request succeeds, the operation returns one of these status codes:
marker
, limit
,
or end_marker
query parameters,
and you have reached the end of the
list.
If the container does not exist, the
| Parameter | Style | Type | Description |
|---|---|---|---|
| limit (Optional) | query | xsd:int |
For an integer value
|
| marker (Optional) | query | xsd:string |
For a string value
|
| end_marker (Optional) | query | xsd:string |
For a string value
|
| prefix (Optional) | query | xsd:string |
Prefix value. Object names in the response begin with this value. |
| format (Optional) | query | xsd:string |
The response format. Valid values are
If you append the If you append the |
| delimiter (Optional) | query | xsd:char |
Delimiter value, which returns the object names that are nested in the container. |
| path (Optional) | query | xsd:string |
For a string value, returns the object names that are nested
in the pseudo path. Equivalent to setting delimiter to |
| X-Auth-Token | header | xsd:string |
Authentication token. |
| Accept (Optional) | header | xsd:string |
Instead of using the |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
The length of the response body that contains the list of names. If the operation fails, this value is the length of the error text in the response body. |
| X-Container-Object-Count | header | xsd:int |
The number of objects. |
| Accept-Ranges | header | xsd:string |
The type of ranges that the object accepts. |
| X-Container-Meta-{name} | header | xsd:string |
The custom container metadata item, where
One |
| X-Container-Bytes-Used | header | xsd:int |
The count of bytes used in total. |
| Content-Type | header | xsd:string |
The MIME type of the list of names. If the operation fails, this value is the MIME type of the error text in the response body. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
| name | plain | xsd:string |
The name of the container. |
| hash | plain | xsd:string |
The MD5 checksum value of the object content. |
| bytes | plain | xsd:int |
The total number of bytes that are stored in Object Storage for the account. |
| content_type | plain | xsd:string |
The content type of the object. |
| last_modified | plain | xsd:datetime |
The date and time when the object was last modified. |
HTTP/1.1 200 OK Content-Length: 341 X-Container-Object-Count: 2 Accept-Ranges: bytes X-Container-Meta-Book: TomSawyer X-Timestamp:<PHONE_NUMBER>.65372 X-Container-Bytes-Used: 26 Content-Type: application/json; charset=utf-8 X-Trans-Id: tx26377fe5fab74869825d1-0052d6bdff Date: Wed, 15 Jan 2014 16:57:35 GMT
[ { "hash":"451e372e48e0f6b1114fa0724aa79fa1", "last_modified":"2014-01-15T16:41:49.390270", "bytes":14, "name":"goodbye", "content_type":"application/octet-stream" }, { "hash":"ed076287532e86365e841e92bfc50d8c", "last_modified":"2014-01-15T16:37:43.427570", "bytes":12, "name":"helloworld", "content_type":"application/octet-stream" } ]
HTTP/1.1 200 OK Content-Length: 500 X-Container-Object-Count: 2 Accept-Ranges: bytes X-Container-Meta-Book: TomSawyer X-Timestamp:<PHONE_NUMBER>.65372 X-Container-Bytes-Used: 26 Content-Type: application/xml; charset=utf-8 X-Trans-Id: txc75ea9a6e66f47d79e0c5-0052d6be76 Date: Wed, 15 Jan 2014 16:59:35 GMT
<?xml version="1.0" encoding="UTF-8"?> <container name="marktwain"> <object> <name>goodbye</name> <hash>451e372e48e0f6b1114fa0724aa79fa1</hash> <bytes>14</bytes> <content_type>application/octet-stream</content_type> <last_modified>2014-01-15T16:41:49.390270</last_modified> </object> <object> <name>helloworld</name> <hash>ed076287532e86365e841e92bfc50d8c</hash> <bytes>12</bytes> <content_type>application/octet-stream</content_type> <last_modified>2014-01-15T16:37:43.427570</last_modified> </object> </container>
Creates a container.
You do not need to check if a container already
exists before issuing a
Example requests and responses:
Create a container with no metadata:
curl -i $publicURL/steven -X PUT -H
"Content-Length: 0" -H "X-Auth-Token:
$token"
HTTP/1.1 201 Created Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx7f6b7fa09bc2443a94df0-0052d58b56 Date: Tue, 14 Jan 2014 19:09:10 GMT
Create a container with metadata:
curl -i
$publicURL/marktwain -X PUT -H
"X-Auth-Token: $token" -H
"X-Container-Meta-Book:
TomSawyer"
HTTP/1.1 201 Created Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx06021f10fc8642b2901e7-0052d58f37 Date: Tue, 14 Jan 2014 19:25:43 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token | header | xsd:string |
Authentication token. |
| X-Container-Read (Optional) | header | xsd:string |
Sets an ACL that grants read access. |
| X-Container-Write (Optional) | header | xsd:string |
Sets an ACL that grants write access. |
| X-Container-Sync-To (Optional) | header | xsd:string |
Sets the destination for container synchronization. |
| X-Container-Sync-Key (Optional) | header | xsd:string |
Sets the secret key for container synchronization. |
| X-Versions-Location (Optional) | header | xsd:string |
Enables versioning on this container. The value is the name of another container. You must UTF-8-encode and then URL-encode the name before you include it in the header. To disable versioning, set the header to an empty string. |
| X-Container-Meta-{name} (Optional) | header | xsd:string |
The container metadata, where You must specify a |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| Content-Type | header | xsd:string |
If the operation fails, this value is the MIME type of the error text in the response body. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Deletes an empty container.
This operation fails unless the container is empty. An empty container has no objects.
Delete the steven
container:
curl -i
$publicURL/steven -X DELETE -H "X-Auth-Token:
$token"
If the container does not exist, the response is:
HTTP/1.1 404 Not Found Content-Length: 70 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx4d728126b17b43b598bf7-0052d81e34 Date: Thu, 16 Jan 2014 18:00:20 GMT
If the container exists and the deletion succeeds, the response is:
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: txf76c375ebece4df19c84c-0052d81f14 Date: Thu, 16 Jan 2014 18:04:04 GMT
If the container exists but is not empty, the response is:
HTTP/1.1 409 Conflict Content-Length: 95 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx7782dc6a97b94a46956b5-0052d81f6b Date: Thu, 16 Jan 2014 18:05:31 GMT <html><h1>Conflict</h1><p>There was a conflict when trying to complete your request.</p></html>
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token | header | xsd:string |
Authentication token. |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| Content-Type | header | xsd:string |
If the operation fails, this value is the MIME type of the error text in the response body. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Creates, updates, or deletes custom metadata for a container.
To create, update, or delete a custom metadata item,
use the X-Container-Meta-{name}
header,
where {name}
is the name of the metadata
item.
Subsequent requests for the same key and value pair overwrite the previous value.
To delete container metadata, send an empty value
for that header, such as for the
X-Container-Meta-Book
header. If the
tool you use to communicate with Object Storage, such
as an older version of cURL, does not support empty
headers, send the
X-Remove-Container-Meta-{name}
:
X-Remove-Container-Meta-Book:
x
. The operation ignores the arbitrary
value.
If the container already has other custom metadata items, a request to create, update, or delete metadata does not affect those items.
This operation does not accept a request body.
Example requests and responses:
Create container metadata:
curl -i
$publicURL/marktwain -X POST -H
"X-Auth-Token: $token" -H
"X-Container-Meta-Author: MarkTwain" -H
"X-Container-Meta-Century:
Nineteenth"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx05dbd434c651429193139-0052d82635 Date: Thu, 16 Jan 2014 18:34:29 GMT
Update container metadata:
curl -i
$publicURL/marktwain -X POST -H
"X-Auth-Token: $token" -H
"X-Container-Meta-Author:
SamuelClemens"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: txe60c7314bf614bb39dfe4-0052d82653 Date: Thu, 16 Jan 2014 18:34:59 GMT
Delete container metadata:
curl -i
$publicURL/marktwain -X POST -H
"X-Auth-Token: $token" -H
"X-Remove-Container-Meta-Century:
x"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx7997e18da2a34a9e84ceb-0052d826d0 Date: Thu, 16 Jan 2014 18:37:04 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
If the request succeeds, the operation returns the
To confirm your changes, issue a show container metadata request.
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token | header | xsd:string |
Authentication token. |
| X-Container-Read (Optional) | header | xsd:string |
Sets an ACL that grants read access. |
| X-Remove-Container-{name} (Optional) | header | xsd:string |
Removes the metadata item named
|
| X-Container-Write (Optional) | header | xsd:string |
Sets an ACL that grants write access. |
| X-Container-Sync-To (Optional) | header | xsd:string |
Sets the destination for container synchronization. |
| X-Container-Sync-Key (Optional) | header | xsd:string |
Sets the secret key for container synchronization. |
| X-Versions-Location (Optional) | header | xsd:string |
Enables versioning on this container. The value is the name of another container. You must UTF-8-encode and then URL-encode the name before you include it in the header. To disable versioning, set the header to an empty string. |
| X-Remove-Versions-Location (Optional) | header | xsd:string |
Set to any value to disable versioning. |
| X-Container-Meta-{name} (Optional) | header | xsd:string |
The container metadata, where You must specify a |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| Content-Type | header | xsd:string |
If the operation fails, this value is the MIME type of the error text in the response body. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Shows container metadata, including the number of objects and the total bytes of all objects stored in the container.
Show container metadata request:
curl -i
$publicURL/marktwain -X HEAD -H "X-Auth-Token:
$token"
HTTP/1.1 204 No Content Content-Length: 0 X-Container-Object-Count: 1 Accept-Ranges: bytes X-Container-Meta-Book: TomSawyer X-Timestamp:<PHONE_NUMBER>.65372 X-Container-Meta-Author: SamuelClemens X-Container-Bytes-Used: 14 Content-Type: text/plain; charset=utf-8 X-Trans-Id: tx0287b982a268461b9ec14-0052d826e2 Date: Thu, 16 Jan 2014 18:37:22 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
If the request succeeds, the operation returns the
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token (Optional) | header | xsd:string |
Authentication token. If you omit this header, your request fails unless the account owner has granted you access through an access control list (ACL). |
| X-Newest (Optional) | header | xsd:boolean |
If set to
|
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| X-Container-Object-Count | header | xsd:int |
The number of objects. |
| Accept-Ranges | header | xsd:string |
The type of ranges that the object accepts. |
| X-Container-Meta-{name} | header | xsd:string |
The custom container metadata item, where
One |
| X-Container-Bytes-Used | header | xsd:int |
The count of bytes used in total. |
| X-Container-Read (Optional) | header | xsd:string |
The ACL that grants read access. If not set, this header is not returned by this operation. |
| X-Container-Write (Optional) | header | xsd:string |
The ACL that grants write access. If not set, this header is not returned by this operation. |
| X-Container-Sync-To (Optional) | header | xsd:string |
The destination for container synchronization. If not set, this header is not returned by this operation. |
| X-Container-Sync-Key (Optional) | header | xsd:string |
The secret key for container synchronization. If not set, this header is not returned by this operation. |
| X-Versions-Location | header | xsd:string |
Enables versioning on this container. The value is the name of another container. You must UTF-8-encode and then URL-encode the name before you include it in the header. To disable versioning, set the header to an empty string. |
| Content-Type | header | xsd:string |
If the operation fails, this value is the MIME type of the error text in the response body. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Creates, replaces, Show details for, and deletes objects. Copies objects with another object with a new or different name. Updates object metadata.
Downloads the object content and gets the object metadata.
This operation returns the object metadata in the response headers and the object content in the response body.
If this is a large object, the response body
contains the concatenated content of the segment
objects. To get the manifest instead of concatenated
segment objects for a static large object, use the
multipart-manifest
query
parameter.
Example requests and responses:
Show object details for the
goodbye
object in the
marktwain
container:
curl -i $publicURL/marktwain/goodbye
-X GET -H "X-Auth-Token:
$token"
HTTP/1.1 200 OK Content-Length: 14 Accept-Ranges: bytes Last-Modified: Wed, 15 Jan 2014 16:41:49 GMT Etag: 451e372e48e0f6b1114fa0724aa79fa1 X-Timestamp:<PHONE_NUMBER>.39027 X-Object-Meta-Orig-Filename: goodbyeworld.txt Content-Type: application/octet-stream X-Trans-Id: tx8145a190241f4cf6b05f5-0052d82a34 Date: Thu, 16 Jan 2014 18:51:32 GMT Goodbye World!
Show object details for the
goodbye
object, which does
not exist, in the janeausten
container:
curl -i
$publicURL/janeausten/goodbye -X GET -H
"X-Auth-Token: $token"
HTTP/1.1 404 Not Found Content-Length: 70 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx073f7cbb850c4c99934b9-0052d82b04 Date: Thu, 16 Jan 2014 18:55:00 GMT <html><h1>Not Found</h1><p>The resource could not be found.</p></html>
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token (Optional) | header | xsd:string |
Authentication token. If you omit this header, your request fails unless the account owner has granted you access through an access control list (ACL). |
| X-Newest (Optional) | header | xsd:boolean |
If set to
|
| signature (Optional) | query | xsd:string |
Used with temporary URLs to sign the request. For
more information about temporary URLs, see
|
| expires (Optional) | query | xsd:string |
Used with temporary URLs to specify the expiry time of the signature. For
more information about temporary URLs, see
|
| multipart-manifest (Optional) | query | xsd:string |
If you include the |
| Range (Optional) | header | xsd:dict |
The ranges of content to get. You can use the The types of range specifications are:
The following forms of the header specify the following ranges of data:
|
| If-Match (Optional) | header | xsd:dict | |
| If-None-Match (Optional) | header | xsd:dict | |
| If-Modified-Since (Optional) | header | xsd:dict | |
| If-Unmodified-Since (Optional) | header | xsd:dict |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
The length of the object content in the response body, in bytes. |
| Accept-Ranges | header | xsd:string |
The type of ranges that the object accepts. |
| Last-Modified | header | xsd:string |
The date and time that the object was created or the last time that the metadata was changed. |
| ETag | header | xsd:string |
For objects smaller than 5 GB, this value is the MD5 checksum of the object content. The value is not quoted. For manifest objects, this value is the MD5 checksum of the concatenated string of MD5 checksums and ETags for each of the segments in the manifest, and not the MD5 checksum of the content that was downloaded. Also the value is enclosed in double-quote characters. You are strongly recommended to compute the MD5 checksum of the response body as it is received and compare this value with the one in the ETag header. If they differ, the content was corrupted, so retry the operation. |
| Content-Type | header | xsd:string |
The MIME type of the object. |
| Content-Encoding (Optional) | header | xsd:string |
If set, the value of the
If not set, this header is not returned by this operation. |
| Content-Disposition (Optional) | header | xsd:string |
If set, specifies the override behavior for the browser. For example, this header might specify that the browser use a download program to save this file rather than show the file, which is the default. If not set, this header is not returned by this operation. |
| X-Delete-At (Optional) | header | xsd:string |
If set, the time when the object will be deleted by the system in the format of a UNIX Epoch timestamp. If not set, this header is not returned by this operation. |
| X-Object-Meta-{name} | header | xsd:string |
The custom object metadata item, where
One |
| X-Object-Manifest (Optional) | header | xsd:string |
If set, to this is a dynamic large object manifest object.
The value is the container and object name prefix of the segment objects
in the form |
| X-Static-Large-Object | header | xsd:bool |
Set to |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Creates a new object with specified data content and metadata, or replaces an existing object with specified data content and metadata.
The
201 Created
status code.
If you use this operation to copy a manifest object,
the new object is a normal object and not a copy of
the manifest. Instead it is a concatenation of all the
segment objects. This means that you cannot copy
objects larger than 5 GB in size. All metadata is
preserved during the object copy. If you specify
metadata on the request to copy the object, either
Example requests and responses:
Create object:
curl -i
$publicURL/janeausten/helloworld.txt -X
PUT -H "Content-Length: 1" -H
"Content-Type: text/html; charset=UTF-8"
-H "X-Auth-Token: $token"
HTTP/1.1 201 Created Last-Modified: Fri, 17 Jan 2014 17:28:35 GMT Content-Length: 116 Etag: d41d8cd98f00b204e9800998ecf8427e Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx4d5e4f06d357462bb732f-0052d96843 Date: Fri, 17 Jan 2014 17:28:35 GMT
Replace object:
curl
-i $publicURL/janeausten/helloworld -X PUT
-H "Content-Length: 0" -H "X-Auth-Token:
$token"
HTTP/1.1 201 Created Last-Modified: Fri, 17 Jan 2014 17:28:35 GMT Content-Length: 116 Etag: d41d8cd98f00b204e9800998ecf8427e Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx4d5e4f06d357462bb732f-0052d96843 Date: Fri, 17 Jan 2014 17:28:35 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
The 201 Created
status code indicates a
successful write.
If the request times out, the operation returns the
408 Request Timeout
error
code.
The 411 Length Required
error code
indicates a missing Transfer-Encoding
or
Content-Length
request header.
If the MD5 checksum of the data that is written to
the object store does not match the optional
ETag
value, the operation returns the
422 Unprocessable Entity
error
code.
| Parameter | Style | Type | Description |
|---|---|---|---|
| multipart-manifest (Optional) | query | xsd:string |
If |
| signature (Optional) | query | xsd:string |
Used with temporary URLs to sign the request. For
more information about temporary URLs, see
|
| expires (Optional) | query | xsd:string |
Used with temporary URLs to specify the expiry time of the signature. For
more information about temporary URLs, see
|
| X-Object-Manifest (Optional) | header | xsd:string |
Set to specify that this is a dynamic large object manifest object.
The value is the container and object name prefix of the segment objects
in the form |
| X-Auth-Token (Optional) | header | xsd:string |
Authentication token. If you omit this header, your request fails unless the account owner has granted you access through an access control list (ACL). |
| Content-Length (Optional) | header | xsd:int |
Set to the length of the object content. Do not set if chunked transfer encoding is being used. |
| Transfer-Encoding (Optional) | header | xsd:string |
Set to |
| Content-Type (Optional) | header | xsd:string |
Changes the MIME type for the object. |
| X-Copy-From (Optional) | header | xsd:string |
If set, this is the name of an object used to create the
new object by copying the Using
|
| ETag (Optional) | header | xsd:string |
The MD5 checksum value of the request body. For example, the MD5 checksum value of the object content. You are strongly recommended to compute the MD5 checksum value of object content and include it in the request. This enables the Object Storage API to check the integrity of the upload. The value is not quoted. |
| Content-Disposition (Optional) | header | xsd:string |
If set, specifies the override behavior for the browser. For example, this header might specify that the browser use a download program to save this file rather than show the file, which is the default. |
| Content-Encoding (Optional) | header | xsd:string |
If set, the value of the
|
| X-Delete-At (Optional) | header | xsd:int |
The certain date, in the format of a UNIX Epoch timestamp, when the object is removed. |
| X-Delete-After (Optional) | header | xsd:int |
Specifies the number of seconds after which the
object is removed. Internally, the Object Storage system
stores this value in the |
| X-Object-Meta-{name} (Optional) | header | xsd:string |
The container metadata, where You must specify a |
| Parameter | Style | Type | Description |
|---|---|---|---|
| last_modified | plain | xsd:datetime |
The date and time when the object was last modified. |
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| ETag | header | xsd:string |
For objects smaller than 5 GB, this value is the MD5 checksum of the uploaded object content. The value is not quoted. If you supplied an If you did not supply an For static large objects, this value is the MD5 checksum of the concatenated string of MD5 checksums and ETags for each of the segments in the manifest, and not the MD5 checksum of the content that was uploaded. Also the value is enclosed in double-quotes. For dynamic large objects, the value is the MD5 checksum of the empty string. |
| Content-Type | header | xsd:string |
The MIME type of the object. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Copies an object to another object in the object store.
The new object can be in the same container, but have a different name from the original object. Or, the new object can have the same or a different name and be located in a different container than the original object.
Alternatively, you can use
X-Copy-From
request header to
accomplish the same operation as the
The
201 Created
success
node.
If you use this operation to copy a manifest object,
the new object is a normal object and not a copy of
the manifest. Instead it is a concatenation of all the
segment objects. This means that you cannot copy
objects larger than 5 GB in size. All metadata is
preserved during the object copy. If you specify
metadata on the request to copy the object, either
Example requests and responses:
Copy the goodbye
object
from the marktwain
container to
the janeausten
container:
curl -i $publicURL/marktwain/goodbye
-X COPY -H "X-Auth-Token: $token" -H
"Destination: janeausten/goodbye"
HTTP/1.1 201 Created Content-Length: 0 X-Copied-From-Last-Modified: Thu, 16 Jan 2014 21:19:45 GMT X-Copied-From: marktwain/goodbye Last-Modified: Fri, 17 Jan 2014 18:22:57 GMT Etag: 451e372e48e0f6b1114fa0724aa79fa1 Content-Type: text/html; charset=UTF-8 X-Object-Meta-Movie: AmericanPie X-Trans-Id: txdcb481ad49d24e9a81107-0052d97501 Date: Fri, 17 Jan 2014 18:22:57 GMT
Alternatively, you can use
goodbye
object from the
marktwain
container to the
janeausten
container. This
request requires a Content-Length
header even if it is set to zero (0).
curl -i $publicURL/janeausten/goodbye
-X PUT -H "X-Auth-Token: $token" -H
"X-Copy-From: /marktwain/goodbye" -H
"Content-Length: 0"
HTTP/1.1 201 Created Content-Length: 0 X-Copied-From-Last-Modified: Thu, 16 Jan 2014 21:19:45 GMT X-Copied-From: marktwain/goodbye Last-Modified: Fri, 17 Jan 2014 18:22:57 GMT Etag: 451e372e48e0f6b1114fa0724aa79fa1 Content-Type: text/html; charset=UTF-8 X-Object-Meta-Movie: AmericanPie X-Trans-Id: txdcb481ad49d24e9a81107-0052d97501 Date: Fri, 17 Jan 2014 18:22:57 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token (Optional) | header | xsd:string |
Authentication token. If you omit this header, your request fails unless the account owner has granted you access through an access control list (ACL). |
| Destination | header | xsd:string |
The container and object name of the destination
object in the form of |
| Content-Type (Optional) | header | xsd:string |
Changes the MIME type for the object. |
| Content-Encoding (Optional) | header | xsd:string |
If set, the value of the
|
| Content-Disposition (Optional) | header | xsd:string |
If set, specifies the override behavior for the browser. For example, this header might specify that the browser use a download program to save this file rather than show the file, which is the default. |
| X-Object-Meta-{name} (Optional) | header | xsd:string |
The container metadata, where You must specify a |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| X-Copied-From-Last-Modified (Optional) | header | xsd:string |
For a copied object, shows the last modified date and time for the container and object name from which the new object was copied. |
| X-Copied-From (Optional) | header | xsd:string |
For a copied object, shows the container and object name from which the new object was copied.
The value is in form |
| Last-Modified | header | xsd:string |
The date and time that the object was created or the last time that the metadata was changed. |
| ETag | header | xsd:string |
The MD5 checksum of the copied object content. The value is not quoted. |
| Content-Type | header | xsd:string |
The MIME type of the object. |
| X-Object-Meta-{name} | header | xsd:string |
The custom object metadata item, where
One |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Permanently deletes an object from the object store.
You can use the
Object deletion occurs immediately at request time.
Any subsequent
404 Not Found
error
code.
For static large object manifests, you can add the
?multipart-manifest=delete
query
parameter.
Example request and response:
Delete the
helloworld
object from the
marktwain
container:
curl -i
$publicURL/marktwain/helloworld -X DELETE
-H "X-Auth-Token: $token"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx36c7606fcd1843f59167c-0052d6fdac Date: Wed, 15 Jan 2014 21:29:16 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
Normally the
multipart-manifest=delete
query
parameter, the response body contains a list of
manifest and segment objects and the status of their
delete operations.
| Parameter | Style | Type | Description |
|---|---|---|---|
| multipart-manifest (Optional) | query | xsd:string |
If you include the
For a bulk delete, the response body looks the same as
it does for a normal bulk delete. In contrast, a plain
object
|
| X-Auth-Token (Optional) | header | xsd:string |
Authentication token. If you omit this header, your request fails unless the account owner has granted you access through an access control list (ACL). |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| Content-Type | header | xsd:string |
The MIME type of the object. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Shows object metadata.
If the Content-Length
response header
is non-zero, the example cURL command stalls after it
prints the response headers because it is waiting for
a response body. However, the Object Storage system
does not return a response body for the
Example requests and responses:
Show object metadata:
curl -i
$publicURL/marktwain/goodbye -X HEAD -H
"X-Auth-Token: $token"
HTTP/1.1 200 OK Content-Length: 14 Accept-Ranges: bytes Last-Modified: Thu, 16 Jan 2014 21:12:31 GMT Etag: 451e372e48e0f6b1114fa0724aa79fa1 X-Timestamp:<PHONE_NUMBER>.73463 X-Object-Meta-Book: GoodbyeColumbus Content-Type: application/octet-stream X-Trans-Id: tx37ea34dcd1ed48ca9bc7d-0052d84b6f Date: Thu, 16 Jan 2014 21:13:19 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
If the request succeeds, the operation returns the
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token | header | xsd:string |
Authentication token. |
| signature (Optional) | query | xsd:string |
Used with temporary URLs to sign the request. For
more information about temporary URLs, see
|
| expires (Optional) | query | xsd:string |
Used with temporary URLs to specify the expiry time of the signature. For
more information about temporary URLs, see
|
| X-Newest (Optional) | header | xsd:boolean |
If set to
|
| Parameter | Style | Type | Description |
|---|---|---|---|
| Last-Modified | header | xsd:string |
The date and time that the object was created or the last time that the metadata was changed. |
| Content-Length | header | xsd:string |
The length of the object content in the response body, in bytes. |
| Content-Length | header | xsd:string |
|
| Content-Type | header | xsd:string |
The MIME type of the object. |
| ETag | header | xsd:string |
For objects smaller than 5 GB, this value is the MD5 checksum of the object content. The value is not quoted. For manifest objects, this value is the MD5 checksum of the concatenated string of MD5 checksums and ETags for each of the segments in the manifest, and not the MD5 checksum of the content that was downloaded. Also the value is enclosed in double-quote characters. You are strongly recommended to compute the MD5 checksum of the response body as it is received and compare this value with the one in the ETag header. If they differ, the content was corrupted, so retry the operation. |
| Content-Encoding (Optional) | header | xsd:string |
If set, the value of the
If not set, this header is not returned by this operation. |
| Content-Disposition (Optional) | header | xsd:string |
If set, specifies the override behavior for the browser. For example, this header might specify that the browser use a download program to save this file rather than show the file, which is the default. If not set, this header is not returned by this operation. |
| X-Delete-At (Optional) | header | xsd:string |
If set, the time when the object will be deleted by the system in the format of a UNIX Epoch timestamp. If not set, this header is not returned by this operation. |
| X-Object-Manifest (Optional) | header | xsd:string |
If set, to this is a dynamic large object manifest object.
The value is the container and object name prefix of the segment objects
in the form |
| X-Object-Meta-{name} | header | xsd:string |
The custom object metadata item, where
One |
| X-Static-Large-Object | header | xsd:bool |
Set to |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Creates or updates object metadata.
To create or update custom metadata, use the
X-Object-Meta-{name}
header, where
{name}
is the name of the metadata
item.
In addition to the custom metadata, you can also
update these system metadata items:
Content-Type
Content-Encoiding
Content-Disposition
X-Delete-At
. However you cannot update
other system metadata such as
Content-Length
or
Last-Modified
.
A
You can also set the X-Delete-At
or
X-Delete-After
header to define when
to expire the object.
When used as described in this section, the
Example requests and responses:
Create object metadata:
curl -i
$publicURL/marktwain/goodbye -X POST -H
"X-Auth-Token: $token" -H
"X-Object-Meta-Book:
GoodbyeColumbus"
HTTP/1.1 202 Accepted Content-Length: 76 Content-Type: text/html; charset=UTF-8 X-Trans-Id: txb5fb5c91ba1f4f37bb648-0052d84b3f Date: Thu, 16 Jan 2014 21:12:31 GMT <html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>
Update object metadata:
curl -i
$publicURL/marktwain/goodbye -X POST -H
"X-Auth-Token: $token" -H
"X-Object-Meta-Book:
GoodbyeOldFriend"
HTTP/1.1 202 Accepted Content-Length: 76 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx5ec7ab81cdb34ced887c8-0052d84ca4 Date: Thu, 16 Jan 2014 21:18:28 GMT <html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Auth-Token (Optional) | header | xsd:string |
Authentication token. If you omit this header, your request fails unless the account owner has granted you access through an access control list (ACL). |
| X-Object-Meta-{name} (Optional) | header | xsd:string |
The container metadata, where You must specify a |
| X-Delete-At (Optional) | header | xsd:int |
The certain date, in the format of a UNIX Epoch timestamp, when the object is removed. |
| Content-Disposition (Optional) | header | xsd:string |
If set, specifies the override behavior for the browser. For example, this header might specify that the browser use a download program to save this file rather than show the file, which is the default. |
| Content-Encoding (Optional) | header | xsd:string |
If set, the value of the
|
| X-Delete-After (Optional) | header | xsd:int |
Specifies the number of seconds after which the
object is removed. Internally, the Object Storage system
stores this value in the |
| Content-Type (Optional) | header | xsd:string |
Changes the MIME type for the object. |
| Parameter | Style | Type | Description |
|---|---|---|---|
| Content-Length | header | xsd:string |
If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| Content-Type | header | xsd:string |
The MIME type of the object. |
| X-Trans-Id | header | csapi:uuid |
A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Date | header | xsd:datetime |
The transaction date and time. |
This operation does not return a response body.
Manage CDN-enabled containers.
Enables or disables a container for use with the CDN.
publicURL
noted in the
service catalog for Cloud Files during Authentication and
set the X-CDN-Enabled
header to
True
.
cloudfilesCDN
.
When a container is CDN-enabled, any objects stored in
it are publicly accessible over the content delivery network
by combining the container's CDN URI with the object name
(X-Cdn-Uri/
).
The examples in this guide use
cdn.clouddrive.com
for an endpoint for
operations against the CDN management service, but you
should use whatever your authentication request provides.
For more information about your authentication request,
see
Any CDN-accessed objects are cached in the CDN for a specified amount of time called the Time To Live (TTL). Each time the object is accessed after the TTL expires, the CDN refetches and caches the object for the next TTL period.
You can specify the TTL for an object by including the
HTTP header X-TTL:
.
Setting the TTL is the same as setting the HTTP
Expires
and Cache-Control
headers for the cached object. The minimum TTL is 15 minutes
(900 seconds), and the maximum is 50 years for a range of 900
to<PHONE_NUMBER> seconds. However, setting a TTL for a long
time does not guarantee that the content stays populated on
CDN edge servers for the entire period. The most popular
objects stay cached based on the edge location's logic.
On August 13, 2012, the maximum TTL was set to 31536000 (one year). If you set new TTL values to a greater time frame, your object still expires at the one-year mark. However, if you already had a greater TTL value set on an object, it will expire at the time you originally set.
A status code of 201 (Created) indicates that the container was CDN-enabled as requested. If the container is already CDN-enabled, a 202 (Accepted) status code is returned, and the TTL is adjusted. A status code of 204 (No Content) indicates the container was CDN-enabled as requested, but has no content.
This operation does not require a request body and does not return a response body.
In order to remove the container from the CDN, change the X-Cdn-Enabled
header to False
, as in the request below. However, note that objects remain on the CDN edge server and are served to the public until their
TTL expires.
The CDN URI is unique per container. After the container is CDN-enabled, you can make a
X-Cdn-Uri
header. You can use a cURL request similar to the following example:
curl -I -H 'x-auth-token: yourAuthToken' cloudFilesCDN:yourPublicURL/yourContainerName
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Ttl (Optional) | header | xsd:int |
Specifies the Time To Live in seconds for an object to be cached in the CDN. The default value is 259200 seconds, or 72 hours. |
| X-Cdn-Enabled (Optional) | header | xsd:string |
Indicates if a container is CDN-enabled. Valid values are True and False. |
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Cdn-Uri (Optional) | header | xsd:int |
Indicates the URI that you can combine with object names to serve objects through the CDN. |
UT /v1/MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123/MyContainer HTTP/ 1.1 Host: cdn.clouddrive.com X-Auth-Token: f064c46a782c444cb4ba4b6434288f7c X-Ttl: 259200 X-Cdn-Enabled: True
PUT /v1/MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123/MyContainer HTTP/1.1 Host: cdn.clouddrive.com X-Auth-Token: f064c46a782c444cb4ba4b6434288f7c X-CDN-Enabled: False
HTTP/1.1 204 No Content X-Cdn-Ssl-Uri: https:// 83c49b9a2f7ad18250b3-346eb45fd42c58ca13011d659bfc1ac1. ssl.cf0.rackcdn.com X-Ttl: 259200 X-Cdn-Uri: http://081e40d3ee1cec5f77bf-346eb45fd42c58ca13011d659bfc1ac1. r49.cf0.rackcdn.com X-Cdn-Enabled: True X-Log-Retention: False X-Cdn-Streaming-Uri: http:// 084cc2790632ccee0a12-346eb45fd42c58ca13011d659bfc1ac1. r49.stream.cf0.rackcdn. com X-Trans-Id: tx82a6752e00424edb9c46fa2573132e2c Content-Length: 0
Gets a CDN-enabled container's metadata.
You can view CDN-enabled container details by performing
a
Host
header value is one of the
cdnCloudFiles
service access endpoints. (For
a list of the endpoints, see
If the container is (or ever has been) CDN-enabled, the metadata is returned in headers in the response for plain text, or in the response body for XML or JSON, if you request either as your output format.
Remember that your
cdn.clouddrive.com
). Otherwise, you will
see the metadata for your private container as described
in
A 204 (No Content) HTTP status code is returned if the account has no containers. Otherwise, status code of 200 (OK) is returned.
| Parameter | Style | Type | Description |
|---|---|---|---|
| format (Optional) | query | xsd:string |
The optional format the returned information. Either XML or JSON. |
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Cdn-Uri | header | xsd:string |
The URI for downloading the object over HTTP. This URI can be combined with any object name within the container to form the publicly accessible URI for that object for distribution over a CDN system. |
| X-Ttl | header | xsd:int |
The TTL value in seconds. The minimum TTL is 15 minutes (or 900 seconds), and the maximum is 50 years<PHONE_NUMBER> seconds). |
| X-Cdn-Enabled | header | xsd:boolean |
True or False to indicate whether the container is currently marked to allow public serving of objects through CDN |
| X-Log-Retention | header | xsd:boolean |
True or False to indicate whether the CDN access logs should be collected and stored in the Cloud Files storage system. |
| X-Cdn-Ssl-Uri | header | xsd:string |
The URI for downloading the object over HTTPS, using SSL. (The user cannot have custom SSL certificates because our CDN partner does not provide that feature. |
| X-Cdn-Streaming-Uri | header | xsd:string |
The URI for video streaming that uses Adobe’s HTTP Dynamic Streaming. |
| X-Cdn-Ios-Uri | header | xsd:string |
The URI for video streaming that uses Apple’s HTTP Live Streaming. |
HEAD /v1/MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123/MyContainer?format=json Host: cdn.clouddrive.com X-Auth-Token: f064c46a782c444cb4ba4b6434288f7c
HEAD /v1/MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123/MyContainer HTTP/1.1 Host: cdn.clouddrive.com X-Auth-Token: f064c46a782c444cb4ba4b6434288f7c
HEAD /v1/MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123/MyContainer?format=xml Host: cdn.clouddrive.com X-Auth-Token: f064c46a782c444cb4ba4b6434288f7c
HTTP/1.1 200 OK Date: Tue, 30 Oct 2012 17:57:28 GMT Content-Length: 267 Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <account name="WidgetsRUs.button"> <container> <name>images</name> <cdn_enabled>True</cdn_enabled> <ttl>86400</ttl> <log_retention>True</log_retention> <cdn_url> http://80745c48926cd286a5a0-48261ebe0e4c795a565ece6b9cca2fe8.r10. cf1.rackcdn.com </cdn_url> <cdn_ssl_url> https://83c49b9a2f7ad18250b3-346eb45fd42c58ca13011d659bfc1ac1.ssl. stg2.rackcdn.com </cdn_ssl_url> <cdn_streaming_url> http://084cc2790632ccee0a12-346eb45fd42c58ca13011d659bfc1ac1. r49. stream.cf0.rackcdn.com </cdn_streaming_url> </container> </account>H
HTTP/1.1 200 OK Date: Tue, 30 Oct 2012 14:41:29 GMT Content-Length: 127 Content-Type: application/json; charset=utf-8 [ {"name":"test_container", "cdn_enabled":"true", "ttl":28800, "log_retention":"true", "cdn_uri":"http://80745c48926cd286a5a0-48261ebe0e4c795a565ece6b9cca2fe8. r10.cf1.rackcdn.com", "cdn_ssl_uri":"https:// 83c49b9a2f7ad18250b3-346eb45fd42c58ca13011d659bfc1ac1.ssl.stg2.rackcdn.com", "cdn_streaming_uri":"http:// 80745c48926cd286a5a0-48261ebe0e4c795a565ece6b9cca2fe8.r10.cf1.rackcdn.com"} ]
Updates the CDN-enabled container metadata.
A
X-Log-Retention
X-Cdn-Enabled
X-Ttl
A status code of 204 (No Content) indicates success. Status code 404 (Not Found) is returned if the requested container is not found.
This operation does not require a request body and does not return a response body.
| Parameter | Style | Type | Description |
|---|---|---|---|
| X-Log-Retention (Optional) | header | xsd:Boolean |
|
| X-Cdn-Enabled (Optional) | header | xsd:Boolean |
|
| X-Ttl (Optional) | header | xsd:int |
The TTL value in seconds. The minimum TTL is 15 minutes (or 900 seconds), and the maximum is 50 years<PHONE_NUMBER> seconds). |
POST /v1/MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123/MyContainer HTTP/1.1 Host: cdn.clouddrive.com X-Auth-Token: f064c46a782c444cb4ba4b6434288f7c X-Ttl: 86400 X-Cdn-Enabled: True X-Log-Retention: True
HTTP/1.1 204 No Content X-Cdn-Ssl-Uri: https://83c49b9a2f7ad18250b3-346eb45fd42c58ca13011d659bfc1ac1.ssl.cf0.rackcdn.com X-Ttl: 259200 X-Cdn-Uri: http://081e40d3ee1cec5f77bf-346eb45fd42c58ca13011d659bfc1ac1.r49.cf0.rackcdn.com X-Cdn-Enabled: True X-Log-Retention: False X-Cdn-Streaming-Uri: http://084cc2790632ccee0a12-346eb45fd42c58ca13011d659bfc1ac1.r49.stream.cf0.rackcdn.com X-Trans-Id: tx82a6752e00424edb9c46fa2573132e2c Content-Length: 0
Manage CDN-enabled objects
Deletes CDN-enabled objects.
When you find it necessary to remove a CDN-enabled
object from public access before the TTL expires, you can
perform a
You should limit object purges to situations where there could be serious personal, business, or security consequences if it remained publicly accessible on the CDN (for example, when someone publishes your company's quarterly earnings too early).
Following are the ways you can purge objects from the CDN:
By using
You can manually purge CDN-enabled objects without
having to wait for the TTL to expire, and you can
optionally be notified by email that the object has
been purged. However, you can only
An attempt to delete more objects results in a 400
(Bad Request) status code with
X-Purge-Failed-Reason: You have the maximum
number of daily object purges
.
If there is already a purge request in progress
for an object, a 400 (Bad Request) status code is
returned with X-Purge-Failed-Reason: That object
is already in the queue to be purged
.
By creating a support ticket to purge an entire container
The 25-object limit does not apply when purging an entire container through Support.
To prevent the container from going back to the CDN,
first change the X-CDN-Enabled
flag to
False
as shown in
The system purges the object from the CDN and sends an email to the indicated address or addresses. If you want to notify more than one person about the deletion, you can enter a comma-separated list of addresses. The email address is optional.
A status code of 204 (No Content) indicates success. Status code 404 (Not Found) indicates that requested CDN-enabled object was not found. Status code 403 (Forbidden) indicates that an authorization problem occurred.
The CDN URI is returned in the HTTP header
X-Cdn-Uri
.
Purging objects may take a long time because there are so many edge servers around the globe. Please be patient while waiting for a response.
DELETE /v1/MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123/MyContainer/MyObject HTTP/1.1 Host: cdn.clouddrive.com X-Auth-Token: f064c46a782c444cb4ba4b6434288f7c X-Purge-Email<EMAIL_ADDRESS><EMAIL_ADDRESS>HTTP/1.1 204 No Content Date: Thu, 13 Jan 2010 18:57:07 GMT X-Cdn-Uri: http://081e40d3ee1cec5f77bf-346eb45fd42c58ca13011d659bfc1ac1.r49.cf0.rackcdn.com Content-Length: 0 Content-Type: text/plain; charset=UTF-8


(.) patients CNS ASCT lymphoma primary CI, PCNSL central nervous transplantation rate PFS autologous cell chemotherapy undergone conditioning stem -year TBC .-. reported study Oncol (.-.) HDC/ASCT Reference using {border-style data Clin px;} relapse #ffffff;} high-dose SCNSL survival cyclophosphamide involvement secondary disease including lymphoma: SCNSL/CNS busulfan, thiotepa, High-dose Patients Table WBRT consolidation median patients, respectively. stem-cell therapy years Blood days followed regimen .%-.%) Lymphoma Median PCNSL, analysis induction phase radiotherapy relapsed (.%) .-.; NHL Transplant cycles etoposide, included patient patients. results thiotepa %-%) HR, IQR Survival busulfan cyclophosphamide, defined long-term patients; px; received studies trial vincristine, {font-family > CR. HD-MTX However, Illerhaus Karnofsky Marrow benefit compared complete efficacy font-size high lymphoma; neurotoxicity occurred patients) refractory treatment (IQR, .). ASCT, Autologous Data Leuk Relapse Soussain TRM conditioning. cytarabine, diagnosed double; doxorubicin, group intraocular months newly non-Hodgkin number rates toxicity whole-brain < (.%). (rituximab, .%-.%), A.J.M. ASCT. Abbreviations: BEAM Elsevier Ferreri Group Haematol Myeloma Value abnormalities border-color border-width carmustine centre consecutive consolidative cytarabine date developed dexamethasone, effects febrile follow-up given infection lymphoma. outcome platelet postremission promising randomized rescue results. score solid; status systemic trials used {font-style {font-weight (.%), (.%; (PCNSL) Age Ann CI) COVID- CR, Central Chen Intensive J.L. Kaplan-Meier Kasenda Overall Primary Progression-free Range Toxicity Transplantation Treatment age agents appears bold bone brain common compare conditioning, confidence courier; death diagnosis did electrolyte em; encouraging evaluated experience first-line function greater hematopoietic intrathecal large lymphoma, marrow mg/m mucositis, nonmyeloablative noted overall penetration performed poor present progression-free pt;} recovery regimens relapsed/refractory remission remission; resource retrospective rituximab, second shown significant statistically study, transplant treatment-related univariate use vs. years.


For Some Reason The Page You Requested Could Not Be Found On Our Server
Go back to the previous page or visit our homepage or try searching the site:


Call for Papers
GDG DevFest Ukraine 2014 will be held 24-25th of October in ancient city of Lviv. If you want to be part of this great event as a speaker you knocked at the good door.
Presenters – who should speak at the DevFest Conference?
developers (freelance and hired)
companies developing software (apps, tools, frameworks etc.)
research institutio... continue reading
Hello World!
We’re very excited - not just because of the inordinate amount of caffeine based products consumed -
but also because our team are putting together
the final missing parts to the biggest Google related event in Ukraine - GDG DevFest 2014.
This year event will take place in cultural capital of Ukraine - Lviv. Being a unique European city in Uk... continue reading


--- layout: post title: Let's REST! tags: [] status: publish type: post published: true meta: _edit_last: '1' ---
A bunch of links to RESTful resources I've collated here and there
Alex Barnett blog : Let's REST!
Alex Barnett has a list of REST resources discussing the good and the bad, the how and the why. Since I have an affinity to the Atom Publishing Protocol, all of these have been read and read again. All very valuable and will help shape your thinking about what REST really aspires to achieve and why it is the most misunderstood acronym this year.


The lispbuilder-windows package is a part of the Common Lisp Application Builder project which is in turn a part of the umbrella Common Lisp Gardeners project. The goal is to provide all Microsoft Windows API function, which are available for C programs when you include the standard windows.h header file.
The following table describes the status of the Lisp implementations that have been tested with lispbuilder-windows:
| Lisp Implementation | lispbuilder-windows Status | Comments |
| CLISP v2.38 | Working | |
| Lispworks v4.3.7 Professional | Working | |
| Allegro Trial Edition 7.0 | Unknown | |
| SBCL | Unknown | |
| CMUCL | Unknown |
The asdf.lisp and CFFI packages are required prior to the installation of lispbuilder-windows. The installation of these packages is descibed in the lispbuilder-sdl documentation.
Now you can start CLISP and enter the following at the prompt:
(pushnew "/programme/clisp-2.38/asdf/lispbuilder-windows/" asdf:*central-registry*) (asdf:operate 'asdf:load-op :lispbuilder-windows) (asdf:operate 'asdf:load-op :lispbuilder-windows-examples)
To verify that lispbuilder-windows is installed correctly, run one of the examples by entering:
(in-package :lispbuilder-windows-examples) (gui-eval)
You should see a window with a text field with "(timer)" and a button. When you click the "Eval" button, the text is evaluated as Lisp. "timer" is a predefined function for an animated timer like this:
There are three demo functions defined:
(defun hello () (clear) (draw-string 250 180 "Hello World!") (move-to 200 200) (line-to 390 200) (repaint)) (defun painter () (let ((is-down nil)) (install-mouse-down-handler #'(lambda (x y) (move-to x y) (setf is-down t))) (install-mouse-up-handler #'(lambda (x y) (declare (ignore x y)) (setf is-down nil))) (install-mouse-move-handler #'(lambda (x y) (when is-down (line-to x y) (repaint)))))) (defun timer () (set-font 200) (let ((start (get-internal-real-time))) (install-timer 100 #'(lambda () (let ((elapsed (- (get-internal-real-time) start))) (draw-string 100 100 (format nil "~a" (floor elapsed INTERNAL-TIME-UNITS-PER-SECOND))) (repaint))))))
You can enter your own Lisp code and execute it with the "eval" button, e.g.:
(message-box (format nil "~a"(loop for i from 1 to 10 collect i)))
All available functions:
All other Common Lisp functions are available, too and some Windows GDI functions.
If you don't want to install all the packages, like CLISP, ASDF, CFFI etc., then you can download a standalone binary distribution with CLISP integrated. Download the latest win32-gui-eval release from Sourceforge. You need the gui-eval.exe, only, but included is the delivery script and files, if you want to deliver your own applications.
The Common Lisp Application Builder project relies on SWIG
to create the CFFI bindings for Windows. Currently SWIG does not get us 100%
of the way with the header wrappers, there are a few things you need to change
in the Windows headers, see "windows.h", which is a small and modified
subset of all windows functions.
Run swig using and prepare to edit lots of the generated file:
swig -cffi winswig.i


Search
Preparing search index...
The search index is not available
kbotify
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
kbotify
ResultTypes
Enumeration ResultTypes
Index
Enumeration members
ERROR
FAIL
HELP
PENDING
SUCCESS
WRONG_
ARGS
Enumeration members
ERROR
ERROR
:
= "ERROR"
FAIL
FAIL
:
= "FAIL"
HELP
HELP
:
= "HELP"
PENDING
PENDING
:
= "PENDING"
SUCCESS
SUCCESS
:
= "SUCCESS"
WRONG_
ARGS
WRONG_
ARGS
:
= "WRONG_ARGS"
Exports
Result
Types
ERROR
FAIL
HELP
PENDING
SUCCESS
WRONG_
ARGS
App
Command
Base
Session
Base
User
Button
Event
Message
Card
Guild
Channel
Guild
Session
KBotify
Menu
Command
Private
Channel
Private
Session
Text
Message
App
Command
Params
Base
Data
Card
Object
Func
Result
Menu
Command
Params
Module
Object
Send
Options
App
Command
Func
App
Func
Channel
Theme
k
Botify
Logger
create
Session
init
Func
Result
Generated using
TypeDoc


Announcement of the nominees for 2020 Golden Globes begins
NEW YORK — “Fleabag," “The Marvelous Mrs. Maisel" and “ Chornobyl ” are among the first nominees announced for the the 77th annual Golden Globe Awards have begun.
by Canadian PressNEW YORK — “Fleabag," “The Marvelous Mrs. Maisel" and “Chornobyl” are among the first nominees announced for the the 77th annual Golden Globe Awards have begun. Dakota Fanning, Susan Kelechi Watson and Tim Allen are announcing the nominees for the Jan. 5 show, which honours achievements in film and television. Top categories will be announced around 8:15 a.m. Eastern on the “Today”show.
The nominees for best comedy TV series are: "Barry": Fleabag"; "The Kominsky Method"; “The Marvelous Mrs. Maisel”; "The Politician."
The nominees for best limited series or TV movie are: “Catch-22”; “Chornobyl”; “Fosse/Verdon”; “The Loudest Voice”; “Unbelievable.” The nominees for best actor in a television drama are: Brian Cox, “Succession”; Kit Harington, “Game of Thrones”; Rami Malek, “Mr. Robot”; Tobias Menzies, “The Crown”; Billy Porter, “Pose.”
In the early going, Netflix has dominated awards season. “The Irishman” last week won best film from the New York Film Critics Circle and the National Board of Review. “Marriage Story” virtually swept the IFP Gotham Awards.
Ricky Gervais will host the Globes for the fifth time on January 5. Tom Hanks, a possible nominee for his performance as Mister Rogers in “A Beautiful Day in the Neighborhood," will receive the Cecil B. DeMille Award. The Carol Burnett Award will go to Ellen DeGeneres.
___
Follow AP Film Writer Jake Coyle on Twitter at: http://twitter.com/jakecoyleAP
Jake Coyle, The Associated Press


We are Discovered. A Digital, Tech & E-Commerce recruitment business based out of the heart of Dubai’s tech start up scene, Astrolabs. Our team eat, live and breathe all things digital, we embrace technology and the social world we live in and say a big NO to outdated recruitment methods, all with the aim to help both candidates and clients discover their potential.
We offer tailor-made solutions that provide our clients and candidates with the edge they need to grow and succeed.
Creative Recruitment Plans rather than a one size fits all, our start-up, agency and big business plans are designed to simplify your process.
By Crowd Sourcing, we attract the hottest talent, people you wouldn’t find on a job board or via a LinkedIn search.
We’re Social, so whether you message, Skype, WhatsApp, Hangout, follow, tag, tweet, meet or call us, we’d love to connect with you.


Hello! I am Jamie Nguyen and I am currently pursuing a degree in Graphic Design. I am constantly challenging myself in learning a variety of new mediums to create unique works; I enjoy creating digital works as well as mixed media works. I have enjoyed creating things since I was young and love to create things for others. It brings me great pleasure seeing my artwork bring a smile to people's faces. So feel free to reach out to me if you're looking for something special.


Neymar: I'm ready to play against Real Madrid
Ney attended Pique's Davis Cup on Tuesday and says he's fit and firing
by Sport ENNeymar attended the Davis Cup tie between Rafa Nadal and Karen Khachanov (Spain v Russia), invited by his pal Gerard Pique to Madrid's Caja Magica.
The Brazilian PSG forward spoke briefly to the media and said that he is fit after his injury.
"I'm perfect, perfectly ready to play against Real Madrid in the Champions League," said Neymar after the match.
PSG face Lille in Ligue 1 at the weekend and then on Nov 26 play Real Madrid at the Santiago Bernabeu.


forward: Robust Analysis using Forward Search
Robust analysis using forward search in linear and
generalized linear regression models, as described in Atkinson, A.C. and Riani, M. (2000), Robust Diagnostic Regression Analysis, First Edition. New York: Springer.
| Version: |
1.0.4 |
| Depends: |
R (≥ 3.5), MASS |
| Published: |
2018-07-25 |
| Author: |
Originally written for S-Plus by: Kjell Konis and Marco Riani
Ported to R by Luca Scrucca
Ken Beath |
| Maintainer: |
Ken Beath <ken.beath at mq.edu.au> |
| License: |
GPL-2 |
| NeedsCompilation: |
no |
| Materials: |
NEWS |
| CRAN checks: |
forward results |
Downloads:
Reverse dependencies:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=forward
to link to this page.


SIDEBAR:
These are just 5 of the tens of thousands of bridges around the world. To see some of the most impressive bridges from around the world, please click here
NOTE:
The aforementioned website is a nicely laid out, clean and readable website built using a number of familiar and unfamiliar HTML tags.
Familiar tags seen on the source code are form, p, div, h, ul, li, title and a tags.
The unfamiliar ones are script (calls on Javascript), span (groups and styles inline elements) and path (gives relative path of a file).
Most unfamiliar are the attributes like class, id and target used with all of the familiar and unfamiliar tags.


Create a List
Name:
Enter a task:
Create!


In this vignette, we’ll walk through conducting a \(\chi^2\) (chi-squared) test of independence and a chi-squared goodness of fit test using infer
. We’ll start out with a chi-squared test of independence, which can be used to test the association between two categorical variables. Then, we’ll move on to a chi-squared goodness of fit test, which tests how well the distribution of one categorical variable can be approximated by some theoretical distribution.
Throughout this vignette, we’ll make use of the gss
dataset supplied by infer
, which contains a sample of data from the General Social Survey. See ?gss
for more information on the variables included and their source. Note that this data (and our examples on it) are for demonstration purposes only, and will not necessarily provide accurate estimates unless weighted properly. For these examples, let’s suppose that this dataset is a representative sample of a population we want to learn about: American adults. The data looks like this:
dplyr::glimpse(gss)
## Rows: 500
## Columns: 11
## $ year <dbl> 2014, 1994, 1998, 1996, 1994, 1996, 1990, 2016, 2000, 1998, 20…
## $ age <dbl> 36, 34, 24, 42, 31, 32, 48, 36, 30, 33, 21, 30, 38, 49, 25, 56…
## $ sex <fct> male, female, male, male, male, female, female, female, female…
## $ college <fct> degree, no degree, degree, no degree, degree, no degree, no de…
## $ partyid <fct> ind, rep, ind, ind, rep, rep, dem, ind, rep, dem, dem, ind, de…
## $ hompop <dbl> 3, 4, 1, 4, 2, 4, 2, 1, 5, 2, 4, 3, 4, 4, 2, 2, 3, 2, 1, 2, 5,…
## $ hours <dbl> 50, 31, 40, 40, 40, 53, 32, 20, 40, 40, 23, 52, 38, 72, 48, 40…
## $ income <ord> $25000 or more, $20000 - 24999, $25000 or more, $25000 or more…
## $ class <fct> middle class, working class, working class, working class, mid…
## $ finrela <fct> below average, below average, below average, above average, ab…
## $ weight <dbl> 0.8960, 1.0825, 0.5501, 1.0864, 1.0825, 1.0864, 1.0627, 0.4785…
To carry out a chi-squared test of independence, we’ll examine the association between income and educational attainment in the United States. college
is a categorical variable with values degree
and no degree
, indicating whether or not the respondent has a college degree (including community college), and finrela
gives the respondent’s self-identification of family income—either far below average
, below average
, average
, above average
, far above average
, or DK
(don’t know).
This is what the relationship looks like in the sample data:
If there were no relationship, we would expect to see the purple bars reaching to the same height, regardless of income class. Are the differences we see here, though, just due to random noise?
First, to calculate the observed statistic, we can use specify()
and calculate()
.
# calculate the observed statistic
observed_indep_statistic <- gss %>%
specify(college ~ finrela) %>%
hypothesize(null = "independence") %>%
calculate(stat = "Chisq")
The observed \(\chi^2\) statistic is 30.6825. Now, we want to compare this statistic to a null distribution, generated under the assumption that these variables are not actually related, to get a sense of how likely it would be for us to see this observed statistic if there were actually no association between education and income.
We can generate
the null distribution in one of two ways—using randomization or theory-based methods. The randomization approach approximates the null distribution by permuting the response and explanatory variables, so that each person’s educational attainment is matched up with a random income from the sample in order to break up any association between the two.
# generate the null distribution using randomization
null_dist_sim <- gss %>%
specify(college ~ finrela) %>%
hypothesize(null = "independence") %>%
generate(reps = 1000, type = "permute") %>%
calculate(stat = "Chisq")
Note that, in the line specify(college ~ finrela)
above, we could use the equivalent syntax specify(response = college, explanatory = finrela)
. The same goes in the code below, which generates the null distribution using theory-based methods instead of randomization.
# generate the null distribution by theoretical approximation
null_dist_theory <- gss %>%
specify(college ~ finrela) %>%
assume(distribution = "Chisq")
To get a sense for what these distributions look like, and where our observed statistic falls, we can use visualize()
:
# visualize the null distribution and test statistic!
null_dist_sim %>%
visualize() +
shade_p_value(observed_indep_statistic,
direction = "greater")
We could also visualize the observed statistic against the theoretical null distribution. To do so, use the assume()
verb to define a theoretical null distribution and then pass it to visualize()
like a null distribution outputted from generate()
and calculate()
.
# visualize the theoretical null distribution and test statistic!
gss %>%
specify(college ~ finrela) %>%
assume(distribution = "Chisq") %>%
visualize() +
shade_p_value(observed_indep_statistic,
direction = "greater")
To visualize both the randomization-based and theoretical null distributions to get a sense of how the two relate, we can pipe the randomization-based null distribution into visualize()
, and further provide method = "both"
.
# visualize both null distributions and the test statistic!
null_dist_sim %>%
visualize(method = "both") +
shade_p_value(observed_indep_statistic,
direction = "greater")
Either way, it looks like our observed test statistic would be quite unlikely if there were actually no association between education and income. More exactly, we can approximate the p-value with get_p_value
:
# calculate the p value from the observed statistic and null distribution
p_value_independence <- null_dist_sim %>%
get_p_value(obs_stat = observed_indep_statistic,
direction = "greater")
p_value_independence
## # A tibble: 1 × 1
## p_value
## <dbl>
## 1 0
Thus, if there were really no relationship between education and income, our approximation of the probability that we would see a statistic as or more extreme than 30.6825 is approximately 0.
To calculate the p-value using the true \(\chi^2\) distribution, we can use the pchisq
function from base R. This function allows us to situate the test statistic we calculated previously in the \(\chi^2\) distribution with the appropriate degrees of freedom.
pchisq(observed_indep_statistic$stat, 5, lower.tail = FALSE)
## X-squared
## 1.082e-05
Note that, equivalently to the theory-based approach shown above, the package supplies a wrapper function, chisq_test
, to carry out Chi-Squared tests of independence on tidy data. The syntax goes like this:
chisq_test(gss, college ~ finrela)
## # A tibble: 1 × 3
## statistic chisq_df p_value
## <dbl> <int> <dbl>
## 1 30.7 5 0.0000108
Now, moving on to a chi-squared goodness of fit test, we’ll take a look at the self-identified income class of our survey respondents. Suppose our null hypothesis is that finrela
follows a uniform distribution (i.e. there’s actually an equal number of people that describe their income as far below average, below average, average, above average, far above average, or that don’t know their income.) The graph below represents this hypothesis:
It seems like a uniform distribution may not be the most appropriate description of the data–many more people describe their income as average than than any of the other options. Lets now test whether this difference in distributions is statistically significant.
First, to carry out this hypothesis test, we would calculate our observed statistic.
# calculating the null distribution
observed_gof_statistic <- gss %>%
specify(response = finrela) %>%
hypothesize(null = "point",
p = c("far below average" = 1/6,
"below average" = 1/6,
"average" = 1/6,
"above average" = 1/6,
"far above average" = 1/6,
"DK" = 1/6)) %>%
calculate(stat = "Chisq")
The observed statistic is 487.984. Now, generating a null distribution, by just dropping in a call to generate()
:
# generating a null distribution, assuming each income class is equally likely
null_dist_gof <- gss %>%
specify(response = finrela) %>%
hypothesize(null = "point",
p = c("far below average" = 1/6,
"below average" = 1/6,
"average" = 1/6,
"above average" = 1/6,
"far above average" = 1/6,
"DK" = 1/6)) %>%
generate(reps = 1000, type = "draw") %>%
calculate(stat = "Chisq")
Again, to get a sense for what these distributions look like, and where our observed statistic falls, we can use visualize()
:
# visualize the null distribution and test statistic!
null_dist_gof %>%
visualize() +
shade_p_value(observed_gof_statistic,
direction = "greater")
This statistic seems like it would be quite unlikely if income class self-identification actually followed a uniform distribution! How unlikely, though? Calculating the p-value:
# calculate the p-value
p_value_gof <- null_dist_gof %>%
get_p_value(observed_gof_statistic,
direction = "greater")
p_value_gof
## # A tibble: 1 × 1
## p_value
## <dbl>
## 1 0
Thus, if each self-identified income class was equally likely to occur, our approximation of the probability that we would see a distribution like the one we did is approximately 0.
To calculate the p-value using the true \(\chi^2\) distribution, we can use the pchisq
function from base R. This function allows us to situate the test statistic we calculated previously in the \(\chi^2\) distribution with the appropriate degrees of freedom.
pchisq(observed_gof_statistic$stat, 5, lower.tail = FALSE)
## [1] 3.131e-103
Again, equivalently to the theory-based approach shown above, the package supplies a wrapper function, chisq_test
, to carry out Chi-Squared goodness of fit tests on tidy data. The syntax goes like this:
chisq_test(gss,
response = finrela,
p = c("far below average" = 1/6,
"below average" = 1/6,
"average" = 1/6,
"above average" = 1/6,
"far above average" = 1/6,
"DK" = 1/6))
## # A tibble: 1 × 3
## statistic chisq_df p_value
## <dbl> <dbl> <dbl>
## 1 488. 5 3.13e-103


0">
Incoming Appointments
{{appointment.clientName}}
Subject
{{appointment.subject }}
Start Date
{{appointment.startDateTime}}
Finish Date
{{appointment.finishDateTime}}
Description
{{appointment.description}}
0">
Confirmed Appointments
{{appointment.clientName}}
Subject
{{appointment.subject }}
Start Date
{{appointment.startDateTime}}
Finish Date
{{appointment.finishDateTime}}
Description
{{appointment.description}}
There is not an Appointment yet.


This is a tutorial on creating and using Plugins with Workflows.
import re
from typing import Any, Optional
import attr
from dialogy.plugin import Plugin
from dialogy.types.plugin import PluginFn
from dialogy.workflow import Workflow
This function would be provided by the workflow implementer.
def access(workflow: Workflow) -> Any:
return workflow.input
This function would be provided by the workflow implementer.
def mutate(workflow: Workflow, value: Any) -> Any:
workflow.output = value
def tokenizer_plugin(
pattern: str = r" ",
maxsplit: int = 0,
flags: int = re.I | re.U,
access: Optional[PluginFn] = None,
mutate: Optional[PluginFn] = None,
) -> PluginFn:
Expects a string from the access(workflow)
and tokenizes the string.
Example: “an apple” -> [“an”, “apple”]
Args:
Raises:
Returns:
Always compile strings before using them in loops.
compiled_pattern = re.compile(pattern, flags=flags)
def plugin(workflow: Workflow) -> Any:
if access and mutate:
assuming consumers would have workflow.input
as str
.
text = access(workflow)
if not isinstance(text, str):
raise TypeError(f"Expected str found {type(text)}.")
if not text:
raise ValueError("Expected str of non-zero length.")
assuming the previously held value is of no relevance.
mutate(workflow, compiled_pattern.split(text, maxsplit=maxsplit))
else:
raise TypeError("access and mutate should be of type PluginFn.")
return plugin
def test_tokenizer_plugin() -> None:
We will test the tokenizer plugin.
create an instance of a Workflow
.
we are calling the arbitrary_plugin
to get the plugin
de method.
workflow = Workflow(
preprocessors=[tokenizer_plugin(access=access, mutate=mutate)],
postprocessors=[],
)
workflow.run("Mary had a little lambda")
assert workflow.output == ["Mary", "had", "a", "little", "lambda"]
@attr.s
class ArbitraryPlugin(Plugin):
A Plugin class example.
We can create Plugins using python classes. If we extend from
the Plugin
class, we get the access
and mutate
attributes.
The access
and mutate
values are set to None
because there are cases where you may
only need to perform computation. Say metric plugins, which could be a set of post-processing
plugins that evaluate the workflow but have nothing to insert into it.
These utilities would be forced to hack a value around to satisfy the type-checking, this
can be avoided by expecting either of the functions to be of type NoneType
or PluginFn
.
access: Optional[PluginFn] = attr.ib(default=None)
mutate: Optional[PluginFn] = attr.ib(default=None)
def plugin(self, workflow: Workflow) -> None:
Expects a tuple from access(workflow)
that contains numbers and words.
Where
This plugin will:
numbers
by 2.words
.The plugin method is the place for implementing plugin logic.
Args:
if self.access and self.mutate:
We are expecting numbers and words from the workflow. The owner of the workflow defines the access and mutate methods, so as a plugin author, you can document the input and output types and expect things to work.
numbers, words = self.access(workflow)
Trivial data manipulation. A serious example would have been canonicalization of sentences to replace tokens with classes they represent for improving performance in a classification task.
numbers = [number + 2 for number in numbers]
words = [word + " world" for word in words]
self.mutate(workflow, (numbers, words))
else:
raise TypeError("access and mutate should be of type PluginFn.")
def __call__(self) -> PluginFn:
this is required only for code-coverage.
super().__call__()
return the plugin method.
return self.plugin
def test_arbitrary_plugin() -> None:
We will test how an arbitrary-class-based plugin works with a workflow.
create an instance of ArbitraryPlugin
.
arbitrary_plugin = ArbitraryPlugin(access=access, mutate=mutate)
create an instance of a Workflow
.
we are calling the arbitrary_plugin
to get the plugin
de method.
workflow = Workflow(preprocessors=[arbitrary_plugin()], postprocessors=[])
This runs all the preprocessors
and postprocessors
provided previously.
we can expect our arbitrary_plugin
will also be used.
workflow.run(([2, 5], ["hello", "hi"]))
numbers, words = workflow.output # pylint: disable=unpacking-non-sequence
This test would pass only if our plugin works correctly!
assert numbers == [4, 7]
assert words == ["hello world", "hi world"]