Memstore Container Methods

These methods are provided here as a convenient way to manage containers regarding the Access Control List (ACL) and the Content Delivery Network (CDN), but the same functionality can be achieved using the OpenStack Object Storage API.

memstore.container.acl()

Retrieve ACL information associated to a container.

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • container (String) – Name of the container.
Returns:

a dictionary with the following keys:

read_acl

List: The usernames (Strings) with read access to the container.

write_acl

List: The usernames (Strings) with write access to the container.

The returned lists may be empty if there’s no user in the ACL.

memstore.container.cdn()

Retrieve CDN information associated to a container.

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • container (String) – Name of the container. Container name can only contain numbers, letters and hyphens. Hyphens aren’t allowed at the beginning or the end of the name.
Returns:

a dictionary with the following keys:

URL

String: public URL for the container.

SSL_URL

String: public SSL URL for the container.

public

Boolean: If the container CDN is enabled (public container).

ttl

Integer: Time to live in seconds for content cached by the CDN.

listing

Boolean: If directory listing is enabled.

index

String: Name of the file used as default index. ‘0’ means the functionality is disabled.

notfound

String: Path of the file used for the HTTP 404 (Not Found) page. ‘0’ means the functionality is disabled.

cors

String: Cross-Origin Resource Sharing (CORS) header value, being a specific site or ‘*’ for any. ‘0’ means the functionality is disabled.

The CDN information is stored in the container’s metadata, other content not listed here is ignored by the method.

memstore.container.create()

Create a container with the given name.

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • container (String) – Name of the container.
Returns:

No value if the container is created successfully, or raises an ApiError.

memstore.container.set_acl()

Set ACL information associated to a container.

Write access implies read access.

When a new ACL is set, the existing ACL is discarded. To clear a list, an empty list will be used.

Any user added to the ACL must be created and enabled in the container’s Memstore instance for the ACL to have effect.

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • container (String) – Name of the container.
  • read_acl (List) – List of strings with usernames to have read access to the container
  • write_acl (List) – List of strings with usernames to have write access to the container
memstore.container.set_public_cdn()

Set a container public enabling the CDN service.

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • container (String) – Name of the container. Container name can only contain numbers, letters and hyphens. Hyphens aren’t allowed at the beginning or the end of the name.
  • ttl (Integer) – Time to live in seconds for content cached by the CDN.
  • listing (Boolean, Optional) – If directory listing is enabled.
  • index (String, Optional) – Name of the file to be used as default index.
  • notfound (String, Optional) – Path of the file to be used for the HTTP 404 (Not Found) page.
  • cors (String, Optional) – Cross-Origin Resource Sharing (CORS) header value.
Returns:

the public URL for the container.

Return type:

String

The CDN information is stored in the container’s metadata and any unrelated existing metadata information won’t be altered.

memstore.container.unset_public_cdn()

Unset a public container disabling the CDN service.

The CDN information is stored in the container’s metadata and any unrelated existing metadata information won’t be altered.

The container and its data won’t be modified.

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • container (String) – Name of the container. Container name can only contain numbers, letters and hyphens. Hyphens aren’t allowed at the beginning or the end of the name.

Previous topic

Memstore Methods

Next topic

Memstore User Methods

This Page