Add object_store resource documentation

Currently this is documentation pulled from
http://developer.openstack.org/api-ref-objectstorage-v1.html

Long term we may want to find a better way to handle this, but for now
I'd like to make sure we can offer documentation from one spot rather
than point people to several places and put hurdles in place.

Change-Id: I27997de8caef866e8503f136efeec53b5e5ac2ae
This commit is contained in:
Brian Curtin
2014-11-24 16:37:27 -06:00
parent aa6340147e
commit 7d12b8c302
4 changed files with 120 additions and 0 deletions

View File

@@ -6,5 +6,7 @@ openstack.object_store.v1.container
The Container Class
-------------------
The ``Container`` class inherits from :class:`~openstack.resource.Resource`.
.. autoclass:: openstack.object_store.v1.container.Container
:members:

View File

@@ -6,5 +6,7 @@ openstack.object_store.v1.obj
The Object Class
----------------
The ``Object`` class inherits from :class:`~openstack.resource.Resource`.
.. autoclass:: openstack.object_store.v1.obj.Object
:members:

View File

@@ -30,34 +30,74 @@ class Container(resource.Resource):
allow_head = True
# Account data (when id=None)
#: The transaction date and time.
timestamp = resource.prop("x-timestamp")
#: The total number of bytes that are stored in Object Storage for
#: the account.
account_bytes_used = resource.prop("x-account-bytes-used")
#: The number of containers.
account_container_count = resource.prop("x-account-container-count")
#: The number of objects in the account.
account_object_count = resource.prop("x-account-object-count")
#: The secret key value for temporary URLs. If not set,
#: this header is not returned by this operation.
meta_temp_url_key = resource.prop("x-account-meta-temp-url-key")
#: A second secret key value for temporary URLs. If not set,
#: this header is not returned by this operation.
meta_temp_url_key_2 = resource.prop("x-account-meta-temp-url-key-2")
# Container body data (when id=None)
#: The name of the container.
name = resource.prop("name")
#: The number of objects in the container.
count = resource.prop("count")
#: The total number of bytes that are stored in Object Storage
#: for the container.
bytes = resource.prop("bytes")
# Container metadata (when id=name)
#: The number of objects.
object_count = resource.prop("x-container-object-count")
#: The count of bytes used in total.
bytes_used = resource.prop("x-container-bytes-used")
# Request headers (when id=None)
#: If set to True, Object Storage queries all replicas to return the
#: most recent one. If you omit this header, Object Storage responds
#: faster after it finds one valid replica. Because setting this
#: header to True is more expensive for the back end, use it only
#: when it is absolutely needed.
newest = resource.prop("x-newest", type=bool)
# Request headers (when id=name)
#: The ACL that grants read access. If not set, this header is not
#: returned by this operation.
read_ACL = resource.prop("x-container-read")
#: The ACL that grants write access. If not set, this header is not
#: returned by this operation.
write_ACL = resource.prop("x-container-write")
#: The destination for container synchronization. If not set,
#: this header is not returned by this operation.
sync_to = resource.prop("x-container-sync-to")
#: The secret key for container synchronization. If not set,
#: this header is not returned by this operation.
sync_key = resource.prop("x-container-sync-key")
#: 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.
versions_location = resource.prop("x-versions-location")
#: Set to any value to disable versioning.
remove_versions_location = resource.prop("x-remove-versions-location")
#: Changes the MIME type for the object.
content_type = resource.prop("content-type")
#: If set to true, Object Storage guesses the content type based
#: on the file extension and ignores the value sent in the
#: Content-Type header, if present.
detect_content_type = resource.prop("x-detect-content-type", type=bool)
#: In combination with Expect: 100-Continue, specify an
#: "If-None-Match: *" header to query whether the server already
#: has a copy of the object before any data is sent.
if_none_match = resource.prop("if-none-match")
def _do_create_update(self, session, method):

View File

