Retire Packaging Deb project repos
This commit is part of a series to retire the Packaging Deb project. Step 2 is to remove all content from the project repos, replacing it with a README notification where to find ongoing work, and how to recover the repo if needed at some future point (as in https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project). Change-Id: I0274215dc8f63eceb398fda48775dc4284d4d9c9
This commit is contained in:
parent
02d8c1845f
commit
bd7809a8f6
|
@ -1,21 +0,0 @@
|
|||
*~
|
||||
*.pyc
|
||||
*.dat
|
||||
TAGS
|
||||
*.egg-info
|
||||
*.egg
|
||||
build
|
||||
.coverage
|
||||
.tox
|
||||
cover
|
||||
venv
|
||||
.venv
|
||||
*.sublime-workspace
|
||||
*.sqlite
|
||||
.*.swp
|
||||
.DS_Store
|
||||
.testrepository
|
||||
versioninfo
|
||||
var/*
|
||||
ChangeLog
|
||||
AUTHORS
|
|
@ -1,4 +0,0 @@
|
|||
[gerrit]
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=openstack/python-zaqarclient.git
|
288
HACKING.rst
288
HACKING.rst
|
@ -1,288 +0,0 @@
|
|||
Zaqar Style Commandments
|
||||
========================
|
||||
|
||||
- Step 1: Read http://www.python.org/dev/peps/pep-0008/
|
||||
- Step 2: Read http://www.python.org/dev/peps/pep-0008/ again
|
||||
- Step 3: Read on
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 2
|
||||
:backlinks: none
|
||||
|
||||
|
||||
General
|
||||
-------
|
||||
- Optimize for readability; whitespace is your friend.
|
||||
- Put two newlines between top-level code (funcs, classes, etc.)
|
||||
- Put one newline between methods in classes and anywhere else.
|
||||
- Use blank lines to group related logic.
|
||||
- Never write ``except:`` (use ``except Exception:`` instead, at
|
||||
the very least).
|
||||
- All classes must inherit from ``object`` (explicitly).
|
||||
- Use single-quotes for strings unless the string contains a
|
||||
single-quote.
|
||||
- Use the double-quote character for blockquotes (``"""``, not ``'''``)
|
||||
- USE_ALL_CAPS_FOR_GLOBAL_CONSTANTS
|
||||
|
||||
Comments
|
||||
--------
|
||||
- In general use comments as "memory pegs" for those coming after you up
|
||||
the trail.
|
||||
- Guide the reader though long functions with a comments introducing
|
||||
different sections of the code.
|
||||
- Choose clean, descriptive names for functions and variables to make
|
||||
them self-documenting.
|
||||
- Include your name with TODOs as in ``# TODO(termie): blah blah...``.
|
||||
- Add ``# NOTE(termie): blah blah...`` comments to clarify your intent, or
|
||||
to explain a tricky algorithm, when it isn't obvious from just reading
|
||||
the code.
|
||||
|
||||
|
||||
Identifiers
|
||||
-----------
|
||||
- Do not give anything the same name as a built-in or reserved word.
|
||||
- Don't use single characters in identifiers except in trivial loop variables and mathematical algorithms.
|
||||
- Avoid abbreviations, especially if they are ambiguous or their meaning would not be immediately clear to the casual reader or newcomer.
|
||||
|
||||
Wrapping
|
||||
--------
|
||||
Wrap long lines by using Python's implied line continuation inside
|
||||
parentheses, brackets and braces. Make sure to indent the continued
|
||||
line appropriately. The preferred place to break around a binary
|
||||
operator is after the operator, not before it.
|
||||
|
||||
Example::
|
||||
|
||||
class Rectangle(Blob):
|
||||
|
||||
def __init__(self, width, height,
|
||||
color='black', emphasis=None, highlight=0):
|
||||
|
||||
# More indentation included to distinguish this from the rest.
|
||||
if (width == 0 and height == 0 and
|
||||
color == 'red' and emphasis == 'strong' or
|
||||
highlight > 100):
|
||||
raise ValueError('sorry, you lose')
|
||||
|
||||
if width == 0 and height == 0 and (color == 'red' or
|
||||
emphasis is None):
|
||||
raise ValueError("I don't think so -- values are %s, %s" %
|
||||
(width, height))
|
||||
|
||||
msg = ('this is a very long string that goes on and on and on and'
|
||||
'on and on and on...')
|
||||
|
||||
super(Rectangle, self).__init__(width, height,
|
||||
color, emphasis, highlight)
|
||||
|
||||
|
||||
Imports
|
||||
-------
|
||||
- Only modules may be imported
|
||||
- Do not make relative imports
|
||||
- Order your imports by the full module path
|
||||
- Classes and functions may be hoisted into a package namespace, via __init__ files, with some discretion.
|
||||
- Organize your imports according to the template given below
|
||||
|
||||
Template::
|
||||
|
||||
{{stdlib imports in human alphabetical order}}
|
||||
\n
|
||||
{{third-party lib imports in human alphabetical order}}
|
||||
\n
|
||||
{{zaqar imports in human alphabetical order}}
|
||||
\n
|
||||
\n
|
||||
{{begin your code}}
|
||||
|
||||
|
||||
Human Alphabetical Order Examples
|
||||
---------------------------------
|
||||
Example::
|
||||
|
||||
import logging
|
||||
import time
|
||||
import unittest
|
||||
|
||||
import eventlet
|
||||
|
||||
import zaqar.common
|
||||
from zaqar import test
|
||||
import zaqar.transport
|
||||
|
||||
|
||||
More Import Examples
|
||||
--------------------
|
||||
|
||||
**INCORRECT** ::
|
||||
|
||||
import zaqar.transport.wsgi as wsgi
|
||||
|
||||
**CORRECT** ::
|
||||
|
||||
from zaqar.transport import wsgi
|
||||
|
||||
Docstrings
|
||||
----------
|
||||
|
||||
Docstrings are required for all functions and methods.
|
||||
|
||||
Docstrings should ONLY use triple-double-quotes (``"""``)
|
||||
|
||||
Single-line docstrings should NEVER have extraneous whitespace
|
||||
between enclosing triple-double-quotes.
|
||||
|
||||
**INCORRECT** ::
|
||||
|
||||
""" There is some whitespace between the enclosing quotes :( """
|
||||
|
||||
**CORRECT** ::
|
||||
|
||||
"""There is no whitespace between the enclosing quotes :)"""
|
||||
|
||||
Docstrings should document default values for named arguments
|
||||
if they're not None
|
||||
|
||||
Docstrings that span more than one line should look like this:
|
||||
|
||||
Example::
|
||||
|
||||
"""Single-line summary, right after the opening triple-double-quote.
|
||||
|
||||
If you are going to describe parameters and return values, use Sphinx; the
|
||||
appropriate syntax is as follows.
|
||||
|
||||
:param foo: the foo parameter
|
||||
:param bar: (Default True) the bar parameter
|
||||
:param foo_long_bar: the foo parameter description is very
|
||||
long so we have to split it in multiple lines in order to
|
||||
keey things ordered
|
||||
:returns: return_type -- description of the return value
|
||||
:returns: description of the return value
|
||||
:raises: AttributeError, KeyError
|
||||
"""
|
||||
|
||||
**DO NOT** leave an extra newline before the closing triple-double-quote.
|
||||
|
||||
|
||||
Dictionaries/Lists
|
||||
------------------
|
||||
If a dictionary (dict) or list object is longer than 80 characters, its items
|
||||
should be split with newlines. Embedded iterables should have their items
|
||||
indented. Additionally, the last item in the dictionary should have a trailing
|
||||
comma. This increases readability and simplifies future diffs.
|
||||
|
||||
Example::
|
||||
|
||||
my_dictionary = {
|
||||
"image": {
|
||||
"name": "Just a Snapshot",
|
||||
"size": 2749573,
|
||||
"properties": {
|
||||
"user_id": 12,
|
||||
"arch": "x86_64",
|
||||
},
|
||||
"things": [
|
||||
"thing_one",
|
||||
"thing_two",
|
||||
],
|
||||
"status": "ACTIVE",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Calling Methods
|
||||
---------------
|
||||
Calls to methods 80 characters or longer should format each argument with
|
||||
newlines. This is not a requirement, but a guideline::
|
||||
|
||||
unnecessarily_long_function_name('string one',
|
||||
'string two',
|
||||
kwarg1=constants.ACTIVE,
|
||||
kwarg2=['a', 'b', 'c'])
|
||||
|
||||
|
||||
Rather than constructing parameters inline, it is better to break things up::
|
||||
|
||||
list_of_strings = [
|
||||
'what_a_long_string',
|
||||
'not as long',
|
||||
]
|
||||
|
||||
dict_of_numbers = {
|
||||
'one': 1,
|
||||
'two': 2,
|
||||
'twenty four': 24,
|
||||
}
|
||||
|
||||
object_one.call_a_method('string three',
|
||||
'string four',
|
||||
kwarg1=list_of_strings,
|
||||
kwarg2=dict_of_numbers)
|
||||
|
||||
|
||||
Internationalization (i18n) Strings
|
||||
-----------------------------------
|
||||
In order to support multiple languages, we have a mechanism to support
|
||||
automatic translations of exception and log strings.
|
||||
|
||||
Example::
|
||||
|
||||
msg = _("An error occurred")
|
||||
|
||||
If you have a variable to place within the string, first internationalize the
|
||||
template string then do the replacement.
|
||||
|
||||
Example::
|
||||
|
||||
msg = _("Missing parameter: %s") % ("flavor",)
|
||||
LOG.error(msg)
|
||||
|
||||
If you have multiple variables to place in the string, use keyword parameters.
|
||||
This helps our translators reorder parameters when needed.
|
||||
|
||||
Example::
|
||||
|
||||
msg = _("The server with id %(s_id)s has no key %(m_key)s")
|
||||
LOG.error(msg % {"s_id": "1234", "m_key": "imageId"})
|
||||
|
||||
An important exception to this rule is with regards to exceptions:
|
||||
exceptions should NOT be marked as translatable. See `No Exceptions i18n`_
|
||||
for more details.
|
||||
|
||||
.. _No Exceptions i18n: https://trello.com/card/exceptions-should-not-be-marked-as-translatable/511403287d138cd6200078e0/243
|
||||
|
||||
Creating Unit Tests
|
||||
-------------------
|
||||
For every any change, unit tests should be created that both test and
|
||||
(implicitly) document the usage of said feature. If submitting a patch for a
|
||||
bug that had no unit test, a new passing unit test should be added. If a
|
||||
submitted bug fix does have a unit test, be sure to add a new one that fails
|
||||
without the patch and passes with the patch.
|
||||
|
||||
NOTE: 100% coverage is required
|
||||
|
||||
openstack-common
|
||||
----------------
|
||||
|
||||
A number of modules from openstack-common are imported into the project.
|
||||
|
||||
These modules are "incubating" in openstack-common and are kept in sync
|
||||
with the help of openstack-common's update.py script. See:
|
||||
|
||||
http://wiki.openstack.org/CommonLibrary#Incubation
|
||||
|
||||
The copy of the code should never be directly modified here. Please
|
||||
always update openstack-common first and then run the script to copy
|
||||
the changes across.
|
||||
|
||||
|
||||
Logging
|
||||
-------
|
||||
Use __name__ as the name of your logger and name your module-level logger
|
||||
objects 'LOG'::
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
175
LICENSE
175
LICENSE
|
@ -1,175 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
|
@ -0,0 +1,14 @@
|
|||
This project is no longer maintained.
|
||||
|
||||
The contents of this repository are still available in the Git
|
||||
source code management system. To see the contents of this
|
||||
repository before it reached its end of life, please check out the
|
||||
previous commit with "git checkout HEAD^1".
|
||||
|
||||
For ongoing work on maintaining OpenStack packages in the Debian
|
||||
distribution, please see the Debian OpenStack packaging team at
|
||||
https://wiki.debian.org/OpenStack/.
|
||||
|
||||
For any further questions, please email
|
||||
openstack-dev@lists.openstack.org or join #openstack-dev on
|
||||
Freenode.
|
114
README.rst
114
README.rst
|
@ -1,114 +0,0 @@
|
|||
========================
|
||||
Team and repository tags
|
||||
========================
|
||||
|
||||
.. image:: http://governance.openstack.org/badges/python-zaqarclient.svg
|
||||
:target: http://governance.openstack.org/reference/tags/index.html
|
||||
|
||||
.. Change things from this point on
|
||||
|
||||
*******************
|
||||
Python Zaqar Client
|
||||
*******************
|
||||
|
||||
.. image:: https://img.shields.io/pypi/v/python-zaqarclient.svg
|
||||
:target: https://pypi.python.org/pypi/python-zaqarclient/
|
||||
:alt: Latest Version
|
||||
|
||||
.. image:: https://img.shields.io/pypi/dm/python-zaqarclient.svg
|
||||
:target: https://pypi.python.org/pypi/python-zaqarclient/
|
||||
:alt: Downloads
|
||||
|
||||
:Wiki: `Zaqar Wiki`_
|
||||
:Launchpad: `Zaqar Launchpad`_
|
||||
:Review: `Code Review`_
|
||||
:Design: `Client Wiki`_
|
||||
:IRC: #openstack-zaqar @ freenode
|
||||
|
||||
Welcome to the `Zaqar`_ Python Client project!
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 2
|
||||
:backlinks: none
|
||||
|
||||
============
|
||||
Installation
|
||||
============
|
||||
|
||||
The latest stable release can be installed from PyPI::
|
||||
|
||||
pip install --upgrade python-zaqarclient
|
||||
|
||||
For the adventurous, you may also install the latest code directly from git
|
||||
.openstack.org::
|
||||
|
||||
pip install git+https://git.openstack.org/openstack/python-zaqarclient.git
|
||||
|
||||
=================
|
||||
What's in the box
|
||||
=================
|
||||
|
||||
By installing python-zaqarclient you get programmatic access to the Zaqar v1.0
|
||||
API library. Plus, it installs a plugin to python-openstackclient that allows
|
||||
you to perform simple queue operations.
|
||||
|
||||
==========
|
||||
How to use
|
||||
==========
|
||||
|
||||
-------------
|
||||
Python client
|
||||
-------------
|
||||
|
||||
Details about design, features, usage and workflow can be found in the
|
||||
`Python Client Wiki`_.
|
||||
|
||||
.. _Python Client Wiki: https://wiki.openstack.org/wiki/Zaqar/PythonClient
|
||||
|
||||
----------------------
|
||||
Command line interface
|
||||
----------------------
|
||||
|
||||
Zaqar bases its client implementation in the `OpenStack Client`_. It can be
|
||||
installed and configured by following the instructions in *Getting Started*
|
||||
and *Configuration* in the `OpenStack Client Readme`_ respectively.
|
||||
|
||||
The CLI currently allows creation, removal and listing of queues. Some examples
|
||||
are::
|
||||
|
||||
$ openstack queue list --limit 3
|
||||
$ openstack queue create myqueue
|
||||
$ openstack queue delete myqueue
|
||||
|
||||
.. _`OpenStack Client`: https://git.openstack.org/cgit/openstack/python-openstackclient
|
||||
.. _`OpenStack Client Readme`: https://git.openstack.org/cgit/openstack/python-openstackclient/tree/README.rst
|
||||
|
||||
============
|
||||
Contributing
|
||||
============
|
||||
|
||||
Be sure to reference the `HACKING`_ file for details on coding style. You may
|
||||
also wish to read through Zaqar's `Contributor Guide`_ before contributing your
|
||||
first patch.
|
||||
|
||||
.. _Zaqar: https://git.openstack.org/cgit/openstack/zaqar
|
||||
.. _HACKING: https://git.openstack.org/cgit/openstack/python-zaqarclient/tree/HACKING.rst
|
||||
.. _Zaqar Wiki: https://wiki.openstack.org/wiki/Zaqar
|
||||
.. _Contributor Guide: https://wiki.openstack.org/wiki/Zaqar#Contributor_Guide
|
||||
.. _Zaqar Launchpad: https://launchpad.net/zaqar
|
||||
.. _Code Review: https://review.openstack.org/#/q/status:open+project:openstack/python-zaqarclient,n,z
|
||||
.. _Client Wiki: https://wiki.openstack.org/wiki/Python_Zaqar_Client
|
||||
|
||||
|
||||
* License: Apache License, Version 2.0
|
||||
* `PyPi`_ - package installation
|
||||
* `Bugs`_ - issue tracking
|
||||
* `Source`_
|
||||
|
||||
.. _PyPi: https://pypi.python.org/pypi/python-zaqarclient
|
||||
.. _Bugs: https://bugs.launchpad.net/python-zaqarclient
|
||||
.. _Source: https://git.openstack.org/cgit/openstack/python-zaqarclient
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
Zaqar service's python library documentation
|
||||
============================================
|
|
@ -1,23 +0,0 @@
|
|||
------
|
||||
Client
|
||||
------
|
||||
|
||||
.. automodule:: zaqarclient.queues.client
|
||||
|
||||
.. currentmodule:: zaqarclient.queues.client
|
||||
|
||||
|
||||
Client Object Reference
|
||||
-----------------------
|
||||
|
||||
This is the reference documentation for all API version.
|
||||
|
||||
API v1 and v1.1:
|
||||
|
||||
.. autoclass:: zaqarclient.queues.v1.client.Client
|
||||
:members:
|
||||
|
||||
API v2.0:
|
||||
|
||||
.. autoclass:: zaqarclient.queues.v2.client.Client
|
||||
:members:
|
|
@ -1,21 +0,0 @@
|
|||
============
|
||||
Command-line
|
||||
============
|
||||
|
||||
This chapter documents the usage of Zaqar Client Command Line with API v2.0.
|
||||
|
||||
Zaqar client now support some kinds of resources or actions: ``queue``,
|
||||
``claim``, ``subscription``, ``pool``, ``flavor``, ``ping``, ``health``.
|
||||
|
||||
Click the Link below for the details.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
command/queue
|
||||
command/claim
|
||||
command/pool
|
||||
command/flavor
|
||||
command/ping
|
||||
command/health
|
||||
command/subscription
|
|
@ -1,230 +0,0 @@
|
|||
Claim
|
||||
=====
|
||||
|
||||
For help on a specific :command:`openstack claim` command, enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ openstack claim COMMAND -h/--help
|
||||
|
||||
The eight commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
claim create
|
||||
messaging claim create
|
||||
claim query
|
||||
messaging claim query
|
||||
claim release
|
||||
messaging claim release
|
||||
claim renew
|
||||
messaging claim renew
|
||||
|
||||
.. _openstack_claim_create:
|
||||
|
||||
openstack claim create
|
||||
----------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack claim create [-h] [-f {csv,json,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--ttl <ttl>] [--grace <grace>]
|
||||
[--limit <limit>]
|
||||
<queue_name>
|
||||
|
||||
Create claim and return a list of claimed messages.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue to be claim.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--ttl <ttl>``
|
||||
Time to live in seconds for claim.
|
||||
|
||||
``--grace <grace>``
|
||||
The message grace period in seconds.
|
||||
|
||||
``--limit <limit>``
|
||||
Claims a set of messages, up to limit.
|
||||
|
||||
.. _openstack_messaging_claim_create:
|
||||
|
||||
openstack messaging claim create
|
||||
----------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging claim create [-h] [-f {csv,json,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--ttl <ttl>] [--grace <grace>]
|
||||
[--limit <limit>]
|
||||
<queue_name>
|
||||
|
||||
Create claim and return a list of claimed messages.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue to be claim.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--ttl <ttl>``
|
||||
Time to live in seconds for claim.
|
||||
|
||||
``--grace <grace>``
|
||||
The message grace period in seconds.
|
||||
|
||||
``--limit <limit>``
|
||||
Claims a set of messages, up to limit.
|
||||
|
||||
.. _openstack_claim_query:
|
||||
|
||||
openstack claim query
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack claim query [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
<queue_name> <claim_id>
|
||||
|
||||
Display claim details.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the claimed queue.
|
||||
|
||||
``<claim_id>``
|
||||
ID of the claim.
|
||||
|
||||
.. _openstack_messaging_claim_query:
|
||||
|
||||
openstack messaging claim query
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging claim query [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
<queue_name> <claim_id>
|
||||
|
||||
Display claim details.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the claimed queue.
|
||||
|
||||
``<claim_id>``
|
||||
ID of the claim.
|
||||
|
||||
|
||||
.. _openstack_claim_release:
|
||||
|
||||
openstack claim release
|
||||
-----------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack claim release [-h] <queue_name> <claim_id>
|
||||
|
||||
Delete a claim.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the claimed queue.
|
||||
|
||||
``<claim_id>``
|
||||
Claim ID to delete.
|
||||
|
||||
.. _openstack_messaging_claim_release:
|
||||
|
||||
openstack messaging claim release
|
||||
-----------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging claim release [-h] <queue_name> <claim_id>
|
||||
|
||||
Delete a claim.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the claimed queue.
|
||||
|
||||
``<claim_id>``
|
||||
Claim ID to delete.
|
||||
|
||||
.. _openstack_claim_renew:
|
||||
|
||||
openstack claim renew
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack claim renew [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--ttl <ttl>] [--grace <grace>]
|
||||
<queue_name> <claim_id>
|
||||
|
||||
Renew a claim.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name> ``
|
||||
Name of the claimed queue.
|
||||
|
||||
``<claim_id>``
|
||||
Claim ID.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--ttl <ttl>``
|
||||
Time to live in seconds for claim.
|
||||
|
||||
``--grace <grace>``
|
||||
The message grace period in seconds.
|
||||
|
||||
.. _openstack_messaging_claim_renew:
|
||||
|
||||
openstack messaging claim renew
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging claim renew [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--ttl <ttl>] [--grace <grace>]
|
||||
<queue_name> <claim_id>
|
||||
|
||||
Renew a claim.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name> ``
|
||||
Name of the claimed queue.
|
||||
|
||||
``<claim_id>``
|
||||
Claim ID.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--ttl <ttl>``
|
||||
Time to live in seconds for claim.
|
||||
|
||||
``--grace <grace>``
|
||||
The message grace period in seconds.
|
|
@ -1,141 +0,0 @@
|
|||
Flavor
|
||||
======
|
||||
|
||||
For help on a specific :command:`openstack messaging flavor` command, enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ openstack messaging flavor COMMAND -h/--help
|
||||
|
||||
The five commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
messaging flavor create
|
||||
messaging flavor delete
|
||||
messaging flavor list
|
||||
messaging flavor show
|
||||
messaging flavor update
|
||||
|
||||
.. _openstack_messaging_flavor_create:
|
||||
|
||||
openstack messaging flavor create
|
||||
---------------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging flavor create [-h]
|
||||
[-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
[--capabilities <capabilities>]
|
||||
<flavor_name> <pool_group>
|
||||
|
||||
Create a pool flavor.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<flavor_name>``
|
||||
Name of the flavor.
|
||||
|
||||
``<pool_group>``
|
||||
Pool group for flavor.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--capabilities <capabilities>``
|
||||
Describes flavor-specific capabilities,
|
||||
This option is only available in client api version < 2.
|
||||
|
||||
.. _openstack_messaging_flavor_delete:
|
||||
|
||||
openstack messaging flavor delete
|
||||
---------------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging flavor delete [-h] <flavor_name>
|
||||
|
||||
Delete a pool flavor.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<flavor_name>``
|
||||
Name of the flavor.
|
||||
|
||||
.. _openstack_messaging_flavor_list:
|
||||
|
||||
openstack messaging flavor list
|
||||
-------------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging flavor list [-h] [-f {csv,json,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--marker <flavor_name>]
|
||||
[--limit <limit>]
|
||||
[--detailed <detailed>]
|
||||
|
||||
List available pool flavors.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--marker <flavor_name>``
|
||||
Flavor's paging marker.
|
||||
|
||||
``--limit <limit>``
|
||||
Page size limit.
|
||||
|
||||
``--detailed <detailed>``
|
||||
If show detailed capabilities of flavor.
|
||||
|
||||
.. _openstack_messaging_flavor_show:
|
||||
|
||||
openstack messaging flavor show
|
||||
-------------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging flavor show [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
<flavor_name>
|
||||
|
||||
Display flavor details.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<flavor_name>``
|
||||
Flavor to display (name).
|
||||
|
||||
.. _openstack_messaging_flavor_update:
|
||||
|
||||
openstack messaging flavor update
|
||||
---------------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging flavor update [-h]
|
||||
[-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
[--pool_group <pool_group>]
|
||||
[--capabilities <capabilities>]
|
||||
<flavor_name>
|
||||
|
||||
Update a pool flavor's attributes.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<flavor_name>``
|
||||
Name of the flavor.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--pool_group <pool_group>``
|
||||
Pool group the flavor sits on.
|
||||
|
||||
``--capabilities <capabilities>``
|
||||
Describes flavor-specific capabilities.
|
|
@ -1,25 +0,0 @@
|
|||
Health
|
||||
======
|
||||
|
||||
For help on a specific :command:`openstack messaging health` command, enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ openstack messaging health COMMAND -h/--help
|
||||
|
||||
The one command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
messaging health
|
||||
|
||||
.. _openstack_messaging_health:
|
||||
|
||||
openstack messaging health
|
||||
--------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging health [-h]
|
||||
|
||||
Display detailed health status of Zaqar server.
|
|
@ -1,27 +0,0 @@
|
|||
Ping
|
||||
====
|
||||
|
||||
For help on a specific :command:`openstack messaging ping` command, enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ openstack messaging ping COMMAND -h/--help
|
||||
|
||||
The one command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
messaging ping
|
||||
|
||||
.. _openstack_messaging_ping:
|
||||
|
||||
openstack messaging ping
|
||||
------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging ping [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
|
||||
Check if Zaqar server is alive or not.
|
|
@ -1,290 +0,0 @@
|
|||
Pool
|
||||
====
|
||||
|
||||
For help on a specific :command:`openstack pool` command, enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ openstack pool COMMAND -h/--help
|
||||
|
||||
The ten commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
pool create
|
||||
messaging pool create
|
||||
pool delete
|
||||
messaging pool delete
|
||||
pool list
|
||||
messaging pool list
|
||||
pool show
|
||||
messaging pool show
|
||||
pool update
|
||||
messaging pool update
|
||||
|
||||
.. _openstack_pool_create:
|
||||
|
||||
openstack pool create
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack pool create [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX] [--pool_group <pool_group>]
|
||||
[--pool_options <pool_options>]
|
||||
<pool_name> <pool_uri> <pool_weight>
|
||||
|
||||
Create a pool.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<pool_name>``
|
||||
Name of the pool.
|
||||
|
||||
``<pool_uri>``
|
||||
Storage engine URI.
|
||||
|
||||
``<pool_weight>``
|
||||
weight of the pool.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--pool_group <pool_group>``
|
||||
Group of the pool.
|
||||
|
||||
``--pool_options <pool_options>``
|
||||
An optional request component related to
|
||||
storage-specific options.
|
||||
|
||||
.. _openstack_messaging_pool_create:
|
||||
|
||||
openstack messaging pool create
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging pool create [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX] [--pool_group <pool_group>]
|
||||
[--pool_options <pool_options>]
|
||||
<pool_name> <pool_uri> <pool_weight>
|
||||
|
||||
Create a pool.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<pool_name>``
|
||||
Name of the pool.
|
||||
|
||||
``<pool_uri>``
|
||||
Storage engine URI.
|
||||
|
||||
``<pool_weight>``
|
||||
weight of the pool.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--pool_group <pool_group>``
|
||||
Group of the pool.
|
||||
|
||||
``--pool_options <pool_options>``
|
||||
An optional request component related to
|
||||
storage-specific options.
|
||||
|
||||
.. _openstack_pool_delete:
|
||||
|
||||
openstack pool delete
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack pool delete [-h] <pool_name>
|
||||
|
||||
Delete a pool.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<pool_name>``
|
||||
Name of the pool.
|
||||
|
||||
.. _openstack_messaging_pool_delete:
|
||||
|
||||
openstack messaging pool delete
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging pool delete [-h] <pool_name>
|
||||
|
||||
Delete a pool.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<pool_name>``
|
||||
Name of the pool.
|
||||
|
||||
.. _openstack_pool_list:
|
||||
|
||||
openstack pool list
|
||||
-------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack pool list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--marker <pool_name>] [--limit <limit>]
|
||||
[--detailed <detailed>]
|
||||
|
||||
List available Pools.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--marker <pool_name>``
|
||||
Pool's paging marker.
|
||||
|
||||
``--limit <limit>``
|
||||
Page size limit.
|
||||
|
||||
``--detailed <detailed>``
|
||||
Detailed output.
|
||||
|
||||
.. _openstack_messaging_pool_list:
|
||||
|
||||
openstack messaging pool list
|
||||
-------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging pool list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--marker <pool_name>] [--limit <limit>]
|
||||
[--detailed <detailed>]
|
||||
|
||||
List available Pools.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--marker <pool_name>``
|
||||
Pool's paging marker.
|
||||
|
||||
``--limit <limit>``
|
||||
Page size limit.
|
||||
|
||||
``--detailed <detailed>``
|
||||
Detailed output.
|
||||
|
||||
.. _openstack_pool_show:
|
||||
|
||||
openstack pool show
|
||||
-------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack pool show [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX]
|
||||
<pool_name>
|
||||
|
||||
Display pool details.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<pool_name>``
|
||||
Pool to display (name).
|
||||
|
||||
.. _openstack_messaging_pool_show:
|
||||
|
||||
openstack messaging pool show
|
||||
-------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging pool show [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX]
|
||||
<pool_name>
|
||||
|
||||
Display pool details.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<pool_name>``
|
||||
Pool to display (name).
|
||||
|
||||
.. _openstack_pool_update:
|
||||
|
||||
openstack pool update
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack pool update [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX] [--pool_uri <pool_uri>]
|
||||
[--pool_weight <pool_weight>]
|
||||
[--pool_group <pool_group>]
|
||||
[--pool_options <pool_options>]
|
||||
<pool_name>
|
||||
|
||||
Update a pool attribute.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<pool_name>``
|
||||
Name of the pool.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--pool_uri <pool_uri>``
|
||||
Storage engine URI.
|
||||
|
||||
``--pool_weight <pool_weight>``
|
||||
Weight of the pool.
|
||||
|
||||
``--pool_group <pool_group>``
|
||||
Group of the pool.
|
||||
|
||||
``--pool_options <pool_options>``
|
||||
An optional request component related to
|
||||
storage-specific options.
|
||||
|
||||
.. _openstack_messaging_pool_update:
|
||||
|
||||
openstack messaging pool update
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging pool update [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX] [--pool_uri <pool_uri>]
|
||||
[--pool_weight <pool_weight>]
|
||||
[--pool_group <pool_group>]
|
||||
[--pool_options <pool_options>]
|
||||
<pool_name>
|
||||
|
||||
Update a pool attribute.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<pool_name>``
|
||||
Name of the pool.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--pool_uri <pool_uri>``
|
||||
Storage engine URI.
|
||||
|
||||
``--pool_weight <pool_weight>``
|
||||
Weight of the pool.
|
||||
|
||||
``--pool_group <pool_group>``
|
||||
Group of the pool.
|
||||
|
||||
``--pool_options <pool_options>``
|
||||
An optional request component related to
|
||||
storage-specific options.
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
Queue
|
||||
=====
|
||||
|
||||
For help on a specific :command:`openstack queue` command, enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ openstack queue COMMAND -h/--help
|
||||
|
||||
The fourteen commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
queue create
|
||||
messaging queue create
|
||||
queue delete
|
||||
messaging queue delete
|
||||
queue get metadata
|
||||
messaging queue get metadata
|
||||
queue list
|
||||
messaging queue list
|
||||
queue set metadata
|
||||
messaging queue set metadata
|
||||
queue signed url
|
||||
messaging queue signed url
|
||||
queue stats
|
||||
messaging queue stats
|
||||
|
||||
.. _openstack_queue_create:
|
||||
|
||||
openstack queue create
|
||||
----------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack queue create [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX]
|
||||
<queue_name>
|
||||
|
||||
Create a queue.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_messaging_queue_create:
|
||||
|
||||
openstack messaging queue create
|
||||
----------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging queue create [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX]
|
||||
<queue_name>
|
||||
|
||||
Create a queue.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_queue_delete:
|
||||
|
||||
openstack queue delete
|
||||
----------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack queue delete [-h] <queue_name>
|
||||
|
||||
Delete a queue.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_messaging_queue_delete:
|
||||
|
||||
openstack messaging queue delete
|
||||
----------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging queue delete [-h] <queue_name>
|
||||
|
||||
Delete a queue.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_queue_get_metadata:
|
||||
|
||||
openstack queue get metadata
|
||||
----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack queue get metadata [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
<queue_name>
|
||||
|
||||
Get queue metadata.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_messaging_queue_get_metadata:
|
||||
|
||||
openstack messaging queue get metadata
|
||||
----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging queue get metadata [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
<queue_name>
|
||||
|
||||
Get queue metadata.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_queue_list:
|
||||
|
||||
openstack queue list
|
||||
--------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack queue list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--marker <queue_id>] [--limit <limit>]
|
||||
[--detailed]
|
||||
|
||||
List available queues.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--marker <queue_id>``
|
||||
Queue's paging marker.
|
||||
|
||||
``--limit <limit>``
|
||||
Page size limit.
|
||||
|
||||
``--detailed``
|
||||
If show detailed information of queue.
|
||||
|
||||
.. _openstack_messaging_queue_list:
|
||||
|
||||
openstack messaging queue list
|
||||
--------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging queue list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
|
||||
[--max-width <integer>] [--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--marker <queue_id>] [--limit <limit>]
|
||||
[--detailed]
|
||||
|
||||
List available queues.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--marker <queue_id>``
|
||||
Queue's paging marker.
|
||||
|
||||
``--limit <limit>``
|
||||
Page size limit.
|
||||
|
||||
``--detailed``
|
||||
If show detailed information of queue.
|
||||
|
||||
.. _openstack_queue_set_metadata:
|
||||
|
||||
openstack queue set metadata
|
||||
----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack queue set metadata [-h] <queue_name> <queue_metadata>
|
||||
|
||||
Set queue metadata.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<queue_metadata>``
|
||||
Queue metadata. It should be json like. For example: '{"age": 18}'
|
||||
|
||||
.. _openstack_messaging_queue_set_metadata:
|
||||
|
||||
openstack messaging queue set metadata
|
||||
----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging queue set metadata [-h] <queue_name> <queue_metadata>
|
||||
|
||||
Set queue metadata.All the metadata of the queue will be replaced by
|
||||
queue_metadata.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<queue_metadata>``
|
||||
Queue metadata. It should be json like. For example: '{"age": 18}'
|
||||
|
||||
|
||||
.. _openstack_queue_signed_url:
|
||||
|
||||
openstack queue signed url
|
||||
--------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack queue signed url [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
[--paths <paths>]
|
||||
[--ttl-seconds <ttl_seconds>]
|
||||
[--methods <methods>]
|
||||
<queue_name>
|
||||
|
||||
Create a pre-signed url for the queue.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--paths <paths>``
|
||||
Allowed paths in a comma-separated list.
|
||||
Options: messages, subscriptions, claims.
|
||||
|
||||
``--ttl-seconds <ttl_seconds>``
|
||||
Length of time (in seconds) until the signature expires.
|
||||
|
||||
``--methods <methods>``
|
||||
HTTP methods to allow as a comma-separated list.
|
||||
Options: GET, HEAD, OPTIONS, POST, PUT, DELETE.
|
||||
|
||||
.. _openstack_messaging_queue_signed_url:
|
||||
|
||||
openstack messaging queue signed url
|
||||
--------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging queue signed url [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
[--paths <paths>]
|
||||
[--ttl-seconds <ttl_seconds>]
|
||||
[--methods <methods>]
|
||||
<queue_name>
|
||||
|
||||
Create a pre-signed url for the queue.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--paths <paths>``
|
||||
Allowed paths in a comma-separated list.
|
||||
Options: messages, subscriptions, claims.
|
||||
|
||||
``--ttl-seconds <ttl_seconds>``
|
||||
Length of time (in seconds) until the signature expires.
|
||||
|
||||
``--methods <methods>``
|
||||
HTTP methods to allow as a comma-separated list.
|
||||
Options: GET, HEAD, OPTIONS, POST, PUT, DELETE.
|
||||
|
||||
|
||||
.. _openstack_queue_stats:
|
||||
|
||||
openstack queue stats
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack queue stats [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX]
|
||||
<queue_name>
|
||||
|
||||
Get queue stats.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_messaging_queue_stats:
|
||||
|
||||
openstack messaging queue stats
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging queue stats [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>] [--noindent]
|
||||
[--prefix PREFIX]
|
||||
<queue_name>
|
||||
|
||||
Get queue stats.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_queue_purge:
|
||||
|
||||
openstack queue purge
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack queue purge [-h] [--resource_types <resource_types>]
|
||||
<queue_name>
|
||||
|
||||
Purge a queue. All the metadata of the queue will be kept. Use
|
||||
``--resource_types`` to specify which resource should be pured. If
|
||||
``--resource_types`` is not specified, all the messages and subscriptions in
|
||||
the queue will be purged by default.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--resource_types <resource_types>`
|
||||
Resource types want to be purged. Support ``messages`` and ``subscriptions``.
|
||||
|
||||
.. _openstack_messaging_queue_purge:
|
||||
|
||||
openstack messaging queue purge
|
||||
---------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging queue purge [-h] [--resource_types <resource_types>]
|
||||
<queue_name>
|
||||
|
||||
Purge a queue. All the metadata of the queue will be kept. Use
|
||||
``--resource_types`` to specify which resource should be pured. If
|
||||
``--resource_types`` is not specified, all the messages and subscriptions in
|
||||
the queue will be purged by default.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--resource_types <resource_types>`
|
||||
Resource types want to be purged. Support ``messages`` and ``subscriptions``.
|
|
@ -1,273 +0,0 @@
|
|||
Subscription
|
||||
============
|
||||
|
||||
For help on a specific :command:`openstack subscription` command, enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ openstack subscription COMMAND -h/--help
|
||||
|
||||
The ten commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
subscription create
|
||||
messaging subscription create
|
||||
subscription delete
|
||||
messaging subscription delete
|
||||
subscription list
|
||||
messaging subscription list
|
||||
subscription show
|
||||
messaging subscription show
|
||||
subscription update
|
||||
messaging subscription update
|
||||
|
||||
.. _openstack_subscription_create:
|
||||
|
||||
openstack subscription create
|
||||
-----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack subscription create [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
[--options <options>]
|
||||
<queue_name> <subscriber> <ttl>
|
||||
|
||||
Create a subscription.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<subscriber>``
|
||||
Subscriber which will be notified.
|
||||
|
||||
``<ttl>``
|
||||
Time to live of the subscription in seconds.
|
||||
|
||||
.. _openstack_messaging_subscription_create:
|
||||
|
||||
openstack messaging subscription create
|
||||
-----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging subscription create [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
[--options <options>]
|
||||
<queue_name> <subscriber> <ttl>
|
||||
|
||||
Create a subscription.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<subscriber>``
|
||||
Subscriber which will be notified.
|
||||
|
||||
``<ttl>``
|
||||
Time to live of the subscription in seconds.
|
||||
|
||||
.. _openstack_subscription_delete:
|
||||
|
||||
openstack subscription delete
|
||||
-----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack subscription delete [-h] <queue_name> <subscription_id>
|
||||
|
||||
Delete a subscription.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<subscription_id>``
|
||||
ID of the subscription.
|
||||
|
||||
.. _openstack_messaging_subscription_delete:
|
||||
|
||||
openstack messaging subscription delete
|
||||
-----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging subscription delete [-h] <queue_name> <subscription_id>
|
||||
|
||||
Delete a subscription.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<subscription_id>``
|
||||
ID of the subscription.
|
||||
|
||||
.. _openstack_subscription_list:
|
||||
|
||||
openstack subscription list
|
||||
---------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack subscription list [-h] [-f {csv,json,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--marker <subscription_id>]
|
||||
[--limit <limit>]
|
||||
<queue_name>
|
||||
|
||||
Get list of subscriptions.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_messaging_subscription_list:
|
||||
|
||||
openstack messaging subscription list
|
||||
---------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging subscription list [-h] [-f {csv,json,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent]
|
||||
[--quote {all,minimal,none,nonnumeric}]
|
||||
[--marker <subscription_id>]
|
||||
[--limit <limit>]
|
||||
<queue_name>
|
||||
|
||||
Get list of subscriptions.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
.. _openstack_subscription_show:
|
||||
|
||||
openstack subscription show
|
||||
---------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack subscription show [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
<queue_name> <subscription_id>
|
||||
|
||||
Query a subscription details.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<subscription_id>``
|
||||
ID of the subscription.
|
||||
|
||||
.. _openstack_messaging_subscription_show:
|
||||
|
||||
openstack messaging subscription show
|
||||
---------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging subscription show [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
<queue_name> <subscription_id>
|
||||
|
||||
Query a subscription details.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<subscription_id>``
|
||||
ID of the subscription.
|
||||
|
||||
.. _openstack_subscription_update:
|
||||
|
||||
openstack subscription update
|
||||
-----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack subscription update [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
[--subscriber <subscriber>] [--ttl <ttl>]
|
||||
[--options <options>]
|
||||
<queue_name> <subscription_id>
|
||||
|
||||
Update a subscription.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<subscription_id>``
|
||||
ID of the subscription
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--subscriber <subscriber>``
|
||||
Subscriber which will be notified.
|
||||
|
||||
``--ttl <ttl>``
|
||||
Time to live of the subscription in seconds.
|
||||
|
||||
``--options <options>``
|
||||
Metadata of the subscription in JSON format.
|
||||
|
||||
.. _openstack_messaging_subscription_update:
|
||||
|
||||
openstack messaging subscription update
|
||||
-----------------------------
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usage: openstack messaging subscription update [-h] [-f {json,shell,table,value,yaml}]
|
||||
[-c COLUMN] [--max-width <integer>]
|
||||
[--noindent] [--prefix PREFIX]
|
||||
[--subscriber <subscriber>] [--ttl <ttl>]
|
||||
[--options <options>]
|
||||
<queue_name> <subscription_id>
|
||||
|
||||
Update a subscription.
|
||||
|
||||
**Positional arguments:**
|
||||
|
||||
``<queue_name>``
|
||||
Name of the queue.
|
||||
|
||||
``<subscription_id>``
|
||||
ID of the subscription
|
||||
|
||||
**Optional arguments:**
|
||||
|
||||
``--subscriber <subscriber>``
|
||||
Subscriber which will be notified.
|
||||
|
||||
``--ttl <ttl>``
|
||||
Time to live of the subscription in seconds.
|
||||
|
||||
``--options <options>``
|
||||
Metadata of the subscription in JSON format.
|
||||
|
||||
|
|
@ -1,249 +0,0 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Zaqar documentation build configuration file, created by
|
||||
# sphinx-quickstart on Sat May 1 15:17:47 2010.
|
||||
#
|
||||
# This file is execfile()d with the current directory set
|
||||
# to its containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
import warnings
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.insert(0, os.path.abspath('../../'))
|
||||
sys.path.insert(0, os.path.abspath('../'))
|
||||
sys.path.insert(0, os.path.abspath('./'))
|
||||
|
||||
# -- General configuration ----------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings.
|
||||
# They can be extensions coming with Sphinx (named 'sphinx.ext.*')
|
||||
# or your custom ones.
|
||||
|
||||
extensions = ['sphinx.ext.autodoc',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.ifconfig',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.graphviz',
|
||||
'oslosphinx',
|
||||
]
|
||||
|
||||
# autodoc generation is a bit aggressive and a nuisance
|
||||
# when doing heavy text edit cycles. Execute "export SPHINX_DEBUG=1"
|
||||
# in your terminal to disable
|
||||
|
||||
todo_include_todos = True
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
# Changing the path so that the Hudson build output contains GA code
|
||||
# and the source docs do not contain the code so local, offline sphinx builds
|
||||
# are "clean."
|
||||
templates_path = []
|
||||
if os.getenv('HUDSON_PUBLISH_DOCS'):
|
||||
templates_path = ['_ga', '_templates']
|
||||
else:
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'zaqarclient'
|
||||
copyright = u'2010-present, OpenStack Foundation'
|
||||
|
||||
# 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.
|
||||
#
|
||||
from zaqarclient.version import version_string
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
version = release = version_string
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of documents that shouldn't be included in the build.
|
||||
unused_docs = [
|
||||
'api_ext/rst_extension_template',
|
||||
'installer',
|
||||
]
|
||||
|
||||
# List of directories, relative to source directory, that shouldn't be searched
|
||||
# for source files.
|
||||
exclude_trees = []
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use
|
||||
# for all documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
add_module_names = False
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
modindex_common_prefix = ['zaqarclient.']
|
||||
|
||||
# -- Options for man page output ----------------------------------------------
|
||||
|
||||
# Grouping the document tree for man pages.
|
||||
# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual'
|
||||
|
||||
# -- Options for HTML output --------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. Major themes that come with
|
||||
# Sphinx are currently 'default' and 'sphinxdoc'.
|
||||
# html_theme_path = ["."]
|
||||
# html_theme = '_theme'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'",
|
||||
"--date=local", "-n1"]
|
||||
try:
|
||||
html_last_updated_fmt = subprocess.Popen(
|
||||
git_cmd, stdout=subprocess.PIPE).communicate()[0]
|
||||
except Exception:
|
||||
warnings.warn('Cannot get last updated time from git repository. '
|
||||
'Not setting "html_last_updated_fmt".')
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_use_modindex = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = ''
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'zaqarclientdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output -------------------------------------------------
|
||||
|
||||
# The paper size ('letter' or 'a4').
|
||||
#latex_paper_size = 'letter'
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#latex_font_size = '10pt'
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass
|
||||
# [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'Zaqarclient.tex', u'Zaqar Library Documentation',
|
||||
u'Anso Labs, LLC', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#latex_preamble = ''
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_use_modindex = True
|
|
@ -1,98 +0,0 @@
|
|||
..
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
====================================================
|
||||
Welcome to the Zaqar-client developer documentation!
|
||||
====================================================
|
||||
|
||||
`Zaqar`_ is a multi-tenant cloud messaging and notification service for web
|
||||
and mobile developers.
|
||||
|
||||
The service features a ReST API, which developers can use to send messages
|
||||
between various components of their SaaS and mobile applications, by using a
|
||||
variety of communication patterns. Underlying this API is an efficient
|
||||
messaging engine designed with scalability and security in mind.
|
||||
|
||||
Other OpenStack components can integrate with Zaqar to surface events to
|
||||
end users and to communicate with guest agents that run in the
|
||||
"over-cloud" layer.
|
||||
|
||||
.. note:: This documentation is generated by the Sphinx toolkit and lives in the Zaqar project source
|
||||
tree. Additional draft and project documentation regarding Zaqar and other components of OpenStack can
|
||||
be found on the `OpenStack Wiki`_, as well as in the user guides found on `docs.openstack.org`_.
|
||||
|
||||
.. _`Zaqar`: https://wiki.openstack.org/wiki/Zaqar
|
||||
.. _`OpenStack Wiki`: http://wiki.openstack.org
|
||||
.. _`docs.openstack.org`: http://docs.openstack.org
|
||||
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
client
|
||||
command-line
|
||||
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
New Release Note
|
||||
----------------
|
||||
|
||||
We use reno to publish the release note now. Please see `Release Page`_ for
|
||||
more detail.
|
||||
|
||||
0.2.0
|
||||
-----
|
||||
|
||||
* 1934a98 Updated from global requirements
|
||||
* 863371b Allow for authentication in functional tests
|
||||
* b35689d Don't pass `options` to pool creation
|
||||
* 8104ff4 Don't reuse request and transport instances
|
||||
* bf841b5 Pass `group` in pool's functional tests
|
||||
* 2490ed4 Send claims `limit` as a query param
|
||||
* baf6fa7 v1.1 and v2 claims return document not list
|
||||
* 0d80728 Make sure the API version is passed down
|
||||
* 407925c Make v1.1 the default CLI version
|
||||
* 895aad2 Updated from global requirements
|
||||
* 8a81c44 Updated from global requirements
|
||||
* 705ee75 Implement CLI support for flavor
|
||||
* 32a847e Implements CLI for pool
|
||||
* 964443d Raises an error if the queue name is empty
|
||||
* e9a8d01 Added support to pools and flavors
|
||||
* f46979b Removed deprecated 'shard' methods
|
||||
* 1a85f83 Update README to work with release tools
|
||||
|
||||
0.1.1
|
||||
-----
|
||||
|
||||
* Fix handling of 1.1 API
|
||||
* Gets 'flavor' data if the resource exists
|
||||
* Gets 'pool' data if the resource exists
|
||||
* Handling exception on 504 Error
|
||||
* Added i18n support
|
||||
* Makes health return True or False
|
||||
* Add reference docs for latest recommended client
|
||||
* Add docs for `Client` instances
|
||||
* Add a read-only property for Queues
|
||||
|
||||
Indices and tables
|
||||
------------------
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
.. _`Release Page`: https://docs.openstack.org/releasenotes/python-zaqarclient
|
|
@ -1,52 +0,0 @@
|
|||
# Copyright (c) 2014 Rackspace, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import time
|
||||
|
||||
from zaqarclient.queues.v2 import client
|
||||
|
||||
URL = 'http://localhost:8888'
|
||||
|
||||
# Note: credential information should be provided using `conf`
|
||||
# keyword argument if authentication is enabled at server side.
|
||||
# Please refer to keystone_auth.py for more information.
|
||||
cli = client.Client(URL)
|
||||
queue = cli.queue('worker-jobs')
|
||||
|
||||
|
||||
def send_jobs():
|
||||
jobs = [
|
||||
{'name': 'fluffy'},
|
||||
{'name': 'scout'},
|
||||
{'name': 'jo'}
|
||||
]
|
||||
queue.post([{'body': j,
|
||||
'ttl': 360}
|
||||
for j in jobs])
|
||||
|
||||
|
||||
def process_jobs():
|
||||
claim1 = queue.claim(ttl=500, grace=900, limit=2)
|
||||
for msg in claim1:
|
||||
claim_id = msg.claim_id
|
||||
print('{claim_id} =? {id}'.format(claim_id=claim_id, id=claim1.id))
|
||||
print('processing job %s' % (msg))
|
||||
msg.delete()
|
||||
time.sleep(0.5)
|
||||
|
||||
if __name__ == '__main__':
|
||||
while True:
|
||||
send_jobs()
|
||||
process_jobs()
|
|
@ -1,56 +0,0 @@
|
|||
# Copyright 2014 Red Hat, Inc.
|
||||
# Copyright 2014 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from zaqarclient.queues.v2 import client
|
||||
|
||||
URL = 'http://localhost:8888'
|
||||
|
||||
|
||||
def create_post_delete(queue_name, messages):
|
||||
"""Auth example
|
||||
|
||||
Creates a queue, posts messages to it and finally deletes it with
|
||||
keystone auth strategy enabled on Zaqar server side.
|
||||
|
||||
:params queue_name: The name of the queue
|
||||
:type queue_name: `six.text_type`
|
||||
:params messages: Messages to post.
|
||||
:type messages: list
|
||||
"""
|
||||
conf = {'auth_opts':
|
||||
{'backend': 'keystone',
|
||||
'options': {'os_username': 'zaqar',
|
||||
'os_password': 'zaqar',
|
||||
'os_project_id': 'ccad479c402f43a2994f6e372ab3f8fe',
|
||||
'os_project_name': '',
|
||||
'os_auth_url': 'http://127.0.0.1:5000/v2.0/',
|
||||
'insecure': ''}
|
||||
}
|
||||
}
|
||||
cli = client.Client(URL, conf=conf)
|
||||
queue = cli.queue(queue_name)
|
||||
queue.post(messages)
|
||||
|
||||
for msg in queue.messages(echo=True):
|
||||
print(msg.body)
|
||||
msg.delete()
|
||||
|
||||
queue.delete()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
messages = [{'body': {'id': idx}, 'ttl': 360}
|
||||
for idx in range(20)]
|
||||
create_post_delete('my_queue', messages)
|
|
@ -1,55 +0,0 @@
|
|||
# Copyright 2016 Catalyst IT Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from keystoneauth1.identity.generic import password
|
||||
from keystoneauth1 import session
|
||||
|
||||
from zaqarclient.queues.v2 import client
|
||||
|
||||
|
||||
def create_post_delete(queue_name, messages):
|
||||
"""Auth example
|
||||
|
||||
Creates a queue, posts messages to it and finally deletes it with
|
||||
keystone auth strategy enabled on Zaqar server side.
|
||||
|
||||
:params queue_name: The name of the queue
|
||||
:type queue_name: `six.text_type`
|
||||
:params messages: Messages to post.
|
||||
:type messages: list
|
||||
"""
|
||||
auth = password.Password(
|
||||
"http://127.0.0.1/identity_v2_admin",
|
||||
username="admin",
|
||||
password="passw0rd",
|
||||
user_domain_name='default',
|
||||
project_name='admin',
|
||||
project_domain_name='default')
|
||||
keystone_session = session.Session(verify=False, cert=None, auth=auth)
|
||||
|
||||
cli = client.Client(session=keystone_session)
|
||||
queue = cli.queue(queue_name)
|
||||
queue.post(messages)
|
||||
|
||||
for msg in queue.messages(echo=True):
|
||||
print(msg.body)
|
||||
msg.delete()
|
||||
|
||||
queue.delete()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
messages = [{'body': {'id': idx}, 'ttl': 360}
|
||||
for idx in range(20)]
|
||||
create_post_delete('my_queue', messages)
|
|
@ -1,29 +0,0 @@
|
|||
# Copyright 2014 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from zaqarclient.queues import client
|
||||
|
||||
URL = 'http://localhost:8888'
|
||||
|
||||
|
||||
def healthy():
|
||||
# Note: credential information should be provided
|
||||
# using `conf` keyword argument if authentication
|
||||
# is enabled at server side. Please refer to
|
||||
# keystone_auth.py for more information.
|
||||
cli = client.Client(url=URL, version=2)
|
||||
return True if cli.health() else False
|
||||
|
||||
if __name__ == '__main__':
|
||||
healthy()
|
|
@ -1,52 +0,0 @@
|
|||
# Copyright 2016 Catalyst IT Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from zaqarclient.queues.v2 import client
|
||||
|
||||
URL = 'http://localhost:8888'
|
||||
|
||||
|
||||
def create_post_delete(queue_name, messages):
|
||||
"""Presigned queue example
|
||||
|
||||
Creates a queue, posts messages to it and finally deletes it with
|
||||
``signed-url`` auth strategy enabled on Zaqar server side.
|
||||
|
||||
:params queue_name: The name of the queue
|
||||
:type queue_name: `six.text_type`
|
||||
:params messages: Messages to post.
|
||||
:type messages: list
|
||||
"""
|
||||
conf = {'auth_opts':
|
||||
{'backend': 'signed-url',
|
||||
'options': {'signature': '',
|
||||
'expires': '',
|
||||
'methods': ['GET', 'PATCH', 'POST', 'PUT'],
|
||||
'paths': ['/v2/queues/beijing/claims'],
|
||||
'os_project_id': '2887aabf368046a3bb0070f1c0413470'}
|
||||
}
|
||||
}
|
||||
cli = client.Client(URL, conf=conf)
|
||||
queue = cli.queue(queue_name)
|
||||
queue.post(messages)
|
||||
|
||||
for msg in queue.messages(echo=True):
|
||||
print(msg.body)
|
||||
msg.delete()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
messages = [{'body': {'id': idx}, 'ttl': 360}
|
||||
for idx in range(20)]
|
||||
create_post_delete('beijing', messages)
|
|
@ -1,50 +0,0 @@
|
|||
# Copyright 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE(flaper87): Client should be moved to
|
||||
# an upper package. It's version agnostic.
|
||||
from zaqarclient.queues.v2 import client
|
||||
|
||||
URL = 'http://localhost:8888'
|
||||
|
||||
|
||||
def create_post_delete(queue_name, messages):
|
||||
"""Simple example
|
||||
|
||||
Creates a queue, posts messages to it
|
||||
and finally deletes it.
|
||||
|
||||
:params queue_name: The name of the queue
|
||||
:type queue_name: `six.text_type`
|
||||
:params messages: Messages to post.
|
||||
:type messages: list
|
||||
"""
|
||||
# Note: credential information should be provided
|
||||
# using `conf` keyword argument if authentication
|
||||
# is enabled at server side. Please refer to
|
||||
# keystone_auth.py for more information.
|
||||
cli = client.Client(URL, version=2)
|
||||
queue = cli.queue(queue_name)
|
||||
queue.post(messages)
|
||||
|
||||
for msg in queue.messages(echo=True):
|
||||
print(msg.body)
|
||||
msg.delete()
|
||||
|
||||
queue.delete()
|
||||
|
||||
if __name__ == '__main__':
|
||||
messages = [{'body': {'id': idx}, 'ttl': 360}
|
||||
for idx in range(20)]
|
||||
create_post_delete('my_queue', messages)
|
|
@ -1,9 +0,0 @@
|
|||
---
|
||||
fixes:
|
||||
- Fix the creation issue when special meanings words in queue name.
|
||||
When using zaqarclient to create a queue with some special
|
||||
meanings words like "#" and "%", then cli will return the queue
|
||||
with the name has created successfully, but in zaqar server side,
|
||||
the name is not as same as the client side.
|
||||
Add the check for some special meanings words, it will raise error message
|
||||
when using those words in queue name.
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
fixes:
|
||||
- Change zaqarclient command to keep the same format like other project does.
|
||||
the consistent command format is 'openstack messaging XXX'. Marks those
|
||||
old commands as deprecated and will remove them after Queen release.
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
features:
|
||||
- The auth mechanism has been upgraded from keystone client to keystoneauth
|
||||
to support keystone V3.
|
||||
[Blueprint `keystoneclient-to-keystoneauth <https://blueprints.launchpad.net/python-zaqarclient/+spec/keystoneclient-to-keystoneauth>`_]
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
fixes:
|
||||
- The "os" prefix for project id has been dropped to keep the same with
|
||||
OpenStack and Keystone Client. To keep the backwards compatibility, the "os"
|
||||
prefix still can be used. And it'll be removed in the next release.
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
features:
|
||||
- Zaqar client now support SSL and insecure for the request.
|
||||
[Blueprint `support-ssl-insecure <https://blueprints.launchpad.net/python-zaqarclient/+spec/support-ssl-insecure>`_]
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
features:
|
||||
- Support 'openstack queue list --detailed' in openstackclient to query the
|
||||
detailed queue list from Zaqar server. The detailed information includes
|
||||
queue's Name, Metadata and Href.
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
features:
|
||||
- Zaqar client has the doc page now. The link will work after a new release.
|
||||
[Link `python-zaqarclient doc page <https://docs.openstack.org/python-zaqarclient/latest/>`_]
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
features:
|
||||
- Support to create profiling traces for Zaqar. To use this feature, Zaqar
|
||||
should enable it first. The command is like "openstack --os-profile <SECRET_KEY> queue list"
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Allow post and list messages with CLI so that user can easily verify
|
||||
Zaqar's messaging functions with command line.
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
features:
|
||||
- Now Zaqar client supports using keystone session to init "Client" object.
|
|
@ -1,276 +0,0 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Zaqar-Client documentation build configuration file, created by
|
||||
# sphinx-quickstart on Tue Dec 20 11:53:00 2016.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
from zaqarclient.version import version_info as zaqarclient_version
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'oslosphinx',
|
||||
'reno.sphinxext',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
# source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'ZaqarClientReleaseNotes'
|
||||
copyright = u'2016, OpenStack Foundation'
|
||||
|
||||
# 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 = zaqarclient_version.version_string_with_vcs()
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = zaqarclient_version.canonical_version_string()
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
# language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
# today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
# today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = []
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
# default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
# add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
# add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
# show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
# modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
# keep_warnings = False
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'default'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
# html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
# html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
# html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
# html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
# html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
# html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
# html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
# html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
# html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
# html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
# html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
# html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
# html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
# html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
# html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
# html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
# html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
# html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
# html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'ZaqarClientReleaseNotesdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
# The item in latex_elements:
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
# 'papersize': 'letterpaper',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
# 'pointsize': '10pt',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
# 'preamble': '',
|
||||
latex_elements = {}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', 'ZaqarClientReleaseNotes.tex',
|
||||
u'ZaqarClient ReleaseNotes Documentation',
|
||||
u'OpenStack Foundation', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
# latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
# latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
# latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
# latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
# latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
# latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'ZaqarClientReleaseNotes',
|
||||
u'ZaqarClient ReleaseNotes Documentation',
|
||||
[u'OpenStack Foundation'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
# man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'ZaqarClientReleaseNotes',
|
||||
u'ZaqarClient ReleaseNotes Documentation',
|
||||
u'OpenStack Foundation', 'ZaqarClientReleaseNotes',
|
||||
'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
# texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
# texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
# texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
# texinfo_no_detailmenu = False
|
||||
|
||||
# -- Options for Internationalization output ------------------------------
|
||||
locale_dirs = ['locale/']
|
|
@ -1,42 +0,0 @@
|
|||
.. Zaqar-Client documentation master file, created by
|
||||
sphinx-quickstart on Tue Dec 20 11:53:00 2016.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to Zaqar-Client's documentation!
|
||||
========================================
|
||||
|
||||
Contents
|
||||
--------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
unreleased
|
||||
ocata
|
||||
|
||||
OpenStack Releases
|
||||
------------------
|
||||
|
||||
The ZaqarClient release that was current when the corresponding
|
||||
OpenStack release was made is shown below:
|
||||
|
||||
================= ===================
|
||||
OpenStack Release ZaqarClient Release
|
||||
================= ===================
|
||||
Ocata 1.4.0
|
||||
Newton 1.2.0
|
||||
================= ===================
|
||||
|
||||
Further details for historical OpenStack releases are found at the
|
||||
`OpenStack Releases`_ page.
|
||||
|
||||
.. _`OpenStack Releases`: http://releases.openstack.org/
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
===================================
|
||||
Ocata Series Release Notes
|
||||
===================================
|
||||
|
||||
.. release-notes::
|
||||
:branch: origin/stable/ocata
|
|
@ -1,5 +0,0 @@
|
|||
=====================
|
||||
Current Release Notes
|
||||
=====================
|
||||
|
||||
.. release-notes::
|
|
@ -1,16 +0,0 @@
|
|||
# The order of packages is significant, because pip processes them in the order
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
requests>=2.14.2 # Apache-2.0
|
||||
six>=1.9.0 # MIT
|
||||
stevedore>=1.20.0 # Apache-2.0
|
||||
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
|
||||
|
||||
# Oslo Packages
|
||||
oslo.i18n!=3.15.2,>=2.1.0 # Apache-2.0
|
||||
oslo.log>=3.22.0 # Apache-2.0
|
||||
oslo.utils>=3.20.0 # Apache-2.0
|
||||
|
||||
keystoneauth1>=2.21.0 # Apache-2.0
|
||||
osc-lib>=1.5.1 # Apache-2.0
|
156
setup.cfg
156
setup.cfg
|
@ -1,156 +0,0 @@
|
|||
[metadata]
|
||||
name = python-zaqarclient
|
||||
summary = Client Library for OpenStack Zaqar Messaging API
|
||||
description-file =
|
||||
README.rst
|
||||
author = OpenStack
|
||||
author-email = openstack-dev@lists.openstack.org
|
||||
home-page = https://docs.openstack.org/zaqar/latest/
|
||||
classifier =
|
||||
Development Status :: 4 - Beta
|
||||
Environment :: Console
|
||||
Environment :: OpenStack
|
||||
Intended Audience :: Information Technology
|
||||
Intended Audience :: Developers
|
||||
Intended Audience :: System Administrators
|
||||
License :: OSI Approved :: Apache Software License
|
||||
Operating System :: POSIX :: Linux
|
||||
Programming Language :: Python
|
||||
Programming Language :: Python :: 2
|
||||
Programming Language :: Python :: 2.7
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3.5
|
||||
|
||||
[global]
|
||||
setup-hooks =
|
||||
pbr.hooks.setup_hook
|
||||
|
||||
[files]
|
||||
packages =
|
||||
zaqarclient
|
||||
|
||||
[entry_points]
|
||||
zaqarclient.transport =
|
||||
http.v1 = zaqarclient.transport.http:HttpTransport
|
||||
https.v1 = zaqarclient.transport.http:HttpTransport
|
||||
|
||||
http.v1.1 = zaqarclient.transport.http:HttpTransport
|
||||
https.v1.1 = zaqarclient.transport.http:HttpTransport
|
||||
|
||||
http.v2 = zaqarclient.transport.http:HttpTransport
|
||||
https.v2 = zaqarclient.transport.http:HttpTransport
|
||||
|
||||
ws.v1 = zaqarclient.transport.ws:WebsocketTransport
|
||||
ws.v1.1 = zaqarclient.transport.ws:WebsocketTransport
|
||||
ws.v2 = zaqarclient.transport.ws:WebsocketTransport
|
||||
|
||||
zaqarclient.api =
|
||||
queues.v1 = zaqarclient.queues.v1.api:V1
|
||||
queues.v1.1 = zaqarclient.queues.v1.api:V1_1
|
||||
queues.v2 = zaqarclient.queues.v2.api:V2
|
||||
|
||||
openstack.messaging.v1 =
|
||||
queue_list = zaqarclient.queues.v1.cli:ListQueues
|
||||
queue_create = zaqarclient.queues.v1.cli:CreateQueue
|
||||
queue_delete = zaqarclient.queues.v1.cli:DeleteQueue
|
||||
queue_exists = zaqarclient.queues.v1.cli:CheckQueueExistence
|
||||
queue_set_metadata = zaqarclient.queues.v1.cli:SetQueueMetadata
|
||||
queue_get_metadata = zaqarclient.queues.v1.cli:GetQueueMetadata
|
||||
queue_stats = zaqarclient.queues.v1.cli:GetQueueStats
|
||||
pool_create = zaqarclient.queues.v1.cli:CreatePool
|
||||
pool_show = zaqarclient.queues.v1.cli:ShowPool
|
||||
pool_update = zaqarclient.queues.v1.cli:UpdatePool
|
||||
pool_delete = zaqarclient.queues.v1.cli:DeletePool
|
||||
pool_list = zaqarclient.queues.v1.cli:ListPools
|
||||
messaging_flavor_list = zaqarclient.queues.v1.cli:ListFlavors
|
||||
messaging_flavor_delete = zaqarclient.queues.v1.cli:DeleteFlavor
|
||||
messaging_flavor_update = zaqarclient.queues.v1.cli:UpdateFlavor
|
||||
messaging_flavor_show = zaqarclient.queues.v1.cli:ShowFlavor
|
||||
messaging_flavor_create = zaqarclient.queues.v1.cli:CreateFlavor
|
||||
claim_create = zaqarclient.queues.v1.cli:CreateClaim
|
||||
claim_query = zaqarclient.queues.v1.cli:QueryClaim
|
||||
claim_renew = zaqarclient.queues.v1.cli:RenewClaim
|
||||
claim_release = zaqarclient.queues.v1.cli:ReleaseClaim
|
||||
|
||||
openstack.messaging.v2 =
|
||||
queue_list = zaqarclient.queues.v2.cli:OldListQueues
|
||||
queue_create = zaqarclient.queues.v2.cli:OldCreateQueue
|
||||
queue_delete = zaqarclient.queues.v2.cli:OldDeleteQueue
|
||||
queue_stats = zaqarclient.queues.v2.cli:OldGetQueueStats
|
||||
queue_set_metadata = zaqarclient.queues.v2.cli:OldSetQueueMetadata
|
||||
queue_get_metadata = zaqarclient.queues.v2.cli:OldGetQueueMetadata
|
||||
queue_purge = zaqarclient.queues.v2.cli:OldPurgeQueue
|
||||
pool_create = zaqarclient.queues.v2.cli:OldCreatePool
|
||||
pool_show = zaqarclient.queues.v2.cli:OldShowPool
|
||||
pool_update = zaqarclient.queues.v2.cli:OldUpdatePool
|
||||
pool_delete = zaqarclient.queues.v2.cli:OldDeletePool
|
||||
pool_list = zaqarclient.queues.v2.cli:OldListPools
|
||||
|
||||
messaging_queue_list = zaqarclient.queues.v2.cli:ListQueues
|
||||
messaging_queue_create = zaqarclient.queues.v2.cli:CreateQueue
|
||||
messaging_queue_delete = zaqarclient.queues.v2.cli:DeleteQueue
|
||||
messaging_queue_stats = zaqarclient.queues.v2.cli:GetQueueStats
|
||||
messaging_queue_set_metadata = zaqarclient.queues.v2.cli:SetQueueMetadata
|
||||
messaging_queue_get_metadata = zaqarclient.queues.v2.cli:GetQueueMetadata
|
||||
messaging_queue_purge = zaqarclient.queues.v2.cli:PurgeQueue
|
||||
messaging_pool_create = zaqarclient.queues.v2.cli:CreatePool
|
||||
messaging_pool_show = zaqarclient.queues.v2.cli:ShowPool
|
||||
messaging_pool_update = zaqarclient.queues.v2.cli:UpdatePool
|
||||
messaging_pool_delete = zaqarclient.queues.v2.cli:DeletePool
|
||||
messaging_pool_list = zaqarclient.queues.v2.cli:ListPools
|
||||
|
||||
messaging_flavor_list = zaqarclient.queues.v2.cli:ListFlavors
|
||||
messaging_flavor_delete = zaqarclient.queues.v2.cli:DeleteFlavor
|
||||
messaging_flavor_update = zaqarclient.queues.v2.cli:UpdateFlavor
|
||||
messaging_flavor_show = zaqarclient.queues.v2.cli:ShowFlavor
|
||||
messaging_flavor_create = zaqarclient.queues.v2.cli:CreateFlavor
|
||||
|
||||
claim_create = zaqarclient.queues.v2.cli:OldCreateClaim
|
||||
claim_query = zaqarclient.queues.v2.cli:OldQueryClaim
|
||||
claim_renew = zaqarclient.queues.v2.cli:OldRenewClaim
|
||||
claim_release = zaqarclient.queues.v2.cli:OldReleaseClaim
|
||||
subscription_create = zaqarclient.queues.v2.cli:OldCreateSubscription
|
||||
subscription_update = zaqarclient.queues.v2.cli:OldUpdateSubscription
|
||||
subscription_delete = zaqarclient.queues.v2.cli:OldDeleteSubscription
|
||||
subscription_show = zaqarclient.queues.v2.cli:OldShowSubscription
|
||||
subscription_list = zaqarclient.queues.v2.cli:OldListSubscriptions
|
||||
queue_signed_url = zaqarclient.queues.v2.cli:OldCreateSignedUrl
|
||||
|
||||
messaging_claim_create = zaqarclient.queues.v2.cli:CreateClaim
|
||||
messaging_claim_query = zaqarclient.queues.v2.cli:QueryClaim
|
||||
messaging_claim_renew = zaqarclient.queues.v2.cli:RenewClaim
|
||||
messaging_claim_release = zaqarclient.queues.v2.cli:ReleaseClaim
|
||||
messaging_subscription_create = zaqarclient.queues.v2.cli:CreateSubscription
|
||||
messaging_subscription_update = zaqarclient.queues.v2.cli:UpdateSubscription
|
||||
messaging_subscription_delete = zaqarclient.queues.v2.cli:DeleteSubscription
|
||||
messaging_subscription_show = zaqarclient.queues.v2.cli:ShowSubscription
|
||||
messaging_subscription_list = zaqarclient.queues.v2.cli:ListSubscriptions
|
||||
messaging_queue_signed_url = zaqarclient.queues.v2.cli:CreateSignedUrl
|
||||
|
||||
messaging_ping = zaqarclient.queues.v2.cli:Ping
|
||||
messaging_health = zaqarclient.queues.v2.cli:Health
|
||||
messaging_homedoc = zaqarclient.queues.v2.cli:HomeDoc
|
||||
|
||||
message_post = zaqarclient.queues.v2.cli:OldPostMessages
|
||||
message_list = zaqarclient.queues.v2.cli:OldListMessages
|
||||
|
||||
messaging_message_post = zaqarclient.queues.v2.cli:PostMessages
|
||||
messaging_message_list = zaqarclient.queues.v2.cli:ListMessages
|
||||
|
||||
openstack.cli.extension =
|
||||
messaging = zaqarclient.queues.cli
|
||||
|
||||
[nosetests]
|
||||
where=tests
|
||||
verbosity=2
|
||||
|
||||
[build_sphinx]
|
||||
source-dir = doc/source
|
||||
build-dir = doc/build
|
||||
all_files = 1
|
||||
|
||||
[upload_sphinx]
|
||||
upload-dir = doc/build/html
|
||||
|
||||
[wheel]
|
||||
universal = 1
|
29
setup.py
29
setup.py
|
@ -1,29 +0,0 @@
|
|||
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
|
||||
import setuptools
|
||||
|
||||
# In python < 2.7.4, a lazy loading of package `pbr` will break
|
||||
# setuptools if some other modules registered functions in `atexit`.
|
||||
# solution from: http://bugs.python.org/issue15881#msg170215
|
||||
try:
|
||||
import multiprocessing # noqa
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['pbr>=2.0.0'],
|
||||
pbr=True)
|
|
@ -1,29 +0,0 @@
|
|||
# The order of packages is significant, because pip processes them in the order
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
# Hacking already pins down pep8, pyflakes and flake8
|
||||
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
||||
|
||||
# Unit testing
|
||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||
mock>=2.0 # BSD
|
||||
python-subunit>=0.0.18 # Apache-2.0/BSD
|
||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
||||
testtools>=1.4.0 # MIT
|
||||
|
||||
# Test runner
|
||||
nose # LGPL
|
||||
nose-exclude # LGPL
|
||||
openstack.nose-plugin>=0.7 # Apache-2.0
|
||||
|
||||
# Metrics and style
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
|
||||
ddt>=1.0.1 # MIT
|
||||
|
||||
# Documentation
|
||||
sphinx>=1.6.2 # BSD
|
||||
os-client-config>=1.27.0 # Apache-2.0
|
||||
oslosphinx>=4.7.0 # Apache-2.0
|
||||
reno!=2.3.1,>=1.8.0 # Apache-2.0
|
||||
requests-mock>=1.1 # Apache-2.0
|
|
@ -1,32 +0,0 @@
|
|||
# Copyright (c) 2014 Rackspace Hosting.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import claims
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV1ClaimHttpFunctionalTest(claims.QueuesV1ClaimFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 1
|
||||
|
||||
|
||||
class QueuesV1_1ClaimHttpFunctionalTest(claims.QueuesV1_1ClaimFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 1.1
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from zaqarclient.tests.queues import flavor
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV1_1FlavorHttpFunctionalTest(
|
||||
flavor.QueuesV1_1FlavorFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 1.1
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import pool
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV1_1PoolHttpFunctionalTest(pool.QueuesV1_1PoolFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 1.1
|
|
@ -1,32 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import queues
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV1QueueHttpFunctionalTest(queues.QueuesV1QueueFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 1
|
||||
|
||||
|
||||
class QueuesV1_1QueueHttpFunctionalTest(queues.QueuesV1_1QueueFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 1.1
|
|
@ -1,24 +0,0 @@
|
|||
# Copyright (c) 2014 Rackspace Hosting.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from zaqarclient.tests.queues import claims
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2ClaimHttpFunctionalTest(claims.QueuesV2ClaimFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 2
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import flavor
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2FlavorHttpFunctionalTest(flavor.QueuesV2FlavorFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 2
|
|
@ -1,26 +0,0 @@
|
|||
# Copyright (c) 2016 Catalyst IT Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import health
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2HealthHttpFunctionalTest(
|
||||
health.QueuesV2HealthFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 2
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import pool
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2PoolHttpFunctionalTest(pool.QueuesV2PoolFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 2
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import queues
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2QueueHttpFunctionalTest(queues.QueuesV2QueueFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 2
|
|
@ -1,26 +0,0 @@
|
|||
# Copyright (c) 2015 Catalyst IT Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import subscriptions
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2SubscriptionHttpFunctionalTest(
|
||||
subscriptions.QueuesV2SubscriptionFunctionalTest):
|
||||
|
||||
is_functional = True
|
||||
transport_cls = http.HttpTransport
|
||||
version = 2
|
|
@ -1,33 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from zaqarclient import auth
|
||||
from zaqarclient.tests import base
|
||||
|
||||
|
||||
class TestBaseAuth(base.TestBase):
|
||||
|
||||
def test_get_backend(self):
|
||||
try:
|
||||
auth.get_backend(options=self.conf)
|
||||
except KeyError:
|
||||
self.fail("Test failed")
|
||||
|
||||
def test_get_non_existing_backend(self):
|
||||
try:
|
||||
auth.get_backend('not_existing')
|
||||
self.fail("Test failed")
|
||||
except KeyError:
|
||||
pass
|
|
@ -1,56 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
import mock
|
||||
|
||||
from keystoneauth1 import session
|
||||
|
||||
from zaqarclient import auth
|
||||
from zaqarclient.tests import base
|
||||
from zaqarclient.transport import request
|
||||
|
||||
|
||||
class TestKeystoneAuth(base.TestBase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestKeystoneAuth, self).setUp()
|
||||
|
||||
self.auth = auth.get_backend(options=self.conf)
|
||||
|
||||
@mock.patch('keystoneauth1.session.Session.get_token',
|
||||
return_value='fake-token')
|
||||
def test_no_token(self, fake_session):
|
||||
test_endpoint = 'http://example.org:8888'
|
||||
keystone_session = session.Session()
|
||||
|
||||
with mock.patch.object(self.auth, '_get_endpoint') as get_endpoint:
|
||||
with mock.patch.object(self.auth,
|
||||
'_get_keystone_session') as get_session:
|
||||
|
||||
get_endpoint.return_value = test_endpoint
|
||||
get_session.return_value = keystone_session
|
||||
|
||||
req = self.auth.authenticate(1, request.Request())
|
||||
self.assertEqual(test_endpoint, req.endpoint)
|
||||
self.assertIn('X-Auth-Token', req.headers)
|
||||
self.assertIn(req.headers['X-Auth-Token'], 'fake-token')
|
||||
|
||||
def test_with_token(self):
|
||||
self.auth.conf.update({"auth_token": "test-token"})
|
||||
req = request.Request(endpoint='http://example.org:8888')
|
||||
req = self.auth.authenticate(1, req)
|
||||
self.assertIn('X-Auth-Token', req.headers)
|
||||
self.assertIn(req.headers['X-Auth-Token'], 'test-token')
|
|
@ -1,31 +0,0 @@
|
|||
# Copyright (c) 2015 Catalyst IT Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
import mock
|
||||
from osc_lib.tests import utils
|
||||
|
||||
|
||||
class TestMessaging(utils.TestCommand):
|
||||
|
||||
def setUp(self):
|
||||
super(TestMessaging, self).setUp()
|
||||
|
||||
self.messaging_client = mock.MagicMock()
|
||||
# TODO(flwang): It would be nice if we can figure out a better way to
|
||||
# get the mocked request and transport.
|
||||
req_trans = (mock.MagicMock(), mock.MagicMock())
|
||||
self.messaging_client._request_and_transport.return_value = req_trans
|
||||
self.app.client_manager.messaging = self.messaging_client
|
|
@ -1,69 +0,0 @@
|
|||
# Copyright (c) 2015 Catalyst IT Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from tests.unit.cli import fakes
|
||||
|
||||
from zaqarclient.queues.v1 import cli as v1_cli
|
||||
from zaqarclient.queues.v1 import iterator
|
||||
from zaqarclient.queues.v1 import queues as v1_api_queues
|
||||
|
||||
|
||||
class TestQueues(fakes.TestMessaging):
|
||||
def setUp(self):
|
||||
super(TestQueues, self).setUp()
|
||||
|
||||
|
||||
class TestV1ListQueues(TestQueues):
|
||||
def setUp(self):
|
||||
super(TestV1ListQueues, self).setUp()
|
||||
queues_list = iterator._Iterator(self, [{'name': 'fake_queue'}],
|
||||
'queues',
|
||||
v1_api_queues.create_object(self))
|
||||
self.app.client_manager.messaging.queues.return_value = queues_list
|
||||
|
||||
# Command to test
|
||||
self.cmd = v1_cli.ListQueues(self.app, None)
|
||||
|
||||
def test_queues_list(self):
|
||||
arglist = []
|
||||
verifylist = []
|
||||
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
|
||||
# Check that columns are correct
|
||||
expected_columns = ('Name',)
|
||||
self.assertEqual(expected_columns, columns)
|
||||
# Check that data is correct
|
||||
expected_data = [('fake_queue',)]
|
||||
self.assertEqual(expected_data, list(data))
|
||||
|
||||
|
||||
class TestV1CreateQueue(TestQueues):
|
||||
|
||||
def setUp(self):
|
||||
super(TestV1CreateQueue, self).setUp()
|
||||
|
||||
# Command to test
|
||||
self.cmd = v1_cli.CreateQueue(self.app, None)
|
||||
|
||||
def test_queue_create(self):
|
||||
arglist = ['fake_queue']
|
||||
verifylist = []
|
||||
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
self.messaging_client.queue.assert_called_with('fake_queue',
|
||||
force_create=True)
|
|
@ -1,38 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
|
||||
import mock
|
||||
|
||||
from zaqarclient.common import http
|
||||
from zaqarclient.tests import base
|
||||
|
||||
|
||||
class TestCommonHttp(base.TestBase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestCommonHttp, self).setUp()
|
||||
self.client = http.Client()
|
||||
|
||||
def test_data_serialization(self):
|
||||
data = {'some': 'data'}
|
||||
|
||||
for method in ['post', 'put', 'patch']:
|
||||
with mock.patch.object(self.client.session, method,
|
||||
autospec=True) as request_method:
|
||||
request_method.return_value = True
|
||||
getattr(self.client, method)("url", data=data)
|
||||
request_method.assert_called_with('url', data=json.dumps(data))
|
|
@ -1,38 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import zaqarclient
|
||||
from zaqarclient import errors
|
||||
from zaqarclient.queues import client
|
||||
from zaqarclient.tests import base
|
||||
|
||||
|
||||
class TestClient(base.TestBase):
|
||||
|
||||
def test_get_instance(self):
|
||||
version = list(client._CLIENTS.keys())[0]
|
||||
cli = client.Client('http://example.com',
|
||||
version, {})
|
||||
self.assertIsInstance(cli,
|
||||
client._CLIENTS[version])
|
||||
|
||||
def test_version_failure(self):
|
||||
self.assertRaises(errors.ZaqarError,
|
||||
client.Client,
|
||||
'http://example.org',
|
||||
-1, {})
|
||||
|
||||
def test_module_version(self):
|
||||
self.assertTrue(hasattr(zaqarclient, '__version__'))
|
|
@ -1,32 +0,0 @@
|
|||
# Copyright (c) Rackspace Hosting.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import claims
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV1ClaimsHttpUnitTest(claims.QueueV1ClaimUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v1'
|
||||
version = 1
|
||||
|
||||
|
||||
class QueuesV1_1ClaimsHttpUnitTest(claims.QueueV1_1ClaimUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v1.1'
|
||||
version = 1.1
|
|
@ -1,55 +0,0 @@
|
|||
# Copyright 2014 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
|
||||
import ddt
|
||||
|
||||
from zaqarclient.queues import client
|
||||
from zaqarclient.queues.v1 import core
|
||||
from zaqarclient.tests import base
|
||||
from zaqarclient.transport import errors
|
||||
|
||||
VERSIONS = [1, 1.1]
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class TestClient(base.TestBase):
|
||||
|
||||
@ddt.data(*VERSIONS)
|
||||
def test_transport(self, version):
|
||||
cli = client.Client('http://example.com',
|
||||
version, {"auth_opts": {'backend': 'noauth'}})
|
||||
self.assertIsNotNone(cli.transport())
|
||||
|
||||
@ddt.data(*VERSIONS)
|
||||
def test_health_ok(self, version):
|
||||
cli = client.Client('http://example.com',
|
||||
version, {"auth_opts": {'backend': 'noauth'}})
|
||||
with mock.patch.object(core, 'health', autospec=True) as core_health:
|
||||
core_health.return_value = None
|
||||
self.assertTrue(cli.health())
|
||||
|
||||
@ddt.data(*VERSIONS)
|
||||
def test_health_bad(self, version):
|
||||
cli = client.Client('http://example.com',
|
||||
version, {"auth_opts": {'backend': 'noauth'}})
|
||||
|
||||
def raise_error(*args, **kwargs):
|
||||
raise errors.ServiceUnavailableError()
|
||||
|
||||
with mock.patch.object(core, 'health', autospec=True) as core_health:
|
||||
core_health.side_effect = raise_error
|
||||
self.assertFalse(cli.health())
|
|
@ -1,265 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
|
||||
from zaqarclient.queues.v1 import core
|
||||
from zaqarclient.tests import base
|
||||
from zaqarclient.tests.transport import dummy
|
||||
from zaqarclient.transport import errors
|
||||
from zaqarclient.transport import request
|
||||
from zaqarclient.transport import response
|
||||
|
||||
|
||||
class TestV1Core(base.TestBase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestV1Core, self).setUp()
|
||||
self.transport = dummy.DummyTransport(self.conf)
|
||||
|
||||
def test_queue_create(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
send_method.return_value = response.Response(None, None)
|
||||
|
||||
req = request.Request()
|
||||
core.queue_create(self.transport, req, 'test')
|
||||
self.assertIn('queue_name', req.params)
|
||||
|
||||
def test_queue_delete(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
send_method.return_value = response.Response(None, None)
|
||||
|
||||
req = request.Request()
|
||||
core.queue_delete(self.transport, req, 'test')
|
||||
self.assertIn('queue_name', req.params)
|
||||
|
||||
def test_queue_exists(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
send_method.return_value = response.Response(None, None)
|
||||
|
||||
req = request.Request()
|
||||
ret = core.queue_exists(self.transport, req, 'test')
|
||||
self.assertIn('queue_name', req.params)
|
||||
self.assertTrue(ret)
|
||||
|
||||
def test_queue_exists_not_found(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
|
||||
send_method.side_effect = errors.ResourceNotFound
|
||||
|
||||
req = request.Request()
|
||||
ret = core.queue_exists(self.transport, req, 'test')
|
||||
self.assertIn('queue_name', req.params)
|
||||
self.assertFalse(ret)
|
||||
|
||||
def test_get_queue_metadata(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, '{}')
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
core.queue_get_metadata(self.transport, req, 'test')
|
||||
|
||||
def test_set_queue_metadata(self):
|
||||
update_data = {'some': 'data'}
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
send_method.return_value = response.Response(None, None)
|
||||
|
||||
req = request.Request()
|
||||
core.queue_exists(self.transport, req, update_data, 'test')
|
||||
self.assertIn('queue_name', req.params)
|
||||
|
||||
def test_queue_get_stats(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, '{}')
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
result = core.queue_get_stats(self.transport, req, 'test')
|
||||
self.assertEqual({}, result)
|
||||
|
||||
def test_message_post_one(self):
|
||||
messages = {'ttl': 30, 'body': 'Post one!'}
|
||||
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, '{}')
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
|
||||
core.message_post(self.transport, req, 'test', messages)
|
||||
self.assertIn('queue_name', req.params)
|
||||
self.assertEqual(messages, json.loads(req.content))
|
||||
|
||||
def test_message_post_many(self):
|
||||
messages = [{'ttl': 30, 'body': 'Post one!'},
|
||||
{'ttl': 30, 'body': 'Post two!'},
|
||||
{'ttl': 30, 'body': 'Post three!'}, ]
|
||||
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, '{}')
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
|
||||
core.message_post(self.transport, req, 'test', messages)
|
||||
self.assertIn('queue_name', req.params)
|
||||
self.assertEqual(messages, json.loads(req.content))
|
||||
|
||||
def test_message_list(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, '{}')
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
|
||||
core.message_list(self.transport, req, 'test')
|
||||
self.assertIn('queue_name', req.params)
|
||||
|
||||
def test_message_list_kwargs(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, '{}')
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
|
||||
core.message_list(self.transport, req, 'test',
|
||||
marker='supermarket',
|
||||
echo=False, limit=10)
|
||||
|
||||
self.assertIn('queue_name', req.params)
|
||||
self.assertIn('limit', req.params)
|
||||
self.assertIn('echo', req.params)
|
||||
self.assertIn('marker', req.params)
|
||||
|
||||
def test_message_get_many(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, '{}')
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
|
||||
ids = ['a', 'b']
|
||||
core.message_get_many(self.transport, req,
|
||||
'test', ids)
|
||||
|
||||
self.assertIn('queue_name', req.params)
|
||||
self.assertIn('ids', req.params)
|
||||
self.assertEqual(ids, req.params['ids'])
|
||||
|
||||
def test_message_get(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, '{}')
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
core.message_get(self.transport, req,
|
||||
'test', 'message_id')
|
||||
|
||||
def test_message_delete(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, None)
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
core.message_delete(self.transport, req,
|
||||
'test', 'message_id')
|
||||
|
||||
def test_message_delete_many(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, None)
|
||||
send_method.return_value = resp
|
||||
|
||||
ids = ['a', 'b']
|
||||
req = request.Request()
|
||||
core.message_delete_many(self.transport, req,
|
||||
'test', ids=ids)
|
||||
|
||||
self.assertIn('queue_name', req.params)
|
||||
self.assertIn('ids', req.params)
|
||||
self.assertEqual(ids, req.params['ids'])
|
||||
|
||||
# ADMIN API
|
||||
def test_pool_create(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, None)
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
core.pool_create(self.transport, req,
|
||||
'test_pool', {'uri': 'sqlite://',
|
||||
'weight': 0})
|
||||
|
||||
def test_pool_get(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, None)
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
core.pool_get(self.transport, req,
|
||||
'test_pool')
|
||||
|
||||
def test_pool_delete(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, None)
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
core.pool_delete(self.transport, req, 'test_pool')
|
||||
|
||||
def test_health(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, None)
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
core.health(self.transport, req)
|
||||
|
||||
|
||||
class TestV1_1Core(TestV1Core):
|
||||
|
||||
def test_message_pop(self):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
resp = response.Response(None, '{}')
|
||||
send_method.return_value = resp
|
||||
|
||||
req = request.Request()
|
||||
core.message_pop(self.transport, req,
|
||||
'test', count=5)
|
||||
|
||||
self.assertIn('queue_name', req.params)
|
||||
self.assertIn('pop', req.params)
|
||||
self.assertEqual(5, req.params['pop'])
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import flavor
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV1_1FlavorHttpUnitTest(flavor.QueuesV1_1FlavorUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v1.1'
|
||||
version = 1.1
|
|
@ -1,118 +0,0 @@
|
|||
# Copyright (c) 2013 Rackspace, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
|
||||
from zaqarclient.queues.v1 import iterator as iterate
|
||||
from zaqarclient.queues.v1 import message
|
||||
from zaqarclient.tests.queues import base
|
||||
from zaqarclient.tests.queues import messages as test_message
|
||||
from zaqarclient.transport import http
|
||||
from zaqarclient.transport import response
|
||||
|
||||
|
||||
class TestMessageIterator(base.QueuesTestBase):
|
||||
|
||||
def test_no_next_iteration(self):
|
||||
messages = {'links': [],
|
||||
'messages': [{
|
||||
'href': '/v1/queues/mine/messages/123123423',
|
||||
'ttl': 800,
|
||||
'age': 790,
|
||||
'body': {'event': 'ActivateAccount',
|
||||
'mode': 'active'}
|
||||
}]
|
||||
}
|
||||
|
||||
iterator = iterate._Iterator(self.queue.client,
|
||||
messages,
|
||||
'messages',
|
||||
message.create_object(self.queue))
|
||||
iterated = [msg for msg in iterator]
|
||||
self.assertEqual(1, len(iterated))
|
||||
|
||||
def test_stream(self):
|
||||
messages = {'links': [],
|
||||
'messages': [{
|
||||
'href': '/v1/queues/mine/messages/123123423',
|
||||
'ttl': 800,
|
||||
'age': 790,
|
||||
'body': {'event': 'ActivateAccount',
|
||||
'mode': 'active'}
|
||||
}]
|
||||
}
|
||||
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
|
||||
resp = response.Response(None, json.dumps(messages))
|
||||
send_method.return_value = resp
|
||||
|
||||
# NOTE(flaper87): The first iteration will return 1 message
|
||||
# and then call `_next_page` which will use the rel-next link
|
||||
# to get a new set of messages.
|
||||
link = {'rel': 'next',
|
||||
'href': "/v1/queues/mine/messages?marker=6244-244224-783"}
|
||||
messages['links'].append(link)
|
||||
|
||||
iterator = iterate._Iterator(self.queue.client,
|
||||
messages,
|
||||
'messages',
|
||||
message.create_object(self.queue))
|
||||
iterated = [msg for msg in iterator.stream()]
|
||||
self.assertEqual(2, len(iterated))
|
||||
|
||||
def test_iterator_respect_paging(self):
|
||||
messages = {'links': [],
|
||||
'messages': [{
|
||||
'href': '/v1/queues/mine/messages/123123423',
|
||||
'ttl': 800,
|
||||
'age': 790,
|
||||
'body': {'event': 'ActivateAccount',
|
||||
'mode': 'active'}
|
||||
}]
|
||||
}
|
||||
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
|
||||
resp = response.Response(None, json.dumps(messages))
|
||||
send_method.return_value = resp
|
||||
|
||||
link = {'rel': 'next',
|
||||
'href': "/v1/queues/mine/messages?marker=6244-244224-783"}
|
||||
messages['links'].append(link)
|
||||
|
||||
iterator = iterate._Iterator(self.queue.client,
|
||||
messages,
|
||||
'messages',
|
||||
message.create_object(self.queue))
|
||||
iterated = [msg for msg in iterator]
|
||||
self.assertEqual(1, len(iterated))
|
||||
|
||||
|
||||
class QueuesV1MessageHttpUnitTest(test_message.QueuesV1MessageUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v1'
|
||||
version = 1
|
||||
|
||||
|
||||
class QueuesV1_1MessageHttpUnitTest(test_message.QueuesV1MessageUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v1.1'
|
||||
version = 1.1
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import pool
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV1PoolHttpUnitTest(pool.QueuesV1PoolUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v1'
|
||||
version = 1
|
|
@ -1,35 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import queues
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV1QueueHttpUnitTest(queues.QueuesV1QueueUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v1'
|
||||
version = 1
|
||||
|
||||
|
||||
class QueuesV1_1QueueHttpUnitTest(queues.QueuesV1_1QueueUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v1.1'
|
||||
version = 1.1
|
||||
|
||||
def test_queue_exists(self):
|
||||
pass
|
|
@ -1,24 +0,0 @@
|
|||
# Copyright (c) Rackspace Hosting.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from zaqarclient.tests.queues import claims
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2ClaimsHttpUnitTest(claims.QueueV2ClaimUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v2'
|
||||
version = 2
|
|
@ -1,55 +0,0 @@
|
|||
# Copyright 2014 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
|
||||
import ddt
|
||||
|
||||
from zaqarclient.queues import client
|
||||
from zaqarclient.tests.queues import base
|
||||
from zaqarclient.transport import errors
|
||||
from zaqarclient.transport import http
|
||||
|
||||
VERSIONS = [2]
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class TestClient(base.QueuesTestBase):
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v2'
|
||||
version = VERSIONS[0]
|
||||
|
||||
@ddt.data(*VERSIONS)
|
||||
def test_transport(self, version):
|
||||
cli = client.Client('http://example.com',
|
||||
version, {"auth_opts": {'backend': 'noauth'}})
|
||||
self.assertIsNotNone(cli.transport())
|
||||
|
||||
@ddt.data(*VERSIONS)
|
||||
def test_ping_ok(self, version):
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
send_method.return_value = None
|
||||
self.assertTrue(self.client.ping())
|
||||
|
||||
@ddt.data(*VERSIONS)
|
||||
def test_ping_bad(self, version):
|
||||
def raise_error(*args, **kwargs):
|
||||
raise errors.ServiceUnavailableError()
|
||||
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
send_method.side_effect = raise_error
|
||||
self.assertFalse(self.client.ping())
|
|
@ -1,20 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from tests.unit.queues.v1 import test_core
|
||||
|
||||
|
||||
class TestV2Core(test_core.TestV1Core):
|
||||
pass
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import flavor
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2FlavorHttpUnitTest(flavor.QueuesV2FlavorUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v2'
|
||||
version = 2
|
|
@ -1,24 +0,0 @@
|
|||
# Copyright (c) 2016 Catalyst IT Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from zaqarclient.tests.queues import health
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2HealthHttpUnitTest(health.QueuesV2HealthUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v2'
|
||||
version = 2
|
|
@ -1,110 +0,0 @@
|
|||
# Copyright (c) 2013 Rackspace, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
|
||||
from zaqarclient.queues.v1 import iterator as iterate
|
||||
from zaqarclient.queues.v2 import message
|
||||
from zaqarclient.tests.queues import base
|
||||
from zaqarclient.tests.queues import messages as test_message
|
||||
from zaqarclient.transport import http
|
||||
from zaqarclient.transport import response
|
||||
|
||||
|
||||
class TestMessageIterator(base.QueuesTestBase):
|
||||
def test_no_next_iteration(self):
|
||||
messages = {'links': [],
|
||||
'messages': [{
|
||||
'href': '/v2/queues/mine/messages/123123423',
|
||||
'ttl': 800,
|
||||
'age': 790,
|
||||
'body': {'event': 'ActivateAccount',
|
||||
'mode': 'active'}
|
||||
}]
|
||||
}
|
||||
|
||||
iterator = iterate._Iterator(self.queue.client,
|
||||
messages,
|
||||
'messages',
|
||||
message.create_object(self.queue))
|
||||
iterated = [msg for msg in iterator]
|
||||
self.assertEqual(len(iterated), 1)
|
||||
|
||||
def test_stream(self):
|
||||
messages = {'links': [],
|
||||
'messages': [{
|
||||
'href': '/v2/queues/mine/messages/123123423',
|
||||
'ttl': 800,
|
||||
'age': 790,
|
||||
'body': {'event': 'ActivateAccount',
|
||||
'mode': 'active'}
|
||||
}]
|
||||
}
|
||||
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
|
||||
resp = response.Response(None, json.dumps(messages))
|
||||
send_method.return_value = resp
|
||||
|
||||
# NOTE(flaper87): The first iteration will return 1 message
|
||||
# and then call `_next_page` which will use the rel-next link
|
||||
# to get a new set of messages.
|
||||
link = {'rel': 'next',
|
||||
'href': "/v2/queues/mine/messages?marker=6244-244224-783"}
|
||||
messages['links'].append(link)
|
||||
|
||||
iterator = iterate._Iterator(self.queue.client,
|
||||
messages,
|
||||
'messages',
|
||||
message.create_object(self.queue))
|
||||
iterated = [msg for msg in iterator.stream()]
|
||||
self.assertEqual(len(iterated), 2)
|
||||
|
||||
def test_iterator_respect_paging(self):
|
||||
messages = {'links': [],
|
||||
'messages': [{
|
||||
'href': '/v2/queues/mine/messages/123123423',
|
||||
'ttl': 800,
|
||||
'age': 790,
|
||||
'body': {'event': 'ActivateAccount',
|
||||
'mode': 'active'}
|
||||
}]
|
||||
}
|
||||
|
||||
with mock.patch.object(self.transport, 'send',
|
||||
autospec=True) as send_method:
|
||||
|
||||
resp = response.Response(None, json.dumps(messages))
|
||||
send_method.return_value = resp
|
||||
|
||||
link = {'rel': 'next',
|
||||
'href': "/v2/queues/mine/messages?marker=6244-244224-783"}
|
||||
messages['links'].append(link)
|
||||
|
||||
iterator = iterate._Iterator(self.queue.client,
|
||||
messages,
|
||||
'messages',
|
||||
message.create_object(self.queue))
|
||||
iterated = [msg for msg in iterator]
|
||||
self.assertEqual(len(iterated), 1)
|
||||
|
||||
|
||||
class QueuesV2MessageHttpUnitTest(test_message.QueuesV2MessageUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v2'
|
||||
version = 2
|
|
@ -1,25 +0,0 @@
|
|||
# Copyright (c) 2014 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from zaqarclient.tests.queues import pool
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2PoolHttpUnitTest(pool.QueuesV2PoolUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v2'
|
||||
version = 2
|
|
@ -1,27 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from zaqarclient.tests.queues import queues
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2QueueHttpUnitTest(queues.QueuesV2QueueUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v2'
|
||||
version = 2
|
||||
|
||||
def test_queue_exists(self):
|
||||
pass
|
|
@ -1,24 +0,0 @@
|
|||
# Copyright (c) 2015 Catalyst IT Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from zaqarclient.tests.queues import subscriptions as sub
|
||||
from zaqarclient.transport import http
|
||||
|
||||
|
||||
class QueuesV2SubscriptionHttpUnitTest(sub.QueuesV2SubscriptionUnitTest):
|
||||
|
||||
transport_cls = http.HttpTransport
|
||||
url = 'http://127.0.0.1:8888/v2'
|
||||
version = 2
|
|
@ -1,41 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from zaqarclient import errors
|
||||
from zaqarclient.tests import base
|
||||
from zaqarclient.tests.transport import api as tapi
|
||||
|
||||
|
||||
class TestApi(base.TestBase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestApi, self).setUp()
|
||||
self.api = tapi.FakeApi()
|
||||
|
||||
def test_valid_params(self):
|
||||
self.assertTrue(self.api.validate('test_operation',
|
||||
{'name': 'Sauron'}))
|
||||
|
||||
def test_invalid_params(self):
|
||||
self.assertFalse(self.api.validate('test_operation',
|
||||
{'name': 'Sauron',
|
||||
'lastname': 'From Mordor'}))
|
||||
|
||||
def test_missing_params(self):
|
||||
self.assertFalse(self.api.validate('test_operation', {}))
|
||||
|
||||
def test_invalid_operation(self):
|
||||
self.assertRaises(errors.InvalidOperation, self.api.validate,
|
||||
'super_secret_op', {})
|
|
@ -1,118 +0,0 @@
|
|||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import requests as prequest
|
||||
from requests.packages.urllib3 import response
|
||||
|
||||
from zaqarclient.tests import base
|
||||
from zaqarclient.tests.transport import api
|
||||
from zaqarclient.transport import http
|
||||
from zaqarclient.transport import request
|
||||
|
||||
|
||||
class TestHttpTransport(base.TestBase):
|
||||
|
||||
"""Tests for the HTTP transport."""
|
||||
|
||||
def setUp(self):
|
||||
super(TestHttpTransport, self).setUp()
|
||||
self.api = api.FakeApi()
|
||||
self.transport = http.HttpTransport(self.conf)
|
||||
|
||||
@mock.patch.object(prequest.packages.urllib3.response.HTTPResponse,
|
||||
'stream')
|
||||
def test_basic_send(self, mock_stream):
|
||||
params = {'name': 'Test',
|
||||
'address': 'Outer space'}
|
||||
req = request.Request('http://example.org/',
|
||||
operation='test_operation',
|
||||
params=params)
|
||||
|
||||
with mock.patch.object(self.transport.client, 'request',
|
||||
autospec=True) as request_method:
|
||||
|
||||
resp = prequest.Response()
|
||||
raw = response.HTTPResponse()
|
||||
resp.raw = raw
|
||||
request_method.return_value = resp
|
||||
|
||||
# NOTE(flaper87): Bypass the API
|
||||
# loading step by setting the _api
|
||||
# attribute
|
||||
req._api = self.api
|
||||
self.transport.send(req)
|
||||
|
||||
final_url = 'http://example.org/v1/test/Test'
|
||||
final_params = {'address': 'Outer space'}
|
||||
final_headers = {'content-type': 'application/json'}
|
||||
|
||||
request_method.assert_called_with('GET', url=final_url,
|
||||
params=final_params,
|
||||
headers=final_headers,
|
||||
data=None,
|
||||
verify=True,
|
||||
cert=None)
|
||||
|
||||
@mock.patch.object(prequest.packages.urllib3.response.HTTPResponse,
|
||||
'stream')
|
||||
def test_send_without_api(self, mock_stream):
|
||||
params = {'name': 'Test',
|
||||
'address': 'Outer space'}
|
||||
req = request.Request('http://example.org/',
|
||||
operation='test_operation',
|
||||
params=params)
|
||||
|
||||
with mock.patch.object(self.transport.client, 'request',
|
||||
autospec=True) as request_method:
|
||||
|
||||
resp = prequest.Response()
|
||||
raw = response.HTTPResponse()
|
||||
resp.raw = raw
|
||||
request_method.return_value = resp
|
||||
self.transport.send(req)
|
||||
|
||||
final_url = 'http://example.org/'
|
||||
final_headers = {'content-type': 'application/json'}
|
||||
|
||||
request_method.assert_called_with('GET', url=final_url,
|
||||
params=params,
|
||||
headers=final_headers,
|
||||
data=None,
|
||||
verify=True,
|
||||
cert=None)
|
||||
|
||||
@mock.patch.object(prequest.packages.urllib3.response.HTTPResponse,
|
||||
'stream')
|
||||
def test_error_handling(self, mock_stream):
|
||||
params = {'name': 'Opportunity',
|
||||
'address': 'NASA'}
|
||||
req = request.Request('http://example.org/',
|
||||
operation='test_operation',
|
||||
params=params)
|
||||
|
||||
with mock.patch.object(self.transport.client, 'request',
|
||||
autospec=True) as request_method:
|
||||
|
||||
exception_iterator = self.transport.http_to_zaqar.items()
|
||||
|
||||
for response_code, exception in exception_iterator:
|
||||
|
||||
resp = prequest.Response()
|
||||
raw = response.HTTPResponse()
|
||||
resp.raw = raw
|
||||
resp.status_code = response_code
|
||||
request_method.return_value = resp
|
||||
self.assertRaises(exception, lambda: self.transport.send(req))
|
|
@ -1,70 +0,0 @@
|
|||
# Copyright (c) 2013 Rackspace, Inc.
|
||||
# Copyright (c) 2013 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
|
||||
from zaqarclient.queues.v1 import api as api_v1
|
||||
from zaqarclient.queues.v2 import api as api_v2
|
||||
from zaqarclient.tests import base
|
||||
from zaqarclient.transport import request
|
||||
|
||||
|
||||
class TestRequest(base.TestBase):
|
||||
|
||||
def test_request_project_id(self):
|
||||
auth_opts = {
|
||||
'options': {
|
||||
'os_project_id': 'my-project'
|
||||
}
|
||||
}
|
||||
auth_opts.update({'backend': 'noauth'})
|
||||
req = request.prepare_request(auth_opts)
|
||||
self.assertEqual('my-project', req.headers['X-Project-Id'])
|
||||
|
||||
def test_prepare_request(self):
|
||||
auth_opts = self.conf.get('auth_opts', {})
|
||||
req = request.prepare_request(auth_opts)
|
||||
self.assertIsInstance(req, request.Request)
|
||||
self.assertIsNone(req.content)
|
||||
|
||||
def test_prepare_request_with_data(self):
|
||||
auth_opts = self.conf.get('auth_opts', {})
|
||||
data = {"data": "tons of GBs"}
|
||||
req = request.prepare_request(auth_opts, data=data)
|
||||
self.assertIsInstance(req, request.Request)
|
||||
self.assertEqual(json.dumps(data), req.content)
|
||||
|
||||
def test_request_with_right_version(self):
|
||||
auth_opts = self.conf.get('auth_opts', {})
|
||||
api_version = 1
|
||||
req = request.prepare_request(auth_opts, api=api_version)
|
||||
self.assertIsInstance(req.api, api_v1.V1)
|
||||
|
||||
api_version = 1.0
|
||||
req = request.prepare_request(auth_opts, api=api_version)
|
||||
self.assertIsInstance(req.api, api_v1.V1)
|
||||
|
||||
api_version = 1.1
|
||||
req = request.prepare_request(auth_opts, api=api_version)
|
||||
self.assertIsInstance(req.api, api_v1.V1_1)
|
||||
|
||||
api_version = 2
|
||||
req = request.prepare_request(auth_opts, api=api_version)
|
||||
self.assertIsInstance(req.api, api_v2.V2)
|
||||
|
||||
api_version = 2.0
|
||||
req = request.prepare_request(auth_opts, api=api_version)
|
||||
self.assertIsInstance(req.api, api_v2.V2)
|
|
@ -1,78 +0,0 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
|
||||
from zaqarclient.tests import base
|
||||
from zaqarclient.transport import request
|
||||
from zaqarclient.transport import ws
|
||||
|
||||
|
||||
class TestWsTransport(base.TestBase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestWsTransport, self).setUp()
|
||||
os_opts = {
|
||||
'os_auth_token': 'FAKE_TOKEN',
|
||||
'os_auth_url': 'http://127.0.0.0:5000/v3',
|
||||
'os_project_id': 'admin',
|
||||
'os_service_type': 'messaging-websocket',
|
||||
}
|
||||
auth_opts = {'backend': 'keystone',
|
||||
'options': os_opts}
|
||||
self.options = {'auth_opts': auth_opts}
|
||||
self.endpoint = 'ws://127.0.0.1:9000'
|
||||
|
||||
@mock.patch.object(ws.WebsocketTransport, "_create_connection")
|
||||
def test_make_client(self, ws_create_connection):
|
||||
ws_create_connection.return_value.recv.return_value = json.dumps({
|
||||
"headers": {
|
||||
"status": 200
|
||||
}
|
||||
})
|
||||
|
||||
transport = ws.WebsocketTransport(self.options)
|
||||
req = request.Request(self.endpoint)
|
||||
transport.send(req)
|
||||
ws_create_connection.assert_called_with("ws://127.0.0.1:9000")
|
||||
|
||||
@mock.patch.object(ws.WebsocketTransport, "recv")
|
||||
@mock.patch.object(ws.WebsocketTransport, "_create_connection")
|
||||
def test_recv(self, ws_create_connection, recv_mock):
|
||||
|
||||
send_ack = {
|
||||
"headers": {
|
||||
"status": 200
|
||||
}
|
||||
}
|
||||
|
||||
recv_mock.side_effect = [send_ack, send_ack, send_ack, {
|
||||
"body": {
|
||||
"payload": "foo"
|
||||
}
|
||||
}, send_ack]
|
||||
|
||||
transport = ws.WebsocketTransport(self.options)
|
||||
req = request.Request(self.endpoint)
|
||||
transport.send(req)
|
||||
|
||||
count = 0
|
||||
|
||||
while True:
|
||||
count += 1
|
||||
data = transport.recv()
|
||||
if 'body' in data:
|
||||
self.assertEqual(data['body']['payload'], 'foo')
|
||||
break
|
||||
if count >= 4:
|
||||
self.fail('Failed to receive expected message.')
|
|
@ -1,30 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Client constraint file contains this client version pin that is in conflict
|
||||
# with installing the client from source. We should remove the version pin in
|
||||
# the constraints file before applying it for from-source installation.
|
||||
|
||||
CONSTRAINTS_FILE="$1"
|
||||
shift 1
|
||||
|
||||
set -e
|
||||
|
||||
# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
|
||||
# published to logs.openstack.org for easy debugging.
|
||||
localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
|
||||
|
||||
if [[ "$CONSTRAINTS_FILE" != http* ]]; then
|
||||
CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
|
||||
fi
|
||||
# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
|
||||
curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
|
||||
|
||||
pip install -c"$localfile" openstack-requirements
|
||||
|
||||
# This is the main purpose of the script: Allow local installation of
|
||||
# the current repo. It is listed in constraints file and thus any
|
||||
# install will be constrained and we need to unconstrain it.
|
||||
edit-constraints "$localfile" -- "$CLIENT_NAME"
|
||||
|
||||
pip install -c"$localfile" -U "$@"
|
||||
exit $?
|
47
tox.ini
47
tox.ini
|
@ -1,47 +0,0 @@
|
|||
[tox]
|
||||
minversion = 2.0
|
||||
envlist = py35,py27,pep8
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
# Customize pip command, add -U to force updates.
|
||||
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
BRANCH_NAME=master
|
||||
CLIENT_NAME=python-zaqarclient
|
||||
NOSE_WITH_OPENSTACK=1
|
||||
NOSE_OPENSTACK_COLOR=1
|
||||
NOSE_OPENSTACK_RED=0.05
|
||||
NOSE_OPENSTACK_YELLOW=0.025
|
||||
NOSE_OPENSTACK_SHOW_ELAPSED=1
|
||||
NOSE_OPENSTACK_STDOUT=1
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands = find . -type f -name "*.pyc" -delete
|
||||
nosetests {posargs}
|
||||
|
||||
whitelist_externals = find
|
||||
|
||||
[tox:jenkins]
|
||||
sitepackages = True
|
||||
|
||||
[testenv:pep8]
|
||||
commands = flake8
|
||||
|
||||
[testenv:cover]
|
||||
setenv = {[testenv]setenv}
|
||||
NOSE_WITH_COVERAGE=1
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:docs]
|
||||
commands = python setup.py build_sphinx
|
||||
|
||||
[testenv:releasenotes]
|
||||
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||
|
||||
[flake8]
|
||||
builtins = _
|
||||
exclude = .venv,.git,.tox,dist,doc,*.egg
|
|
@ -1,19 +0,0 @@
|
|||
# Copyright 2017 Huawei, Inc. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
from zaqarclient import version
|
||||
|
||||
|
||||
__version__ = version.version_string
|
|
@ -1,21 +0,0 @@
|
|||
# Copyright 2014 Red Hat, Inc
|
||||
# All Rights .Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_i18n import * # noqa
|
||||
|
||||
_translators = TranslatorFactory(domain='zaqarclient')
|
||||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue