Skip to content

Commit ad3c449

Browse files
authored
Merge pull request #448 from achilleasa/gen-2.9-beta-client
#448 This PR adds in the client for 2.9-beta1
2 parents 7dde9a3 + 6dff956 commit ad3c449

14 files changed

Lines changed: 54551 additions & 219 deletions

juju/client/_client.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from juju.client._definitions import *
55

6-
from juju.client import _client2, _client1, _client3, _client4, _client5, _client8, _client7, _client9, _client10, _client6, _client12, _client11, _client13, _client15, _client16
6+
from juju.client import _client2, _client1, _client3, _client4, _client5, _client8, _client7, _client9, _client10, _client6, _client12, _client11, _client13, _client15, _client16, _client17
77

88

99
CLIENTS = {
@@ -21,7 +21,8 @@
2121
"11": _client11,
2222
"13": _client13,
2323
"15": _client15,
24-
"16": _client16
24+
"16": _client16,
25+
"17": _client17
2526
}
2627

2728

@@ -177,6 +178,10 @@ class CAASUnitProvisionerFacade(TypeFactory):
177178
pass
178179

179180

181+
class CharmHubFacade(TypeFactory):
182+
pass
183+
184+
180185
class CharmRevisionUpdaterFacade(TypeFactory):
181186
pass
182187

juju/client/_client1.py

