Commit 716a15a5 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis

Merge branch 'release-0.13'

parents 2632294b f61c5d60
Copyright 2011-2013 GRNET S.A. All rights reserved.
Copyright 2011-2014 GRNET S.A. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
......
Changelog for 0.12.10
- Bugfix: --diagnostics works
- Bugfix: Alow unicode image names (#5110)
- Bugfix: Fix HTTP headers in image members add (#5115)
Changelog for 0.12.9
- Bugfix: --unpublish didn't work in kamaki image modify
Changelog for 0.12.8
- Fix image property-del bug (made it a required argument of image modify) [#4940]
- Sync kamaki documentation for image property updates [#4940]
Changelog for 0.12.7
- Restore user_info, user_term for bw compatibility in AstakosClient [#4880]
Changelog for 0.12.6
- Restore get_service_endpoints for AstakosClient
Changelog for hotfix version 0.12.5
- Fix bug in readall (wrong behavior in non-regular files) [#4871]
Changelog for hotfix version 0.12.4
- Fix bug when registering image with upload but no metafile [#4864]
- Minor typos
CHANGELOG for hotfix version 0.12.3
- Import the whole astakosclient package
- Minor typos in help message
CHANGELOG for hotfix version 0.12.2
- Always use "details" call in neworks/subnets list
- Restore server console, remove --vnc option from server info
- Fix server create --networks|--no-networks
- Use --status in * wait commands
- Fix typos in documentation
CHANGELOG for hotfix version 0.12.1
- Various minor typos
- Rename comand group "kamaki project membership" --> "kamaki membership"
- Add docs for astakos-related commands:
user, quota, resources, project, membership
- Correct/simplify network arguments in server create (#4563)
CHANGELOG for version 0.12
Bug Fixes:
- In file list, the path or prefix was converted to boolean value. Fixed.
- Thread options did not work [#4616]
- Various minor typos
Changes:
1. Make astakosclient a mantatory requirement for kamaki [#4312]
2. Make post_user_catalogs obsolete, but keep for one more version [#4337]
3. Rename user commands for cached account requests as /user session [#4340]
4. Remove max_theads from config, move control to threaded commands [#4617]
5. Modify all commands [#4583]
New scheme for ALL <object> <verb> [object id] [--arguments]
e.g., file modidy --metadata-add=revier='Mr. Reviewer' /pithos/myfile.txt
6. Deprecate (with note) server stats/console/addr (move to server info)
7. A vanilla kamaki call now shows only the available commands instead of
loading a shell [#4612]
8. Add self.poolsize at kamaki.clients.Client
9. Add ip attach/detach (shortcuts for port create/delete)
Features:
1. Cache user catalog calls [#4337]
2. Implement separate methods for uuid2usernames and v.v. [#4337]
3. Move all methods from snf-astakos.py to astakos.py, with some renaimings
astakos_quotas/uuid/username/authenticate --> user_quotas/uuid2username/username2uuid/info
astakos_... --> admin_...
e.g.,
astakos_services --> admin_service, astakos_commission --> admin_commission
4. Implement OpenStack Network API 2.0, with synnefo/cyclades extentions. New:
network info/list/create/delete/set
subnet info/list/create/set
port info/list/create/delete/set
5. Create a kamaki-shell for kamaki shell [#4612]
.. _Changelog:
Unified Changelog file for Kamaki versions >= 0.13
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. _Changelog-0.13:
v0.13
=====
Released: Tue Nov 18 11:13:58 EET 2014
Features
--------
* Name and Type filters in endpoint list
* In image register, meta gets same sharing as image
* Allow image register to auto-resolve remote path from local file
* Merge ClientError and AstakosClientException --> AstakosClientError
* Restore kamaki file publish/unpublish
* Accept username or UUID in kamaki file --account/--to-account
* History has now a buffer limit
* Slice notation in history show
* Datetime support in DateArgument
* Resources can be reassigned to projects
* Update account API commands to reflect changes in synnefo 0.16
* Implement a get_endpoint_url method and use it
* Rename kamaki.clients.Client.base_url --> endpoint_url, keep BW compatibility
* Remove deprecated --hard argument in "kamaki server reboot"
* Modify upload and download command semantics, to be more intuitive
* Implement more console types (vnc-ws and vnc-wss)
* Support secure HTTP connections with SSL [grnet/kamaki#54]
Support
-------
* Adjust project commands to project_API changes
* Add "dateutils" to dependencies
* Rename packages, classes and objects to conform to pep8 standards
* Use the term "project_id" instead of "project" everywhere in kamaki.clients
* Update library documentation with examples [grnet/kamaki#49]
Bug Fixes
---------
* Register image with upload but no metafile
* Minor typos and updates in command help messages
* All URL-related params are now URL-encoded
* In file list, show all directories as directories
* Do not let file-* cmds to create containers
* Fix unicode-related bugs in error reporting
* Modify HTTP logs and console output to escape control characters
[grnet/kamaki#32]
* Fix bug of incorrectly suppressed errors in "kamaki network create"
[grnet/kamaki#56]
* Set a default logger to LoggedAstakosClient [grnet/kamaki#58]
* Show the correct name when switching kamaki users
[grnet/kamaki#66]
* Fix Python 2.6 compatibility concerning HTTPS arguments
[grnet/kamaki#73]
* Fix Python 2.6 compatibility concerning encode parameters
* Rename "raise_ssl_errors" to "ignore_ssl" in HTTPConnection class
[grnet/kamaki#74]
* Warn or raise errors when the configuration file is inaccessible
[grnet/kamaki#71]
* Handle non-ascii characters when managing configuration options
[grnet/kamaki#76]
* Handle SSL unicode bug with grace [grnet/kamaki#67]
* Check server status before changing it [grnet/kamaki#57]
* Fix format of "create_volume" return values
* Support old history files [grnet/kamaki#80]
include README.rst COPYRIGHT Changelog
include README.md COPYRIGHT Changelog
recursive-include docs *
prune docs/_build
......@@ -13,8 +13,6 @@ kamaki 0.12
e.g., kamaki server create --name=NAME --image-id=IMAGE_ID --flavor-id=FLAVOR_ID
kamaki image register --name=NAME --location=IMAGE_LOCATION
3. kamaki.clients.astakos.AstakosClient is now imported from python astakosclient.AstakosClient
Config file
-----------
......
./kamaki
========
Overview
--------
./kamaki is a multipurpose, interactive command-line tool, and also a
client development library for managing OpenStack clouds.
As a development library, it implements the OpenStack APIs, along with the
custom extensions introduced by [Synnefo](http://www.synnefo.org).
./kamaki is open source and released under a 2-clause BSD License.
Project Page
------------
Please see the [official Synnefo site](http://www.synnefo.org) and the
[Synnefo documentation](http://www.synnefo.org) for more information.
Copyright and license
=====================
Copyright (C) 2011-2014 GRNET S.A. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
1. Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A. OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and
documentation are those of the authors and should not be
interpreted as representing official policies, either expressed
or implied, of GRNET S.A.
README
=======
./kamaki is a multipurpose, interactive command-line tool and also a client
development API for managing clouds.
As a development API, it is an initial implementation of the Synnefo API
( http://www.synnefo.org cloud management software extends OpenStack ), while
preserving compatibility with the OpenStack API.
......@@ -66,6 +66,12 @@ project (Astakos)
terminate Terminate a project (special privileges needed)
application Application management commands
reinstate Reinstate a terminated project (special privileges needed)
join Join a project
dismiss Dismiss your denied application
deny Deny an application (special privileges needed)
enroll Enroll a user to a project
cancel Cancel your application
approve Approve an application (special privileges needed)
membership (Astakos)
--------------------
......@@ -73,8 +79,6 @@ membership (Astakos)
.. code-block:: text
info Details on a membership
enroll Enroll somebody to a project you manage
join Join a project
list List all memberships
accept Accept a membership for a project you manage
leave Leave a project you have membership to
......@@ -88,7 +92,6 @@ quota (Account/Astakos)
.. code-block:: text
list Get user quotas
info Get quota for a service (cyclades, pithos, astakos)
resource (Astakos)
------------------
......@@ -211,7 +214,7 @@ server (Compute/Cyclades)
start Start an existing virtual server
shutdown Shutdown an active virtual server
delete Delete a virtual server
console Create a VMC console and show connection information
console Create a VNC console and show connection information
wait Wait for server to finish [BUILD, STOPPED, REBOOT, ACTIVE]
Showcase: Create a server
......@@ -365,7 +368,7 @@ Showcase: Connect a network to a VM
11688 (An Ubuntu server)
* Try network-connect (to get help) *
[network]: connect
[network]: connect
Syntax error
usage: connect <network id> --device-id <DEVICE_ID> [-s] [-h] [-i] [--config CONFIG]
......@@ -380,7 +383,7 @@ Showcase: Connect a network to a VM
-v,--verbose: More info at response
* Connect VM with id 11687 to network with id 1409
[network]: connect 11687 --device-id=1409 --wait
[network]: connect 1409 --device-id=11687 --wait
Creating port between network 1409 and server 11687
New port: 8
......@@ -402,12 +405,12 @@ Showcase: Connect a network to a VM
updated : 2012-11-23T17:18:25.095225+00:00
* Get connectivity details on VM with id 11687 *
[network]: /server info 11687 --nics
[network]: /server info 11687 --nics
nic-11687-1
ipv4 : 192.168.1.1
ipv6 : None
mac_address: aa:0f:c2:0b:0e:85
network_id : 1409
ipv4 : 192.168.1.1
ipv6 : None
mac_address : aa:0f:c2:0b:0e:85
network_id : 1409
firewallProfile: DISABLED
nic-11687-0
ipv4 : 83.212.106.111
......@@ -417,6 +420,57 @@ Showcase: Connect a network to a VM
.. Note:: In kamaki shell, / is used to access top-level command groups while working in command group contexts
volume (Block Storage)
----------------------
.. code-block:: text
info Get details about a volume
list List volumes
create Create a new volume
modify Modify a volumes' properties
reassign Reassign volume to a different project
type Get volume type details
types List volume types
delete Delete a volume
Showcase: Create a volume
^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: console
$ kamaki volume create --server-id=11687 --name='Small Volume' --size=2
id: v0lum31d
name: Small Volume
size: 2
...
$ kamaki volume list
v0lum31d Small Volume
snapshot (Block Storage)
------------------------
.. code-block:: text
info Get details about a snapshot
list List snapshots
create Create a new snapshot
modify Modify a snapshots' properties
delete Delete a snapshot
Showcase: Create a snapshot
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: console
$ kamaki snapshot create --volume-id=v0lum31d --name='Small Snapshot'
id: sn4p5h071d
name: Small Snapshot
...
$ kamaki snapshot list
sn4p5h071d Small Snapshot
...
container (Storage/Pithos+)
---------------------------
......@@ -492,7 +546,7 @@ Showcase: Upload and download a file
[file]: /container create mycont2
* List accessible containers *
* List accessible containers *
[file]: /container list
1. mycont1 (0B, 0 objects)
2. mycont2 (0B, 0 objects)
......
......@@ -123,13 +123,13 @@ master_doc = 'index'
# General information about the project.
project = u'Kamaki'
copyright = u'2013, GRNET'
copyright = u'2014, GRNET'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.12'
version = '0.13'
# The full version, including alpha/beta/rc tags.
try:
......
This diff is collapsed.
This diff is collapsed.
......@@ -10,7 +10,7 @@ astakos
^^^^^^^
Features: user, project, quota, resource, commission, endpoint, service
.. automodule:: kamaki.cli.commands.astakos
.. automodule:: kamaki.cli.cmds.astakos
:members:
:undoc-members:
......@@ -19,7 +19,7 @@ cyclades
Features server, flavor
.. automodule:: kamaki.cli.commands.cyclades
.. automodule:: kamaki.cli.cmds.cyclades
:members:
:undoc-members:
......@@ -28,7 +28,7 @@ pithos
Features file, container, sharer, group
.. automodule:: kamaki.cli.commands.pithos
.. automodule:: kamaki.cli.cmds.pithos
:members:
:undoc-members:
......@@ -37,7 +37,7 @@ image
Features (image, imagecompute)
.. automodule:: kamaki.cli.commands.image
.. automodule:: kamaki.cli.cmds.image
:members:
:undoc-members:
......@@ -47,7 +47,7 @@ network
Features network, port, subnet, ip
.. automodule:: kamaki.cli.commands.network
.. automodule:: kamaki.cli.cmds.network
:members:
:undoc-members:
......@@ -57,7 +57,7 @@ Kamaki commands
config
""""""
.. automodule:: kamaki.cli.commands.config
.. automodule:: kamaki.cli.cmds.config
:members:
:undoc-members:
......@@ -65,7 +65,7 @@ config
errors
^^^^^^
.. automodule:: kamaki.cli.commands.errors
.. automodule:: kamaki.cli.cmds.errors
:members:
:show-inheritance:
:undoc-members:
......
This diff is collapsed.
......@@ -69,33 +69,21 @@ External applications must instantiate a MyNewClient object.
Concurrency control
-------------------
Kamaki clients may handle multiple requests at once, using threads. In that
case, users might implement their own thread handling mechanism, use an
external solution or take advantage of the mechanism featured in kamaki.clients
Kamaki clients may handle multiple requests with threads. The easiest way is
using the `async_run` method, fed with a list of argument dictionaries (one for
each call of the single method).
.. code-block:: python
from threading import enumerate
from kamaki.clients import SilentEvent
...
class MyNewClient(Client):
...
def _single_threaded_method(self, **args):
...
request code
...
def multithread_method(self):
thread_list = []
self._init_thread_limit()
while some_condition or thread_list:
...
event = SilentEvent(self._single_threaded_method, **args)
event.start()
thread_list.append(event)
thread_list = self._watch_thread_limit(thread_list)
kwarg_list = [kwarg for each run]
self.async_run(self._single_threaded_method, kwarg_list)
Going agile
-----------
......@@ -109,19 +97,17 @@ APIs.
Using the tests
^^^^^^^^^^^^^^^
To run the tests, the kamaki source code has to be downloaded.
.. code-block:: console
First, the source code of kamaki must be accessible. If this is not the case,
the source code can be obtained from here:
$ git clone https://code.grnet.gr/git/kamaki
$ cd kamaki/kamaki/clients
`https://code.grnet.gr/projects/kamaki/files <https://code.grnet.gr/projects/kamaki/files>`_
In each package under kamaki.clients, there is a test module (test.py) where
the tests are implemented. To run all tests, run the test.py file from
kamaki.clients
In each package under kamaki.clients, there is a test module (`test.py`). To
run all tests, run the test.py file from kamaki.clients
.. code-block:: console
$ cd ${KAMAKI_SOURCE_LOCATION}/kamaki/clients
$ python test.py
To test a specific class, add the class name as an argument. e.g., for the
......@@ -166,9 +152,9 @@ to test everything in kamaki.clients.pithos package:
Mechanism
^^^^^^^^^
Each folder / package contains a test.py file, that represents the test module
of this package. All test modules contain a set of classes that extent the
TestCase class. They also contain a main method to run the tests.
Each folder / package contains a test.py file, where its test module lived. All
test modules contain a set of classes that extent the TestCase class. They also
contain a main method to run the tests.
By convention, testing classes have the same name as the class they test.
Methods not grouped in classes are tested by classes named after their
......@@ -204,7 +190,7 @@ Adding a new method
To implement a new method in an existing class, developers are encouraged to
implement the corresponding unit test first. In order to do that, they should
find the testing class that is mapped to the class or module they working on.
find the testing class that is mapped to the class or module they work on.
Example: Adding **list_special** to *kamaki.clients.astakos.AstakosClient*,
requires changes to *kamaki.clients.astakos.test.AstakosClient* too, as shown
......@@ -236,7 +222,7 @@ Example 1: To add a NewService class that implements *kamaki.clients.Client*:
$ mkdir new_service && touch new_service/test.py
* create the file to code the package implementation:
* create the package file for the package implementation:
.. code-block:: console
......@@ -254,7 +240,8 @@ Example 1: To add a NewService class that implements *kamaki.clients.Client*:
def test_method1(self):
...
* Create the NewService and its actual functionality in kamaki.clients.new_service
* Create the NewService and its actual functionality in
kamaki.clients.new_service
.. code-block:: python
......
Logging
=======
Kamaki uses the standard Python logger package to log some of its functionality.
Kamaki uses the standard Python logger.
All kamaki loggers are named or prefixed after the package they log, e.g.,
a logger at `kamaki/cli/argument/__init__.py` should be called
......@@ -32,18 +32,19 @@ using the Python `logger` package, or the corresponding kamaki wraper
`kamaki.cli.logger` which allows the definition, activation and deactivation
of stream (usually console) or file loggers.
As an example, we will use
We will use
`this script <clients-api.html#register-a-banch-of-pre-uploaded-images>`_
that loads images from a set of image files already uploaded to Pithos+
`images` container.
as an example to work on. The script registers images from a set of
pre-uploaded image files.
First, we shall add a logger to keep HTTP communication in `/tmp/my_kamaki.log`
First, we shall add a logger to track HTTP communication in `/tmp/my_kamaki.log`
To do this, append the following at the top of the file:
.. code-block:: python
from kamaki.cli.logger import add_file_logger
add_file_logger('kamaki', filename='/tmp/my_kamaki.log')
add_file_logger('kamaki.clients.send', filename='/tmp/my_kamaki.log')
add_file_logger('kamaki.clients.recv', filename='/tmp/my_kamaki.log')
After a run of the script, a new file will be created at `/tmp/my_kamaki.log`
that will contain logs of the form::
......@@ -76,7 +77,6 @@ of the `pithos.list_objects()` method and print these to stdout. To achieve
that goal, we should get a stream logger and deactivate it when we do not need
it anymore.
.. code-block:: python
#! /usr/bin/python
......@@ -94,10 +94,8 @@ Logger in kamaki code
---------------------
When implementing kamaki code, either as part of the main kamaki project or as
an extension, it is often useful to use loggers. The suggested strategy is to
use `kamaki.cli.logger` to create one logger per package, named after the
package itself. Developers may also directly use the Python logger module, but
they should respect the naming conventions.
an extension, it is often useful to use loggers. Developers may also directly
use the Python logger module with respect to the naming conventions.
In this example, we want to log the arguments of the `register` method found in
`kamaki/clients/image/__init__.py`. We will use the Python logger module.
......@@ -123,21 +121,12 @@ Now, we should use the `log` biding to actually log what we need.
log.debug('properties: %s' % properties)
[...]
The logging module will not log anything by itself. It is the caller scripts
responsibility to define the actual logger and set the logging destination.
We are going to use the same script as in the previous examples, but we need
to define logger for `kamaki.clients.image`.
Loggers defined in higher levels of the package hierarchy are inherited. This
may cause duplication in logs. Use either a high level loger (e.g. 'kamaki' or
'kamaki.clients') to log everything, or a specific logger (e.g.
'kamaki.clients.image').
.. code-block:: python