Skip to content

Commit 4a32568

Browse files
Add compatibility for juju 3.1.0 (#799)
* Add compatibility for juju 3.1.0
1 parent 94b6f3d commit 4a32568

20 files changed

Lines changed: 52570 additions & 3410 deletions

.github/workflows/test.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ jobs:
5454
strategy:
5555
matrix:
5656
python:
57-
- "3.8"
58-
- "3.9"
57+
# We will reduce the workload to 3.10 to
58+
# save some resources for now.
59+
# - "3.8"
60+
# - "3.9"
5961
- "3.10"
6062
steps:
6163
- name: Check out code
@@ -64,7 +66,7 @@ jobs:
6466
uses: charmed-kubernetes/actions-operator@main
6567
with:
6668
provider: lxd
67-
juju-channel: 3.1/beta
69+
juju-channel: 3.1/stable
6870
# 2023-01-11 Commented until we discover a
6971
# clear approach for this.
7072
# - name: Set proxy in controller

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.0b1
1+
3.1.0.1

docs/readme.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Requirements
1212
------------
1313

1414
* Python 3.8/3.9/3.10
15-
* Tested using Juju 3.0.2
15+
* Tested using Juju 3.1.0
1616

1717

1818
Design Notes

juju/client/_client.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from juju.client._definitions import *
55

66

7-
from juju.client import _client7, _client1, _client3, _client4, _client2, _client16, _client6, _client11, _client10, _client5, _client9, _client18
7+
from juju.client import _client7, _client1, _client3, _client4, _client2, _client15, _client6, _client5, _client11, _client9, _client18, _client17, _client10
88

99

1010
CLIENTS = {
@@ -13,13 +13,14 @@
1313
"3": _client3,
1414
"4": _client4,
1515
"2": _client2,
16-
"16": _client16,
16+
"15": _client15,
1717
"6": _client6,
18-
"11": _client11,
19-
"10": _client10,
2018
"5": _client5,
19+
"11": _client11,
2120
"9": _client9,
22-
"18": _client18
21+
"18": _client18,
22+
"17": _client17,
23+
"10": _client10
2324
}
2425

2526

juju/client/_client1.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9501,7 +9501,8 @@ class SecretsFacade(Type):
95019501
'required': ['show-secrets', 'filter'],
95029502
'type': 'object'},
95039503
'SecretRevision': {'additionalProperties': False,
9504-
'properties': {'create-time': {'format': 'date-time',
9504+
'properties': {'backend-name': {'type': 'string'},
9505+
'create-time': {'format': 'date-time',
95059506
'type': 'string'},
95069507
'expire-time': {'format': 'date-time',
95079508
'type': 'string'},
@@ -9739,7 +9740,8 @@ class SecretsManagerFacade(Type):
97399740
'required': ['results'],
97409741
'type': 'object'},
97419742
'SecretRevision': {'additionalProperties': False,
9742-
'properties': {'create-time': {'format': 'date-time',
9743+
'properties': {'backend-name': {'type': 'string'},
9744+
'create-time': {'format': 'date-time',
97439745
'type': 'string'},
97449746
'expire-time': {'format': 'date-time',
97459747
'type': 'string'},

juju/client/_client17.py

Lines changed: 1176 additions & 3365 deletions
Large diffs are not rendered by default.

juju/client/_client18.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,8 @@ class UniterFacade(Type):
782782
'required': ['results'],
783783
'type': 'object'},
784784
'SecretRevision': {'additionalProperties': False,
785-
'properties': {'create-time': {'format': 'date-time',
785+
'properties': {'backend-name': {'type': 'string'},
786+
'create-time': {'format': 'date-time',
786787
'type': 'string'},
787788
'expire-time': {'format': 'date-time',
788789
'type': 'string'},

juju/client/_client5.py

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

juju/client/_client9.py

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

juju/client/_definitions.py

Lines changed: 129 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,42 @@ def __init__(self, units=None, **unknown_fields):
490490

491491

492492

493+
class AddCharmWithAuth(Type):
494+
_toSchema = {'charm_origin': 'charm-origin', 'force': 'force', 'macaroon': 'macaroon', 'url': 'url'}
495+
_toPy = {'charm-origin': 'charm_origin', 'force': 'force', 'macaroon': 'macaroon', 'url': 'url'}
496+
def __init__(self, charm_origin=None, force=None, macaroon=None, url=None, **unknown_fields):
497+
'''
498+
charm_origin : CharmOrigin
499+
force : bool
500+
macaroon : Macaroon
501+
url : str
502+
'''
503+
charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None
504+
force_ = force
505+
macaroon_ = Macaroon.from_json(macaroon) if macaroon else None
506+
url_ = url
507+
508+
# Validate arguments against known Juju API types.
509+
if charm_origin_ is not None and not isinstance(charm_origin_, (dict, CharmOrigin)):
510+
raise Exception("Expected charm_origin_ to be a CharmOrigin, received: {}".format(type(charm_origin_)))
511+
512+
if force_ is not None and not isinstance(force_, bool):
513+
raise Exception("Expected force_ to be a bool, received: {}".format(type(force_)))
514+
515+
if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)):
516+
raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_)))
517+
518+
if url_ is not None and not isinstance(url_, (bytes, str)):
519+
raise Exception("Expected url_ to be a str, received: {}".format(type(url_)))
520+
521+
self.charm_origin = charm_origin_
522+
self.force = force_
523+
self.macaroon = macaroon_
524+
self.url = url_
525+
self.unknown_fields = unknown_fields
526+
527+
528+
493529
class AddCharmWithOrigin(Type):
494530
_toSchema = {'charm_origin': 'charm-origin', 'force': 'force', 'url': 'url'}
495531
_toPy = {'charm-origin': 'charm_origin', 'force': 'force', 'url': 'url'}
@@ -1612,6 +1648,24 @@ def __init__(self, force=None, application=None, attach_storage=None, channel=No
16121648

16131649

16141650

1651+
class ApplicationDestroy(Type):
1652+
_toSchema = {'application': 'application'}
1653+
_toPy = {'application': 'application'}
1654+
def __init__(self, application=None, **unknown_fields):
1655+
'''
1656+
application : str
1657+
'''
1658+
application_ = application
1659+
1660+
# Validate arguments against known Juju API types.
1661+
if application_ is not None and not isinstance(application_, (bytes, str)):
1662+
raise Exception("Expected application_ to be a str, received: {}".format(type(application_)))
1663+
1664+
self.application = application_
1665+
self.unknown_fields = unknown_fields
1666+
1667+
1668+
16151669
class ApplicationExpose(Type):
16161670
_toSchema = {'application': 'application', 'exposed_endpoints': 'exposed-endpoints'}
16171671
_toPy = {'application': 'application', 'exposed-endpoints': 'exposed_endpoints'}
@@ -7312,6 +7366,30 @@ def __init__(self, error=None, proxy_connection=None, ssh_connection=None, **unk
73127366

73137367

73147368

7369+
class DashboardConnectionProxy(Type):
7370+
_toSchema = {'config': 'config', 'type_': 'type'}
7371+
_toPy = {'config': 'config', 'type': 'type_'}
7372+
def __init__(self, config=None, type_=None, **unknown_fields):
7373+
'''
7374+
config : typing.Mapping[str, typing.Any]
7375+
type_ : str
7376+
'''
7377+
config_ = config
7378+
type__ = type_
7379+
7380+
# Validate arguments against known Juju API types.
7381+
if config_ is not None and not isinstance(config_, dict):
7382+
raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_)))
7383+
7384+
if type__ is not None and not isinstance(type__, (bytes, str)):
7385+
raise Exception("Expected type__ to be a str, received: {}".format(type(type__)))
7386+
7387+
self.config = config_
7388+
self.type_ = type__
7389+
self.unknown_fields = unknown_fields
7390+
7391+
7392+
73157393
class DashboardConnectionSSHTunnel(Type):
73167394
_toSchema = {'entity': 'entity', 'host': 'host', 'model': 'model', 'port': 'port'}
73177395
_toPy = {'entity': 'entity', 'host': 'host', 'model': 'model', 'port': 'port'}
@@ -7567,6 +7645,24 @@ def __init__(self, results=None, **unknown_fields):
75677645

75687646

75697647

7648+
class DestroyApplicationUnits(Type):
7649+
_toSchema = {'unit_names': 'unit-names'}
7650+
_toPy = {'unit-names': 'unit_names'}
7651+
def __init__(self, unit_names=None, **unknown_fields):
7652+
'''
7653+
unit_names : typing.Sequence[str]
7654+
'''
7655+
unit_names_ = unit_names
7656+
7657+
# Validate arguments against known Juju API types.
7658+
if unit_names_ is not None and not isinstance(unit_names_, (bytes, str, list)):
7659+
raise Exception("Expected unit_names_ to be a Sequence, received: {}".format(type(unit_names_)))
7660+
7661+
self.unit_names = unit_names_
7662+
self.unknown_fields = unknown_fields
7663+
7664+
7665+
75707666
class DestroyApplicationsParams(Type):
75717667
_toSchema = {'applications': 'applications'}
75727668
_toPy = {'applications': 'applications'}
@@ -21168,23 +21264,28 @@ def __init__(self, results=None, **unknown_fields):
2116821264

2116921265

2117021266
class SecretRevision(Type):
21171-
_toSchema = {'create_time': 'create-time', 'expire_time': 'expire-time', 'revision': 'revision', 'update_time': 'update-time', 'value_ref': 'value-ref'}
21172-
_toPy = {'create-time': 'create_time', 'expire-time': 'expire_time', 'revision': 'revision', 'update-time': 'update_time', 'value-ref': 'value_ref'}
21173-
def __init__(self, create_time=None, expire_time=None, revision=None, update_time=None, value_ref=None, **unknown_fields):
21267+
_toSchema = {'backend_name': 'backend-name', 'create_time': 'create-time', 'expire_time': 'expire-time', 'revision': 'revision', 'update_time': 'update-time', 'value_ref': 'value-ref'}
21268+
_toPy = {'backend-name': 'backend_name', 'create-time': 'create_time', 'expire-time': 'expire_time', 'revision': 'revision', 'update-time': 'update_time', 'value-ref': 'value_ref'}
21269+
def __init__(self, backend_name=None, create_time=None, expire_time=None, revision=None, update_time=None, value_ref=None, **unknown_fields):
2117421270
'''
21271+
backend_name : str
2117521272
create_time : str
2117621273
expire_time : str
2117721274
revision : int
2117821275
update_time : str
2117921276
value_ref : SecretValueRef
2118021277
'''
21278+
backend_name_ = backend_name
2118121279
create_time_ = create_time
2118221280
expire_time_ = expire_time
2118321281
revision_ = revision
2118421282
update_time_ = update_time
2118521283
value_ref_ = SecretValueRef.from_json(value_ref) if value_ref else None
2118621284

2118721285
# Validate arguments against known Juju API types.
21286+
if backend_name_ is not None and not isinstance(backend_name_, (bytes, str)):
21287+
raise Exception("Expected backend_name_ to be a str, received: {}".format(type(backend_name_)))
21288+
2118821289
if create_time_ is not None and not isinstance(create_time_, (bytes, str)):
2118921290
raise Exception("Expected create_time_ to be a str, received: {}".format(type(create_time_)))
2119021291

@@ -21200,6 +21301,7 @@ def __init__(self, create_time=None, expire_time=None, revision=None, update_tim
2120021301
if value_ref_ is not None and not isinstance(value_ref_, (dict, SecretValueRef)):
2120121302
raise Exception("Expected value_ref_ to be a SecretValueRef, received: {}".format(type(value_ref_)))
2120221303

21304+
self.backend_name = backend_name_
2120321305
self.create_time = create_time_
2120421306
self.expire_time = expire_time_
2120521307
self.revision = revision_
@@ -21287,6 +21389,30 @@ def __init__(self, args=None, **unknown_fields):
2128721389

2128821390

2128921391

21392+
class SecretStoreConfig(Type):
21393+
_toSchema = {'params': 'params', 'type_': 'type'}
21394+
_toPy = {'params': 'params', 'type': 'type_'}
21395+
def __init__(self, params=None, type_=None, **unknown_fields):
21396+
'''
21397+
params : typing.Mapping[str, typing.Any]
21398+
type_ : str
21399+
'''
21400+
params_ = params
21401+
type__ = type_
21402+
21403+
# Validate arguments against known Juju API types.
21404+
if params_ is not None and not isinstance(params_, dict):
21405+
raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_)))
21406+
21407+
if type__ is not None and not isinstance(type__, (bytes, str)):
21408+
raise Exception("Expected type__ to be a str, received: {}".format(type(type__)))
21409+
21410+
self.params = params_
21411+
self.type_ = type__
21412+
self.unknown_fields = unknown_fields
21413+
21414+
21415+
2129021416
class SecretTriggerChange(Type):
2129121417
_toSchema = {'next_trigger_time': 'next-trigger-time', 'revision': 'revision', 'uri': 'uri'}
2129221418
_toPy = {'next-trigger-time': 'next_trigger_time', 'revision': 'revision', 'uri': 'uri'}

0 commit comments

Comments
 (0)