150 Commits

Author SHA1 Message Date
Ian Cordasco
68df0e30c7 Enable less code in cratonclient resources
Previously, resource managers were overriding __init__, list, and create
to include extra parameters, e.g., region_id. This slightly alters the
base CRUDClient to accept extra request keyword arguments to merge into
each request's arguments.

Change-Id: Ia850417c7a94eea95d35c8a93141c70945d1a800
2016-10-27 07:33:05 -05:00
Jenkins
a42802fb04 Merge "Add tests for our Region and RegionManager classes" 2016-10-27 12:14:42 +00:00
Jenkins
f3c9309657 Merge "Fix existing and add new inventory tests" 2016-10-27 12:14:23 +00:00
Jenkins
51f353acbf Merge "Add new tests for the cratonclient.crud module" 2016-10-27 12:13:16 +00:00
Ian Cordasco
d47c2c794f Add tests for our Region and RegionManager classes
Minimalistic though they might be, it makes sense to test everything we
can think of, including these two classes in cratonclient.v1.regions.

If we build up our testing from first principles there are things we
don't need to test about these classes. For example, we've already
written a number of tests around both cratonclient.crud.CRUDManager and
cratonclient.crud.Resource so those tests need not be duplicated here.

Change-Id: Ia5c0c8c55d78aa5c78e063163bc803525f96ed34
2016-10-26 14:35:35 -05:00
Ian Cordasco
ced0a45cef Fix existing and add new inventory tests
We were accidentally passing a tuple to the Inventory object. Because of
how we write our tests, we did not catch this.

Change-Id: I947c7905c73017cff5860c869347aaaaa7e518d6
2016-10-26 14:35:35 -05:00
Ian Cordasco
031361801d Add new tests for the cratonclient.crud module
This adds unit-only testing for the CRUDManager and Resource classes in
cratonclient.crud to solidify our testing posture in cratonclient.

In the process of writing these tests, I also identified and fixed a
couple tiny bugs introduced by copying the crud module over from
keystoneclient.

Change-Id: I85103fae92f6135facee39c1bf7afb11e8ca1030
2016-10-26 14:35:32 -05:00
Chris Spencer
afc34fb2b8 Adding region update capabilities to python and CLI clients.
CLI: region-update <region_id> <args>
python: region.update(region_id, args)

Change-Id: Ic52bcc23a85859a3284fa0ddb8e8acddecb053ad
Implements: blueprint craton-client-access-inventory (partial)
Closes-Bug: #1613345
2016-10-25 14:46:00 -07:00
Chris Spencer
d021b036c0 Adding region deletion functionality to clients.
Adding region-delete to CLI and region.delete() to python clients

Change-Id: I54c97633df33b87f3bad13c4dcab9c0ba65e9bcc
Implements: blueprint craton-client-access-inventory (partial)
Closes-Bug: #1613339
2016-10-24 14:13:08 -07:00
Ian Cordasco
4c7569df22 Filter endpoints in service catalog by type
When I originally added support for using Keystone for authenticating to
Craton, I made a mistake in setting a keyword argument of
"service_type". The correct way to use keystoneauth1 to filter the
endpoint by service type is to specify an endpoint filter dictionary
that specifies the service_type as "fleet_management"

Change-Id: I6dcdde351d5e2051105df904b2d936abafbcc231
2016-10-20 11:14:17 -05:00
Jenkins
5e9ee807dd Merge "Adds console script and fix command line parsing" 2016-10-19 18:15:04 +00:00
Jenkins
730def2740 Merge "Avoid storing project_id on class instances" 2016-10-19 18:04:43 +00:00
Jenkins
128b834f18 Merge "Adding region-show capabilities to clients." 2016-10-18 16:12:29 +00:00
Sulochan Acharya
67718cb443 Adds console script and fix command line parsing
- Adds console script so that we can run craton <command>
from the shell.
- Some simple cleanup.

Change-Id: Ic50ee734d7e60190d6f7808c63f782c2c20589d3
2016-10-18 17:04:25 +01:00
Ian Cordasco
a12e2cc548 Avoid storing project_id on class instances
As of I40d0e8b6a3260ff11c493268c8a0553eba62512b, craton will no longer
require users to specify the project id in the headers and request body.

