FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-libjuju/debian/control at master · Maxcode123/python-libjuju · GitHub
Maxcode123
python-libjuju
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-libjuju
/
debian
/
control
Copy path
More file actions
More file actions
Latest commit
History
History
History
133 lines (131 loc) · 3.68 KB
Breadcrumbs
python-libjuju
/
debian
/
control
Copy path
File metadata and controls
133 lines (131 loc) · 3.68 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Source: python-libjuju
Section: python
Priority: optional
Maintainer: Juju Developers <juju-crew@lists.canonical.com>
Build-Depends:
debhelper (>= 11~),
dh-python,
python3-all,
python3-setuptools,
Build-Depends-Indep:
python-pathlib,
Standards-Version: 4.2.1
Homepage: https://github.com/juju/python-libjuju
Vcs-Browser: https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/python-libjuju
Vcs-Git: https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/python-libjuju
Package: python3-juju
Architecture: all
Depends:
${misc:Depends},
${python3:Depends},
Description:
A Python library for Juju
=========================
.
Source code: https://github.com/juju/python-libjuju
.
Bug reports: https://github.com/juju/python-libjuju/issues
.
Documentation: https://pythonlibjuju.readthedocs.io/en/latest/
.
.
Requirements
------------
.
* Python 3.6+
* Juju 2.0+
.
.
Design Notes
------------
.
* Asynchronous - Uses asyncio and async/await features of Python
* Websocket-level bindings are programmatically generated (indirectly) from the
Juju golang code, ensuring full api coverage
* Provides an OO layer which encapsulates much of the websocket api and
provides familiar nouns and verbs (e.g. Model.deploy(), Application.add_unit(),
etc.)
.
.
Installation
------------
.
.. code:: bash
.
pip3 install juju
.
.
Quickstart
----------
Here's a simple example that shows basic usage of the library. The example
connects to the currently active Juju model, deploys a single unit of the
ubuntu charm, then exits:
.
.
.. code:: python
.
#!/usr/bin/python3
.
import logging
import sys
.
from juju import loop
from juju.model import Model
.
.
async def deploy():
# Create a Model instance. We need to connect our Model to a Juju api
# server before we can use it.
model = Model()
.
# Connect to the currently active Juju model
await model.connect_current()
.
try:
# Deploy a single unit of the ubuntu charm, using the latest revision
# from the stable channel of the Charm Store.
ubuntu_app = await model.deploy(
'ubuntu',
application_name='ubuntu',
series='xenial',
channel='stable',
)
.
if '--wait' in sys.argv:
# optionally block until the application is ready
await model.block_until(lambda: ubuntu_app.status == 'active')
finally:
# Disconnect from the api server and cleanup.
await model.disconnect()
.
.
def main():
logging.basicConfig(level=logging.INFO)
.
# If you want to see everything sent over the wire, set this to DEBUG.
ws_logger = logging.getLogger('websockets.protocol')
ws_logger.setLevel(logging.INFO)
.
# Run the deploy coroutine in an asyncio event loop, using a helper
# that abstracts loop creation and teardown.
loop.run(deploy())
.
.
if __name__ == '__main__':
main()
.
.
More examples can be found in the docs, as well as in the ``examples/``
directory of the source tree which can be run using ``tox``. For
example, to run ``examples/connect_current_model.py``, use:
.
.. code:: bash
.
tox -e example -- examples/connect_current_model.py
.
.
Versioning
----------
.
Pylibjuju releases now track the Juju release cadence. New generated schemas
will be updated per Juju releases.
Back
|
FazBrowse Home
|
New Git URL