Skip to content

Commit c960198

Browse files
authored
Merge pull request #494 from SimonRichardson/merge-2.9-master
#494 The following merges 2.9 into master. eed19e4 (upstream/2.9, origin/2.9, 2.9) Merge pull request #492 from tlm/kube-proxy-support-2 ab33f33 Merge pull request #493 from SimonRichardson/remove-machine-workaround 5c2dfa9 Merge pull request #491 from tlm/2.9.1-facades b24e750 Merge pull request #490 from tlm/kube-proxy-support-2 aaa651c Merge pull request #482 from SimonRichardson/find-parameters bde724b Merge pull request #481 from SimonRichardson/merge-master-2.9 fa1b85f Merge pull request #464 from SimonRichardson/charm-hub-url 195191b Merge pull request #463 from SimonRichardson/charm-hub-origin d6d157f Merge pull request #462 from SimonRichardson/charm-hub-find 6fab2ee Merge pull request #460 from SimonRichardson/charm-hub-info 5e61dd2 Merge pull request #459 from SimonRichardson/rename-upgrade-charm-refresh 73604c8 Merge pull request #456 from SimonRichardson/update-schema-2.9-rc3 6c0437a Merge pull request #457 from SimonRichardson/ensure-charm-store-prefix eb849e4 Merge pull request #455 from SimonRichardson/2.9 1a77394 Merge pull request #449 from achilleasa/support-new-expose-params-for-applications ad3c449 Merge pull request #448 from achilleasa/gen-2.9-beta-client
2 parents 8bdae72 + fd4a57c commit c960198

72 files changed

Lines changed: 252517 additions & 2793 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/add_machine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def main():
4444

4545
# deploy charm to the lxd container
4646
application = await model.deploy(
47-
'ubuntu-10',
47+
'cs:ubuntu-10',
4848
application_name='ubuntu',
4949
series='xenial',
5050
channel='stable',

examples/add_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def main():
2929

3030
print('Deploying ubuntu')
3131
application = await model.deploy(
32-
'ubuntu-10',
32+
'cs:ubuntu-10',
3333
application_name='ubuntu',
3434
series='trusty',
3535
channel='stable',

examples/charmhub_find.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Example to show how to connect to the current model and search the charm-hub
3+
repository for charms.
4+
"""
5+
import logging
6+
7+
from juju import loop
8+
from juju.model import Model
9+
10+
log = logging.getLogger(__name__)
11+
12+
13+
async def main():
14+
model = Model()
15+
try:
16+
# connect to the current model with the current user, per the Juju CLI
17+
await model.connect()
18+
19+
# do a partial query so that we get more results.
20+
charms = await model.charmhub.find("kuber")
21+
22+
print("Bundle\tName")
23+
for resp in charms.result:
24+
print("{}\t{}".format("N" if resp.type_ == "charm" else "Y", resp.name))
25+
finally:
26+
if model.is_connected():
27+
print('Disconnecting from model')
28+
await model.disconnect()
29+
30+
31+
if __name__ == '__main__':
32+
logging.basicConfig(level=logging.INFO)
33+
loop.run(main())

examples/charmhub_info.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
Example to show how to connect to the current model and query the charm-hub
3+
repository for information about a given charm.
4+
"""
5+
import logging
6+
7+
from juju import loop
8+
from juju.model import Model
9+
10+
log = logging.getLogger(__name__)
11+
12+
13+
async def main():
14+
model = Model()
15+
try:
16+
# connect to the current model with the current user, per the Juju CLI
17+
await model.connect()
18+
19+
charm = await model.charmhub.info("mattermost")
20+
print(charm)
21+
finally:
22+
if model.is_connected():
23+
print('Disconnecting from model')
24+
await model.disconnect()
25+
26+
27+
if __name__ == '__main__':
28+
logging.basicConfig(level=logging.INFO)
29+
loop.run(main())

examples/charms/ubuntu/LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

examples/charms/ubuntu/README

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Overview
2+
3+
Just an Ubuntu image with not much else running.
4+
5+
# Usage
6+
7+
juju deploy ubuntu-lite
8+
9+
## Known Limitations and Issues
10+
11+
It doesn't do much, but it does get you a machine you can play with, as quickly
12+
as I could make it.
13+
14+
# Configuration
15+
16+
None

examples/charms/ubuntu/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
options: {}

examples/charms/ubuntu/hooks/start

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
status-set active ready
3+
application-version-set $(grep DISTRIB_RELEASE /etc/lsb-release | cut -d= -sf2)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
status-set active "$(uptime | grep -oe 'average: .*' | sed -e 's/average:/load:/')"

examples/charms/ubuntu/icon.svg

Lines changed: 279 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)