Change-Id: Ifb253b5d1f7a5df0e66ec15f5d1b1bf57b8a937b
Depends-On: I40d0e8b6a3260ff11c493268c8a0553eba62512b
Related-Bug: 1628845
2016-10-14 13:09:41 -05:00
Ian Cordasco
e9e8ac4158 Switch to using keystoneauth by default
By using keystoneauth as the default transport layer for cratonclient we
can handle both the case where craton is deployed without Keystone as
well as the case where it is deployed with Keystone for identity and
authentication.

Change-Id: I69a6a742832c3571523d30a04be1cc4bd3da1e7b
2016-10-05 14:21:38 -05:00
Chris Spencer
d865a4da95 Adding region-show capabilities to clients.
Added region-show to CLI client and region.get() to python client.

Change-Id: I8343f84a94c700d543de8b58c12cdcde4cefc817
Implements: blueprint craton-client-access-inventory (partial)
Closes-Bug: #1613344
2016-09-28 08:41:41 -07:00
Chris Spencer
f3de28a73a Adding cell client functionality.
Adds CLI and python cell crud functionality as well as testing.

Change-Id: I9d75746ddd9139d7ad43ad249b1ffbbb5c4015a4
Implements: blueprint craton-client-access-inventory (partial)
Closes-Bug: #1613346
Closes-Bug: #1613347
Closes-Bug: #1613349
Closes-Bug: #1613350
2016-09-27 13:19:07 -07:00
Jenkins
a031680530 Merge "Adding support for creating a region." 2016-09-27 16:16:51 +00:00
Chris Spencer
3ea83693fe Adding host-delete functionality.
Adds CLI and python host deletion functionality as well as testing.

Change-Id: I0cadd6f3681a5a09b58553aeb7ee8315e77e081f
Implements: blueprint craton-client-access-inventory (partial)
Closes-Bug: #1607851
2016-09-23 09:14:41 -07:00
Chris Spencer
ce2ed2889a Adding host-update and host-show capabilities to client.
Adding patch capability to crud client
Adding unit tests surrounding host update and show functionality.

Implements: blueprint craton-client-access-inventory (partial)
Closes-Bug: #1611419
Change-Id: Ie0c8868c0f793d480bf899edee802ce9a60c476b
2016-09-21 15:33:41 -07:00
Chris Spencer
92de5c1c2f Updating host API to utilize the inventory API
- Fixed host-list command to require the region id.
- Fixed unit tests to use inventory API
- Fixed a spelling issue.

Change-Id: I5cd67ceca1f0b5a3c5628c42e1f7806b5eb7f3fe
2016-09-21 14:24:23 -05:00
Chris Spencer
743898d75a Adding support for creating a region.
Adding ability to create region in both python and CLI clients.
Adding doctests and unit tests for region creation.

Change-Id: I59bcf4e727d3fd7ed6d55a58560fcf48eed8cb3d
Implements: blueprint craton-client-access-inventory (partial)
Closes-Bug: #1611418
2016-09-16 12:49:42 -07:00
Jenkins
6762b40533 Merge "Adding support for creating a host." 2016-09-12 18:33:23 +00:00
Chris Spencer
8b4463d24d Adding support for creating a host.
Adding ability to create a host in both python and cli clients

Adding unit tests for verifying error message on incorrect args
and verifying host created.

Implements: blueprint craton-client-access-inventory (partial)
Closes-Bug: #1607843
Change-Id: I61dbe53392a4f3c00ad50eec774e8844cd2c864d
2016-09-02 13:24:38 -05:00
Jenkins
b7a527e269 Merge "Adding Inventory class." 2016-08-31 18:22:21 +00:00
Chris Spencer
561a6c5b9c Adding Inventory class.
Inventory will be access point for all sub entities to create an
intuitive API for python developers to use when trying to access
inventory entities (cells, hosts, etc).

Change-Id: Icea217103c735ad53f029dac9cfd405281a1a715
2016-08-26 14:36:21 -04:00
Andreas Jaeger
6782b6b582 Cleanup tox.ini: Remove obsolete constraints
Remove old and unused constraints environments from tox.ini. Those
have never been used. Use standard environments as default list.