Lines changed: 195 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2996,7 +2996,8 @@ class CAASUnitProvisionerFacade(Type):
29962996
'required': ['units'],
29972997
'type': 'object'},
29982998
'Value': {'additionalProperties': False,
2999-
'properties': {'arch': {'type': 'string'},
2999+
'properties': {'allocate-public-ip': {'type': 'boolean'},
3000+
'arch': {'type': 'string'},
30003001
'container': {'type': 'string'},
30013002
'cores': {'type': 'integer'},
30023003
'cpu-power': {'type': 'integer'},
@@ -3391,6 +3392,199 @@ async def WatchPodSpec(self, entities=None):
33913392

33923393

33933394

3395+
class CharmHubFacade(Type):
3396+
name = 'CharmHub'
3397+
version = 1
3398+
schema = {'definitions': {'BundleCharm': {'additionalProperties': False,
3399+
'properties': {'name': {'type': 'string'},
3400+
'revision': {'type': 'integer'}},
3401+
'required': ['name', 'revision'],
3402+
'type': 'object'},
3403+
'Channel': {'additionalProperties': False,
3404+
'properties': {'platforms': {'items': {'$ref': '#/definitions/Platform'},
3405+
'type': 'array'},
3406+
'released-at': {'type': 'string'},
3407+
'revision': {'type': 'integer'},
3408+
'risk': {'type': 'string'},
3409+
'size': {'type': 'integer'},
3410+
'track': {'type': 'string'},
3411+
'version': {'type': 'string'}},
3412+
'required': ['released-at',
3413+
'track',
3414+
'risk',
3415+
'revision',
3416+
'size',
3417+
'version',
3418+
'platforms'],
3419+
'type': 'object'},
3420+
'CharmHubBundle': {'additionalProperties': False,
3421+
'properties': {'charms': {'items': {'$ref': '#/definitions/BundleCharm'},
3422+
'type': 'array'}},
3423+
'required': ['charms'],
3424+
'type': 'object'},
3425+
'CharmHubCharm': {'additionalProperties': False,
3426+
'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}},
3427+
'type': 'object'},
3428+
'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}},
3429+
'type': 'object'}},
3430+
'type': 'object'},
3431+
'subordinate': {'type': 'boolean'},
3432+
'used-by': {'items': {'type': 'string'},
3433+
'type': 'array'}},
3434+
'required': ['config',
3435+
'relations',
3436+
'subordinate',
3437+
'used-by'],
3438+
'type': 'object'},
3439+
'CharmHubEntityFindResult': {'additionalProperties': False,
3440+
'properties': {'errors': {'$ref': '#/definitions/ErrorResponse'},
3441+
'result': {'items': {'$ref': '#/definitions/FindResponse'},
3442+
'type': 'array'}},
3443+
'required': ['result', 'errors'],
3444+
'type': 'object'},
3445+
'CharmHubEntityInfoResult': {'additionalProperties': False,
3446+
'properties': {'errors': {'$ref': '#/definitions/ErrorResponse'},
3447+
'result': {'$ref': '#/definitions/InfoResponse'}},
3448+
'required': ['result', 'errors'],
3449+
'type': 'object'},
3450+
'CharmHubError': {'additionalProperties': False,
3451+
'properties': {'code': {'type': 'string'},
3452+
'message': {'type': 'string'}},
3453+
'required': ['code', 'message'],
3454+
'type': 'object'},
3455+
'CharmOption': {'additionalProperties': False,
3456+
'properties': {'default': {'additionalProperties': True,
3457+
'type': 'object'},
3458+
'description': {'type': 'string'},
3459+
'type': {'type': 'string'}},
3460+
'required': ['type'],
3461+
'type': 'object'},
3462+
'Entity': {'additionalProperties': False,
3463+
'properties': {'tag': {'type': 'string'}},
3464+
'required': ['tag'],
3465+
'type': 'object'},
3466+
'ErrorResponse': {'additionalProperties': False,
3467+
'properties': {'error-list': {'$ref': '#/definitions/CharmHubError'}},
3468+
'required': ['error-list'],
3469+
'type': 'object'},
3470+
'FindResponse': {'additionalProperties': False,
3471+
'properties': {'id': {'type': 'string'},
3472+
'name': {'type': 'string'},
3473+
'publisher': {'type': 'string'},
3474+
'series': {'items': {'type': 'string'},
3475+
'type': 'array'},
3476+
'store-url': {'type': 'string'},
3477+
'summary': {'type': 'string'},
3478+
'type': {'type': 'string'},
3479+
'version': {'type': 'string'}},
3480+
'required': ['type',
3481+
'id',
3482+
'name',
3483+
'publisher',
3484+
'summary',
3485+
'version',
3486+
'series',
3487+
'store-url'],
3488+
'type': 'object'},
3489+
'InfoResponse': {'additionalProperties': False,
3490+
'properties': {'bundle': {'$ref': '#/definitions/CharmHubBundle'},
3491+
'channel-map': {'patternProperties': {'.*': {'$ref': '#/definitions/Channel'}},
3492+
'type': 'object'},
3493+
'charm': {'$ref': '#/definitions/CharmHubCharm'},
3494+
'description': {'type': 'string'},
3495+
'id': {'type': 'string'},
3496+
'name': {'type': 'string'},
3497+
'publisher': {'type': 'string'},
3498+
'series': {'items': {'type': 'string'},
3499+
'type': 'array'},
3500+
'store-url': {'type': 'string'},
3501+
'summary': {'type': 'string'},
3502+
'tags': {'items': {'type': 'string'},
3503+
'type': 'array'},
3504+
'tracks': {'items': {'type': 'string'},
3505+
'type': 'array'},
3506+
'type': {'type': 'string'}},
3507+
'required': ['type',
3508+
'id',
3509+
'name',
3510+
'description',
3511+
'publisher',
3512+
'summary',
3513+
'series',
3514+
'store-url',
3515+
'tags',
3516+
'channel-map',
3517+
'tracks'],
3518+
'type': 'object'},
3519+
'Platform': {'additionalProperties': False,
3520+
'properties': {'architecture': {'type': 'string'},
3521+
'os': {'type': 'string'},
3522+
'series': {'type': 'string'}},
3523+
'required': ['architecture', 'os', 'series'],
3524+
'type': 'object'},
3525+
'Query': {'additionalProperties': False,
3526+
'properties': {'query': {'type': 'string'}},
3527+
'required': ['query'],
3528+
'type': 'object'}},
3529+
'properties': {'Find': {'description': 'Find queries the CharmHub API with a '
3530+
'given entity ID.',
3531+
'properties': {'Params': {'$ref': '#/definitions/Query'},
3532+
'Result': {'$ref': '#/definitions/CharmHubEntityFindResult'}},
3533+
'type': 'object'},
3534+
'Info': {'description': 'Info queries the CharmHub API with a '
3535+
'given entity ID.',
3536+
'properties': {'Params': {'$ref': '#/definitions/Entity'},
3537+
'Result': {'$ref': '#/definitions/CharmHubEntityInfoResult'}},
3538+
'type': 'object'}},
3539+
'type': 'object'}
3540+
3541+
3542+
@ReturnMapping(CharmHubEntityFindResult)
3543+
async def Find(self, query=None):
3544+
'''
3545+
Find queries the CharmHub API with a given entity ID.
3546+
3547+
query : str
3548+
Returns -> CharmHubEntityFindResult
3549+
'''
3550+
if query is not None and not isinstance(query, (bytes, str)):
3551+
raise Exception("Expected query to be a str, received: {}".format(type(query)))
3552+
3553+
# map input types to rpc msg
3554+
_params = dict()
3555+
msg = dict(type='CharmHub',
3556+
request='Find',
3557+
version=1,
3558+
params=_params)
3559+
_params['query'] = query
3560+
reply = await self.rpc(msg)
3561+
return reply
3562+
3563+
3564+
3565+
@ReturnMapping(CharmHubEntityInfoResult)
3566+
async def Info(self, tag=None):
3567+
'''
3568+
Info queries the CharmHub API with a given entity ID.
3569+
3570+
tag : str
3571+
Returns -> CharmHubEntityInfoResult
3572+
'''
3573+
if tag is not None and not isinstance(tag, (bytes, str)):
3574+
raise Exception("Expected tag to be a str, received: {}".format(type(tag)))
3575+
3576+
# map input types to rpc msg
3577+
_params = dict()
3578+
msg = dict(type='CharmHub',
3579+
request='Info',
3580+
version=1,
3581+
params=_params)
3582+
_params['tag'] = tag
3583+
reply = await self.rpc(msg)
3584+
return reply
3585+
3586+
3587+
33943588
class ClientFacade(Type):
33953589
name = 'Client'
33963590
version = 1

juju/client/_client11.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,7 @@ class ProvisionerFacade(Type):
19531953
'type': 'array'},
19541954
'shadow-addresses': {'items': {'$ref': '#/definitions/Address'},
19551955
'type': 'array'},
1956+
'virtual-port-type': {'type': 'string'},
19561957
'vlan-tag': {'type': 'integer'}},
19571958
'required': ['device-index',
19581959
'mac-address',
@@ -2201,7 +2202,8 @@ class ProvisionerFacade(Type):
22012202
'enable-os-upgrade'],
22022203
'type': 'object'},
22032204
'Value': {'additionalProperties': False,
2204-
'properties': {'arch': {'type': 'string'},
2205+
'properties': {'allocate-public-ip': {'type': 'boolean'},
2206+
'arch': {'type': 'string'},
22052207
'container': {'type': 'string'},
22062208
'cores': {'type': 'integer'},
22072209
'cpu-power': {'type': 'integer'},

0 commit comments

Comments
 (0)