Resources

Cloud Resource

class mrcsp.Resources.Cloud(uri)

Cloud resource.

get_account()

Returns the account resource.

get_contacts()

Returns the contacts resource.

get_projects()

Returns the projects resource.

get_root_container()

Returns the root container resource.

get_shares()

Returns the shares resource.

get_tags()

Returns the tags resource.

unmarshall(source)

Convert a representation of the resource into an object.

Account Info Resource

class mrcsp.Resources.AccountInfo(uri)

Account Info resource.

get_bandwidth_allocated()

Returns the amount of bandwidth allocated in bytes.

get_bandwidth_used()

Returns the amount of bandwidth used in bytes.

get_bandwidth_used_private()

Returns the amount of private bandwidth used in bytes.

get_bandwidth_used_public()

Returns the amount of public bandwidth used in bytes.

get_storage_allocated()

Returns the amount of storage allocated in bytes.

get_storage_used()

Returns the amount of storage used in bytes.

get_username()

Returns the account user name.

unmarshall(source)

Convert a representation of the resource into an object.

Container Info Resource

class mrcsp.Resources.ContainerInfo(uri)

Contaianer resource.

get_contents()

Returns a FileList resource for the container contents.

unmarshall(source)

Convert a representation of the resource into an object.

File Info Resource

class mrcsp.Resources.FileInfo(uri)

File resource.

get_content_mime_type()

Returns the mime type of the file content.

get_content_uri()

Returns the URI of the file content.

is_public()

Determine if the object has a public url.

unmarshall(source)

Convert a representation of the resource into an object.

File List Resource

class mrcsp.Resources.FileList(uri)

File List resource.

contains_resource(resource)

Returns bool denoting if the specified resource is in the list.

get_contents()

Returns file list contents as a list

get_count()

Returns the number of items in list

get_total()

Returns the total number of items available

unmarshall(source)

Convert a representation of the resource into an object.

Permission Resource

class mrcsp.Resources.Permission(uri)

Permission resource

get_expiration()

Get the permission expiration as datetime.

get_grantee()

Return the grantee of the permission.

get_permissions()

Return the permissions

marshall()

Convert resource into a representation fit to send to the service.

set_expiration(expires)

Set the expiration (as datetime) of the permission

set_grantee(grantee)

Set the grantee of the permission.

set_permissions(permissions)

Set the permissions values specified as a dictionary.

unmarshall(source)

Convert a representaiton of the resource into an object.

Permission List Resource

class mrcsp.Resources.PermissionList(uri)

Permission list resource

get_permissions()

Returns a list of contact resources.

marshall()

Convert resource into a representation fit to send to the service.

unmarshall(source)

Convert a representaiton of the resource into an object.

Tag Info Resource

class mrcsp.Resources.TagInfo(uri)

Tag Info resource.

get_name()

Returns the name of the tag.

get_objects()

Returns the list of objects with the tag.

marshall()

Convert resource into a representation fit to send to the service.

set_name(name)

Updates the name of the resource.

unmarshall(source)

Convert a representation of the resource into an object.

Tag List Resource

class mrcsp.Resources.TagList(uri)

Tag List resource.

unmarshall(source)

Convert a representaiton of the resource into an object.

Contact Resource

class mrcsp.Resources.Contact(uri)

Contact resource.

get_email()

Returns the email for the contact.

get_firstname()

Returns the firstname for the contact.

get_lastname()

Returns the lastname for the contact.

unmarshall(source)

Convert a representaiton of the resource into an object.

Contact List Resource

class mrcsp.Resources.ContactList(uri)

Contact list resource.

get_contacts()

Returns a list of contact resources.

unmarshall(source)

Convert a representaiton of the resource into an object.

Utility Classes

Resource Base Class

class mrcsp.Resources.Resource(mime_type, uri=None)

Base resource provides generic functionality.

get_headers()

Return dictionary of headers associated with this resource.

get_mime_type()

Return the mime type of the resource

get_uri()

Return the uri for the resource.

has_content()

Determine if the resource has been populated

is_locked()

Determine if this resource is locked.

marshall()

Convert resource into a representation fit to send to the service.

set_header(name, value)

Add a new header to this resource.

set_mime_type(mime_type)

Sets the mime type of the resource

set_uri(uri)

Specifiy the URI for this resource.

unmarshall(source)

Convert a representation of the resource into an object.

XML-Based Resource

class mrcsp.Resources.XMLResource(mime_type, uri)

An XML Resource.

has_content()

Determine if the resource has been populated

marshall()

Convert resource into a representaiton.

marshall_xml()

Convert resource into an XML representation.

set_uri(uri)

Specifiy the URI for this resource.

unmarshall(source, root=None)

Convert a representation of the resource into an object.

unmarshall_xml(source, root=None)

Convert an XML representation of the resource into an object.

Object Resource

class mrcsp.Resources.ObjectResource(mime_type, uri)

Base class for stored objects (containers, files)

Resource Factory

class mrcsp.Resources.ResourceFactory

Factory for resources