ReadTheDocs provides TLS for all subdomains and with our updated
infrastructure jobs, we are updating the documentation here on every
push to master.
Further, we split out bug tracking for craton's API and it's client code
a while ago, this just points people at the right place to report those
bugs now.
Change-Id: Id946bba0cda9e4aa81d6df9088e3b18afaca8ee9
We support py35 now.We do not have python 3.4 in setup.cfg which declares the explicit
supported versions.so it is no need to keep the supoort for py34.
see:https://review.openstack.org/#/c/349069/
Change-Id: Ic50f8395a9fe727f11aed65b5944b6d45a8be850
tox.ini's command specification doesn't expand globs (*) so one cannot
simply do:
rm {posargs:cratonclient/tests/cassettes/*.yaml}
Instead one must be tricky and use find as we do in this commit. This
also allows folks to simply re-record only the cassettes they wish to
rerecord by doing
tox -e rerecord -- TestHosts-test_create.yaml
As it will then execute
find cratonclient/tests/cassettes -name 'TestHosts-test_create' \
-delete
Or even use globs
tox -e rerecord -- 'TestHosts*'
As that will translate to
find cratonclient/tests/cassettes -name 'TestHosts*' -delete
This also ensures that new tests aren't recorded in our py27/py35
environments by setting the appropriate environment variable. Only the
rerecord environment may now record new cassettes.
Change-Id: I64e322548afc1b2d508fa129c0b151a8a91137a0
Use betamax to record interactions between cratonclient and a craton
server for the /v1/regions API.
Implements: bp testing-plan
Change-Id: I7f558a4516afdc3db27101639620534f4746b2af
This adds more integration tests for the v1 client, specifically for
/v1/clouds.
Further, this introduces a new test method for the integration tests as
it was found to be reimplemented in a few different test modules. This
replaces the pattern used in the existing tests with the new pattern.
Implements: bp testing-plan
Change-Id: Ic4e342cf01be288b7a7c453659580c57169b1022
Using our new Betamax testing integration, this adds tests to verify how
our cells management behaves against a real Craton API.
The majority of this commit lies in the cassettes. These contain the
real requests and responses for each of the tests. The cassette names
are generated from the tests themselves (combination of test class name
and test method).
Implements: bp testing-plan
Change-Id: I6c029f6ad1408508c61d3363f5ee709e9b8210d2
Use keystoneauth1's Betamax test fixture to start recording
request-response interaction pairs in files. I'm starting this bit of
work with our hosts API module.
As a result of this testing, I discovered that we were not handling
keystoneauth1 exceptions inside of our session. This adds handling for
that with a new function for finding the right cratonclient exception to
raise in cratonclient.exceptions. Thus, this also includes testing for
the convenience functions in that module.
Users need only setup 4 environment variables for testing:
* CRATON_DEMO_USERNAME
* CRATON_DEMO_PROJECT
* CRATON_DEMO_TOKEN
* CRATON_DEMO_URL
Depends-On: I45de545b040d2b99ac8f3f4d3c81359615d328e8
Change-Id: Ib69d825a50a7e4179aefd11bcbfbed39c27c7fbe
Partially-implements: bp testing-plan
This corrects some typos in earlier documentation patches, removes
outdated API reference documentation, and organizes all API reference
documentation under one chapter.
This also leaves room for future API versions and more specific API
reference documentation being broken out into sub-sections.
Change-Id: I5391a1acc7d1669207b3d10039a196d026216f40
This adds a directory and some basic templates for creating shell
command documentation for python-cratonclient. This creates the shell
sub-directory to allow for individual pages which document each
sub-command in detail.
In the future, that documentation should be further scoped by the
version of the API that it happens to be relevant to. At the moment that
is not a concern so the flatter structure should work fine.
Change-Id: I07bb776c7713283283c86a2907e1c0ba1c763b79
Most of the copy is duplicated except for the places where it matters.
This allows for any page of this documentation to be page one. If
someone only cares about using hosts first, they can go directly there
and start listing hosts, creating them, etc. without much other
prompting.
Change-Id: Id621947af5d4c3ca53af24904f5f16d3d88bc8b8
This patch DRYs out the variables shell test cases
even further to ensure the same pattern of behavior
across all resources' variables shell
implementations.
Closes-Bug: 1670446
Change-Id: I69cc3ac025dfdcd0b0bbe2084125014cb7f659e9
This patch includes the shell integration tests
for remaining Resources' variables implementation
Change-Id: I44dc2c3463715321f70bb48514a70906d0c864ec
Closes-Bug: 1659110
This patch implements the variables support
for the remaining resources that use variables
Change-Id: I8d5515742db2d62ff1dea38c10018cc9579a82f4
Partial-Bug: 1659110
Functionality is supported both for the Python client:
host = craton.hosts.get(item_id=8)
host.variables.update(x='foo', y={'a': 47, 'b': True}, z='baz')
host.variables.delete("foo", "bar", "baz")
As well as for the CLI:
craton host-vars-get 1
craton host-vars-set 3 x=true y=47 z=foo/bar w=3.14159
cat <<EOF | craton host-vars-set 13
{
"glance_default_store": "not-so-swift",
"neutron_l2_population": false,
"make_stuff_up": true,
"some/namespaced/variable": {"a": 1, "b": 2}
}
EOF
craton --format json host-vars-get 13 | jq -C
craton host-vars-delete 13 make_stuff_up
craton host-vars-set 13 x= y=42 # deletes x
This patch implements the basis for supporting this
in other resources as well, however we only address
hosts here as an initial implementation. We will
fast-follow with support in other resources.
Partial-Bug: 1659110
Change-Id: Id30188937518d7103d6f943cf1d038b039dc30cc
The whole point of devices is to be able to see
a parent of a device. So this patch includes parent id
in the default fields to display for all device-list
commands.
Change-Id: I797ac42adae9b8c5afae5710741dcd8fee68d4c3
Adds the ability to search cell by its defined
variables.
Allowed query:
cell-list --vars='a:b' --vars='c:d'
or
cell-list --vars='a:b,c:d'
Closes-Bug: 1669760
Change-Id: Iac4ec9dcb91280603f313223baf10b82916da8f1
- Region listing is missing filtering using
variables. This patch allows users to filter
region listing using --vars='a:b', and we can
use multiple vars filters using the form
--vars='a:b' --vars='c:d'
or
--vars='a:b,c:d'
Closes-Bug: 1669457
Change-Id: I0e0cabaec8b399170902a0e3c0527d839d419913
Since we no longer rely on print_dict/print_list we can remove it and
all of our test scaffolding that supported their usage.
Change-Id: I68dd335bf6cc3a50cdbf081d1a708595f914a949
I missed this module in If5906780e501c7b9ba93ecf54a7bcf6db5ddfa1c
Closes-bug: #1659103
Closes-bug: #1659427
Closes-bug: #1668221
Change-Id: I4c3e3503568d426c116bdde48e2b11848f0d6aef
This changes how we sort columns in listings and how we display the
column headings. The default columns are now stored as lists so that
they are the same from run to run. This simplifies some of the logic in
the shell modules as well. Instead of keeping static mappings of
attributes to column headings, we now use some simple python logic, to
title case the columns.
This commit covers:
- cell-* commands
- cloud-* commands
- host-* commands
- project-* commands
- region-* commands
Finally, we noticed that the cloud-list and region-list commands were
behaving differently from the rest of the -list commands. This
unifies the interface to add the --detail flag.
Closes-bug: #1659103
Closes-bug: #1659427
Closes-bug: #1668221
Change-Id: If5906780e501c7b9ba93ecf54a7bcf6db5ddfa1c
This commit adds a new command, 'craton device-list', to support the
endpoint /v1/devices. Currently the endpoint only supports GET requests.
The command supports filtering by cloud, cell, region, parent and active
status. In addition, where a parent is specified, it is also possible to
request descendants.
The API response body is of the form:
{
"devices: {
"hosts": [
],
"network-devices": [
],
},
"links": [
],
}
This object differs, from the other response bodies that return
collections, in that devices is not an array but is instead an object
whose values are arrays. This difference has necessitated modifying the
list and pagination functionality to support nested data.
Change-Id: I7cdec9935a360dae3910802f210ab9341ef7a696
Closes-bug: 1668705