The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

DESCRIPTION

Make a simple storage-like object that uses the Identity v3 interface based on project tags as a backend.

It allows you to store a list of strings, that can be encoded/decoded.

Methods

_initialize
client

The Net::OpenStack::Client instance to use. (It will also be used as the reporter instance.)

project

The base project (name or id) that will store the tags. The project has to exist.

All tags are stored in child projects with name <project_<counter>>.

_tag

Interact with the API.

fetch

Fetch data and populate the cache (and counter). If the cache already exists, it doesn't do anything. If you want to renew the cache, flush it first.

flush

Flushes the cache.

get

Return (cached) data for tag. If tag is not defined, return all (cached) data as a hashref (key is tag, value is projectid that holds the tag). Data is fetched if cache is undefined.

_sane_data

Sanity check on tag data to add/delete.

Returns 1 on success, undef on failure (and reports an error).

add

Add element (to store and cache).

Returns 1 on success; undef on failure (and reports an error).

delete

Delete item (from store and cache) if it exists in the cache.

Returns 1 on success (incl. when the data was not available in the first place); undef on failure (and reports an error).