NAME
Net::OpenStack::Client::Request is an request class for Net::OpenStack.
Boolean logic is overloaded using _boolean
method (as inverse of is_error
).
Public functions
- mkrequest
-
A
Net::OpenStack::Client::Request
factory - parse_endpoint
-
Parse
endpoint
and look for templates and parameters.Return (possibly modified) endpoint, arrayref of template names and arrayref of parameter names.
If
logger
is passed, report an error and return; else die on failure.
Public methods
- new
-
Create new request instance from options for command
endpoint
and REST HTTPmethod
.The
endpoint
is the URL to use (can be templated withtpls
)Options
- endpoint
-
Parses the endpoint attribute, look for any templates, and replace them with values from
tpls
attribute hashref. Any parameters defined in the endpoint are removed, and only those that are present in theparams
attribute are readded with the values from the attribute.The data can contain more keys than what is required for templating, those keys and their values will be ignored.
This does not modify the endpoint attribute.
Return templated endpoint on success or undef on failure.
If host is defined, try to make a full URL
- opts_data
-
Generate hashref from options, to be used for JSON encoding. If
raw
attribute is defined, ignore all options and return it.Returns empty hasref, even if no options existed.
- headers
-
Return headers for the request.
Supported options:
- is_error
-
Test if this is an error or not (based on error attribute).