Note that the repo has in the past not used constraints in OpenStack
CI, this change keeps the status quo.

For more information about constraints see:
http://lists.openstack.org/pipermail/openstack-dev/2016-August/101474.html

Change-Id: I9a5a595cffe5d975fc3b0ef4a9478adff68c9cd4
2016-08-26 18:11:59 +02:00
Chris Spencer
052caea612 Added optional arguments to host-list command and unit tests.
Implemented handling of argument values as well as defined
acceptable field values for hosts.

Change-Id: I2fc2267d402a87e09c059dfdc8b10d86e8eeb69c
2016-08-08 15:38:29 -05:00
Chris Spencer
d4f0c1ccb8 Created shell support for hosts_list and sub command parsing.
Added  hosts_shell, tests_hosts_shell, and common package for cliutils
to support handling hosts-list sub command with no arguments. In parallel,
the ability to handle subcommand parsing was implemented in a basic form
in order to implement and test "craton host-list" with no additional args.

Added optional arguments to craton shell and accompanying unit tests for username, password, and url to enable creating a session and instantiate the client properly to enable other unit tests without hardcoding dummy values.
Change-Id: I05a42a06e0436e7a0de6b898d4d6e50168e6dd36
2016-07-29 08:07:36 -07:00
ChristopherMSpencer
c123f0e35d Add help to shell (#2) 2016-07-06 11:18:58 -05:00
ChristopherMSpencer
2046c486e7 Merge pull request #5 from ChristopherMSpencer/read_the_docs_conf
updating conf to include READTHEDOCS env
2016-06-24 13:41:20 -05:00
Chris Spencer
929307a0c4 Merge branch 'read_the_docs_conf' of github.com:ChristopherMSpencer/python-cratonclient into read_the_docs_conf 2016-06-24 13:38:34 -05:00
Chris Spencer
018730f9c3 updating conf to include READTHEDOCS env 2016-06-24 13:37:36 -05:00
Chris Spencer
a8f2cbbaaf updating conf to include READTHEDOCS env 2016-06-24 08:45:09 -05:00
Ian Cordasco
ffcc21309a Merge pull request #4 from opstooling/fix-pep8
Fix pep8 test job
2016-06-23 15:38:11 -05:00
Ian Cordasco
469e0d255d Add missing oslo.utils dependency 2016-06-23 15:29:03 -05:00
Ian Cordasco
f0ae354ebc Fix up code-base to pass hacking 2016-06-23 15:29:03 -05:00
Ian Cordasco
3dc514770a Merge pull request #3 from ChristopherMSpencer/add_travisci
Adding travis.yml file for CI
2016-06-23 15:16:26 -05:00
Chris Spencer
60b77b1faf Adding travis.yml file for CI 2016-06-23 15:00:45 -05:00
Ian Cordasco
d30f605ec7 Add Apache header to all files 2016-06-23 13:10:08 -05:00
Ian Cordasco
15cce98eb6 Remove unnecessary file 2016-06-23 13:09:10 -05:00
Ian Cordasco
76da8b09f1 Merge pull request #1 from ChristopherMSpencer/init_shell
Added basic main shell architecture and initial unit test
2016-06-22 11:54:56 -05:00
Chris Spencer
a359255ae4 Merge branch 'init_shell' of https://github.com/ChristopherMSpencer/python-cratonclient into init_shell 2016-06-21 09:56:56 -05:00
Chris Spencer
44098bd6f7 Added basic main shell architecture and initial unit test 2016-06-21 09:49:50 -05:00
Chris Spencer
c6ff796aa6 Added basic main shell architecture and initial unit test 2016-06-21 09:01:54 -05:00
Ian Cordasco
7d27ce396c Follow PEP-0257 2016-06-17 16:45:51 -05:00
Ian Cordasco
686eb107a1 Add hosts to the v1 client 2016-06-16 16:24:46 -05:00
Ian Cordasco
565eb70f30 Add basic client work + regions support 2016-06-16 14:52:23 -05:00
Ian Cordasco
bb75f151fb Initial Cookiecutter Commit. 2016-06-14 09:52:51 -05:00