This adds support for the recommended CLI using the OpenStackClient,
without modifying the existing Blazar shell CLI.
The existing shell command classes are used, by introducing a check in
the base comand class to use either the client passed by Blazar shell,
or the client using the osc_lib client_manager.
The argument --physical-reservation is also removed for the create lease
command when using the OpenStack client.
Implements: blueprint openstackclient-support
Some of the tests rely on a hard-coded date being actually in the past
when the test runs. This fixes that by fixing the value of utctime when
the test executes to a date in the past relative to the test input.
The lease-update command needs to know about all possible keys that can
be passed as reservation parameters. Also treat required_floatingips as
a list, like in commit 9183950833.
An API request to create a floating IP reservation is expected to pass
the required_floatingips parameter as a list, not as a string. Modify
the CLI to parse required_floatingips as a JSON array so it can be
passed to the API in the right format.
The network_id parameter was not defined in CREATE_RESERVATION_KEYS. As
a result, it could not be parsed by the command-line client.
When the Blazar CLI client is run without specifying a start date, it
uses the current time on the client machine. If the lease creation
request is sent to the Blazar service just before the end of a minute,
e.g. at 12:34:59, the Blazar manager might only process it during the
next minute (i.e. after 12:35:00). In this case, the manager will reject
the request with:
Start date must be later than current date
This can also be an issue if the clocks on the client and server are not
This patch uses the special start date value 'now' which is resolved to
the current time on the server rather than on the client. Note that this
can result in leases that are one minute shorter than what the user
might expect, as the end date is still specified by the client.
It also clarifies help messages for start and end dates.
The Blazar CLI doesn't support show, update and delete host operations
with hostname. It only accepts id because host uses a key called
hypervisor_hostname, rather one called name like for leases.
This patch enables the Blazar CLI to support hostname as well.
After merged the patch I08c8b753972c27b4e6bbe07a8aa51e0e72fbc56d,
blazarclient can't be used with blazar_url and auth_token since this
patch only allows sessions for the initiation of client.
For backward compatibility, blazarclient should be initiated with
blazar_url and auth_token as before.
This patch enables using blazarclient with a set of blazar_url and
auth_token or session by reviving BaseClientManager class with adding
a logic to chose an auth method based on given params.
For authentication, the community recommends the use of keystoneauth1
instead of python-keystoneclient. Therefore, Blazar should follow
this trend and migrate to keystoneauth1.
This patch enables blazarclient to use keystoneauth1 for authentications
and REST API requests and also enables use of project_id, project_name,
project_domain_id, project_domain_name, user_domain_id and user_domain_name
This patch adds a before_end_date option to the lease-create command. It
also adds a before_end parameter to the physical_reservation option.
Partially Implements: blueprint on-end-options
python-blazarclient does not accept multiple properties when
creating leases. This is because of the wrong regular expression
used for separating given options.
This patch fixs the regular expression and enables the use of
multiple properties in python-blazarclient.
Commit b2fa6bf534  was accessing the
wrong variable, resulting in failures to create leases from the CLI with
the --physical-reservation option.
This patch fixes the error.
python-blazarclient sends all request parameters in the request body as
strings even though the blazar service only accepts integer values for
For instance, the instance reservation feature accepts an integer for
the 'vcpus' parameter, but the blazar client sends a string value for
the parameter with the --reservation vcpus=1 option.
This patch enables the --reservation option to convert integer style
parameters to integer values.
lease-update CLI only accepts time delta to update start_time
or end_time of leases. It's hard for users to specify a specific
date as its argument since users need to caluclate the time delta
between the previous start/end time and the new date.
This patch enables users to update leases with date format
like --end-date "2017-06-05 17:15".
There was no validation for min and max arguments, so the following
1. min and max values must be integers
2. min value must be less than max value
3. min and max values must be greater than 0
4. min and max values must be provided by user
The python-blazarclient repository has been using the climateclient
This patch converts the climateclient namespace to the blazarclient
namespace. Additionally, some classes, methods and variables that
include 'climate' in their name are also changed to 'blazar'.