When listing hosts and cells, there is no need to require the user to
provide a region-id. The API previously required region IDs to be
present in the query string to list hosts and cells, but relaxed this
constraint. The craton CLI encoded this constraint in its parameters but
now needs to relax this as well.
Change-Id: I973176a150c5d10de2144501dcc39cd6cfacbf9a
Closes-bug: #1659428
$craton host-list needs to allow some of the filtering
parameters to users to be able to filer host listing.
This patch adds --ip, --device-type, --vars and --label
parameters as allowed filters to host-list.
Closes Bug: 1659235
Change-Id: I663079ca454a3451c2688c518884243da1488b85
This allows users to specify a formatter for the entirety of the craton
command-line client via --format.
Change-Id: I3a4795b14f1f4c9e2df62c83d5d9360afd56f324
This allows users to specify the formatter they want to use and have the
project-* subcommands honor it.
Change-Id: I4ea6f0d679f6167a1b4865d8d51f5c6ef07c58cd
This updates the clouds-* command-line entry points to use the formatter
chosen by the user with --format.
Change-Id: I4d07abc41cb93589889c0599eff426544467a965
This now allows users of the cell-* command-line entry points to use the
formatter provided by --format.
Change-Id: I1e2356f4d38051c97af68e48f12d0ec95ac6167a
Add a new way of formatting our output in a consistent way. This turns
print_list and print_dict into a formatter that has the same API as any
other formatter and allows users to create their own formatters and plug
them into cratonclient.
This includes tests for the base level formatter and our two default
formatters as well as some refactoring to allow users to specify their
own --format.
At the moment, however, the subcommand shells do *not* use the pluggable
formatter decided by the user. That change and all of the downstream
effects it has on testing is going to be *very* significant and deserves
its own commit as this one is large enough.
Change-Id: I6649ebce57d5ddf2d4aeb689e77e3c17ef3a2e97
This patch adds basic CRUD operations for
the Cloud resource in the Craton API and
integrates cloud_id throughout dependent
child resources.
Change-Id: If33c13082e31ee9f76278926538c707c559e41d0
Closes-Bug: 1666947
Depends-On: Ib1c16a504430760f2a7234221f91429a7ea72596
This adds pagination support to the underlying client as well as
autopagination support on the CLI.
This adds --all and --marker to the associated
{cells,hosts,projects,regions}-list commands.
Depends-On: I11c5c6053e5f0873ee53df5b7dcb9b2ed25a0b64
Change-Id: Ic1f8f01e052ff7870f731d6c8a5d47d58d9dcfe9
This change allows the client to display the host parent_id. When using
craton host-show the property is displayed by default, when using craton
host-list the property must be selected using --fields.
Change-Id: Ieb482ff5f2e31d79ad817b65dcb9a55df2ed0ef2
Partial-bug: 1662496
Craton resources have a property, `updated_at`. This commit corrects the
client to look for that property using the correct name. Without the
change the client is looking for `update_at` which causes the output for
that property to be blank.
Change-Id: If041f97594038e2e66ba3a664a514e5d2447bd18
Both craton --help and craton help <COMMAND> is
broken for different reasons. This patch fixes
that by adding do_help function for help subcommand
and by displaying suparsed argument of --help.
Closes Bug: 1659092
Change-Id: I838c780ada21edb8202d0fda6bfc982bc57c253b
We dont use and wont be using access_secret_id
the way it is right now. This patch therefore
removes this since it does not work at all.
Closes Bug: 1659104
Change-Id: I3ac685cb3958742a348007b40cedf6be5293ca7d
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.
This change adds constraints support by also adding a helper script to
edit the constraints to remove python-cratonclient.
Change-Id: Iddf349b3833908c35ecbfeba535b17d431c85b0c
This adds a cratonclient.auth with craton_auth and keystone_auth
functions to generate cratonclient.session.Session objects with
appropriate authentication plugins set-up.
Closes-bug: 1643961
Change-Id: I661a91241b96ca5c45a91a0add4f74c4ca7e6750
Regions shell commands is currently missing
region-list function. This patch addes the
shell command and adds some test for it too.
Closes-Bug: #1614765
Change-Id: Ic5aa1a4f024f3978f940daeb0e273226a3b4970f
A little while ago, we started using KeystoneAuth for everything. This
means we can simplify our code a lot.
First, we can off-load request/response logging to KeystoneAuth which is
where we stole our (broken) code from originally.
Second, we can remove the handling around endpoint_filtering (again
because we only ever use KeystoneAuth).
Change-Id: Ie05bb0a7ecdc339130f29ba322b56913854909bd
Closes-bug: 1643650
As a matter of design and practicality, we have decided to remove the
Inventory object which was awkward, underspecified, and frankly the
wrong layer of abstraction from the Client. Hosts, Cells, etc. will now
be accessible directly from the client itself.
Change-Id: I4a65761ad39d0b7cb881a97c5f3367cafa9db557
This adds some basic documentation describing how to authenticate
against Craton and provides some preliminary auto-generated
documentation of objects.
Change-Id: I2692a80785662e3193e56b62ed78cbe8de9f6e51
Add more unit tests for the cratonclient.shell.main module and refactor
some of the logic in that module to be more future-proof.
Change-Id: Iddfc5a170d15de77e1e400c2fa54b4a91cd94b7a
This refactors our shell unittest helpers into three base classes for
further unit test classes to subclass and extend. This also corrects
some problems with the hosts shell parameters that either didn't
previous work or were wrong and no longer belong. Finally, it removes
project_id from places where it no longer belongs.
Change-Id: Ibd6a36714135d14355c3b4f48fced83b852581a9
This allows things like tox -e venv to work as well, so you can do
tox -e venv -- python
>>> from cratonclient ... import ...
Without getting an ImportError for a missing dependency.
Change-Id: I75955c6fe7d6b4403eff8995932ff3ea3cb961b3
This adds a number of unit tests around the cells_shell logic that
should allow our integration tests to start operating differently.
We will likely end-up extracting some of the common logic for the _shell
unit test modules to a base test case class so we can use those methods
across all the unittests more conveniently.
Change-Id: I60a6e7c89aec6c1104177b92b6e2e358adfe01d5
The region and inventory tests belong in their own sub-directory of the
unit test directory. This will allow future versions of craton to have
tests in tests/unit/v2/ that are similarly named.
Change-Id: I62b657ac7137009d02c2476a90698f54d2f0fa5a
Most of our shell testing belongs in our integration test folder. These
tests are mocking out standard out and standard in as well as other
collaborators while still integrating with other collaborators. These
belong in cratonclient.tests.integration as a result.
Change-Id: I3a73637d25604112f252e21dde21f8b9b582be14