@@ -30,7 +30,9 @@ class Object(resource.Resource):
allow_head = True
# URL parameters
#: The unique name for the container.
container = resource.prop("container")
#: The unique name for the object.
name = resource.prop("name")
# Object details
@@ -38,37 +40,111 @@ class Object(resource.Resource):
bytes = resource.prop("bytes")
# Headers for HEAD and GET requests
#: Authentication token.
auth_token = resource.prop("x-auth-token")
#: If set to True, Object Storage queries all replicas to return
#: the most recent one. If you omit this header, Object Storage
#: responds faster after it finds one valid replica. Because
#: setting this header to True is more expensive for the back end,
#: use it only when it is absolutely needed.
newest = resource.prop("x-newest", type=bool)
#: TODO(briancurtin) there's a lot of content here...
range = resource.prop("range", type=dict)
#: See http://www.ietf.org/rfc/rfc2616.txt.
if_match = resource.prop("if-match", type=dict)
#: In combination with Expect: 100-Continue, specify an
#: "If-None-Match: *" header to query whether the server already
#: has a copy of the object before any data is sent.
if_none_match = resource.prop("if-none-match", type=dict)
#: See http://www.ietf.org/rfc/rfc2616.txt.
if_modified_since = resource.prop("if-modified-since", type=dict)
#: See http://www.ietf.org/rfc/rfc2616.txt.
if_unmodified_since = resource.prop("if-unmodified-since", type=dict)
# Query parameters
#: Used with temporary URLs to sign the request. For more
#: information about temporary URLs, see OpenStack Object Storage
#: API v1 Reference.
signature = resource.prop("signature")
#: Used with temporary URLs to specify the expiry time of the
#: signature. For more information about temporary URLs, see
#: OpenStack Object Storage API v1 Reference.
expires = resource.prop("expires")
#: If you include the multipart-manifest=get query parameter and
#: the object is a large object, the object contents are not
#: returned. Instead, the manifest is returned in the
#: X-Object-Manifest response header for dynamic large objects
#: or in the response body for static large objects.
multipart_manifest = resource.prop("multipart-manifest")
# Response headers from HEAD and GET
#: HEAD operations do not return content. However, in this
#: operation the value in the Content-Length header is not the
#: size of the response body. Instead it contains the size of
#: the object, in bytes.
content_length = resource.prop("content-length")
#: The MIME type of the object.
content_type = resource.prop("content-type")
#: The type of ranges that the object accepts.
accept_ranges = resource.prop("accept-ranges")
#: The date and time that the object was created or the last
#: time that the metadata was changed.
last_modified = resource.prop("last-modified")
#: 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.
etag = resource.prop("etag")
#: Set to True if this object is a static large object manifest object.
is_static_large_object = resource.prop("x-static-large-object")
#: The transaction date and time.
date = resource.prop("date")
#: If set, the value of the Content-Encoding metadata.
#: If not set, this header is not returned by this operation.
content_encoding = resource.prop("content-encoding")
#: 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.
content_disposition = resource.prop("content-disposition")
#: 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.
delete_at = resource.prop("x-delete-at", type=int)
#: 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 container/prefix.
object_manifest = resource.prop("x-object-manifest")
#: The UNIX timestamp of the transaction.
timestamp = resource.prop("x-timestamp")
# Headers for PUT and POST requests
#: Set to chunked to enable chunked transfer encoding. If used,
#: do not set the Content-Length header to a non-zero value.
transfer_encoding = resource.prop("transfer-encoding")
#: If set to true, Object Storage guesses the content type based
#: on the file extension and ignores the value sent in the
#: Content-Type header, if present.
detect_content_type = resource.prop("x-detect-content-type", type=bool)
#: If set, this is the name of an object used to create the new
#: object by copying the X-Copy-From object. The value is in form
#: {container}/{object}. You must UTF-8-encode and then URL-encode
#: the names of the container and object before you include them
#: in the header.
#: Using PUT with X-Copy-From has the same effect as using the
#: COPY operation to copy an object.
copy_from = resource.prop("x-copy-from")
#: Specifies the number of seconds after which the object is
#: removed. Internally, the Object Storage system stores this
#: value in the X-Delete-At metadata item.
delete_after = resource.prop("x-delete-after", type=int)
def get(self, session):