1 # DO NOT CHANGE THIS FILE! This file is auto-generated by facade.py.
2 # Changes will be overwritten/lost when the file is regenerated.
4 from juju
.client
.facade
import Type
, ReturnMapping
5 from juju
.client
._definitions
import *
8 class ActionFacade(Type
):
11 schema
= {'definitions': {'Action': {'additionalProperties': False,
12 'properties': {'name': {'type': 'string'},
13 'parameters': {'patternProperties': {'.*': {'additionalProperties': True,
16 'receiver': {'type': 'string'},
17 'tag': {'type': 'string'}},
18 'required': ['tag', 'receiver', 'name'],
20 'ActionResult': {'additionalProperties': False,
21 'properties': {'action': {'$ref': '#/definitions/Action'},
22 'completed': {'format': 'date-time',
24 'enqueued': {'format': 'date-time',
26 'error': {'$ref': '#/definitions/Error'},
27 'message': {'type': 'string'},
28 'output': {'patternProperties': {'.*': {'additionalProperties': True,
31 'started': {'format': 'date-time',
33 'status': {'type': 'string'}},
35 'ActionResults': {'additionalProperties': False,
36 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'},
39 'ActionSpec': {'additionalProperties': False,
40 'properties': {'description': {'type': 'string'},
41 'params': {'patternProperties': {'.*': {'additionalProperties': True,
44 'required': ['description', 'params'],
46 'Actions': {'additionalProperties': False,
47 'properties': {'actions': {'items': {'$ref': '#/definitions/Action'},
50 'ActionsByName': {'additionalProperties': False,
51 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'},
53 'error': {'$ref': '#/definitions/Error'},
54 'name': {'type': 'string'}},
56 'ActionsByNames': {'additionalProperties': False,
57 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByName'},
60 'ActionsByReceiver': {'additionalProperties': False,
61 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'},
63 'error': {'$ref': '#/definitions/Error'},
64 'receiver': {'type': 'string'}},
66 'ActionsByReceivers': {'additionalProperties': False,
67 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByReceiver'},
70 'ApplicationCharmActionsResult': {'additionalProperties': False,
71 'properties': {'actions': {'patternProperties': {'.*': {'$ref': '#/definitions/ActionSpec'}},
73 'application-tag': {'type': 'string'},
74 'error': {'$ref': '#/definitions/Error'}},
76 'ApplicationsCharmActionsResults': {'additionalProperties': False,
77 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmActionsResult'},
80 'Entities': {'additionalProperties': False,
81 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
83 'required': ['entities'],
85 'Entity': {'additionalProperties': False,
86 'properties': {'tag': {'type': 'string'}},
89 'Error': {'additionalProperties': False,
90 'properties': {'code': {'type': 'string'},
91 'info': {'$ref': '#/definitions/ErrorInfo'},
92 'message': {'type': 'string'}},
93 'required': ['message', 'code'],
95 'ErrorInfo': {'additionalProperties': False,
96 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
97 'macaroon-path': {'type': 'string'}},
99 'FindActionsByNames': {'additionalProperties': False,
100 'properties': {'names': {'items': {'type': 'string'},
103 'FindTags': {'additionalProperties': False,
104 'properties': {'prefixes': {'items': {'type': 'string'},
106 'required': ['prefixes'],
108 'FindTagsResults': {'additionalProperties': False,
109 'properties': {'matches': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/Entity'},
112 'required': ['matches'],
114 'Macaroon': {'additionalProperties': False, 'type': 'object'},
115 'RunParams': {'additionalProperties': False,
116 'properties': {'applications': {'items': {'type': 'string'},
118 'commands': {'type': 'string'},
119 'machines': {'items': {'type': 'string'},
121 'timeout': {'type': 'integer'},
122 'units': {'items': {'type': 'string'},
124 'required': ['commands', 'timeout'],
126 'properties': {'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
127 'Result': {'$ref': '#/definitions/ActionResults'}},
129 'ApplicationsCharmsActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
130 'Result': {'$ref': '#/definitions/ApplicationsCharmActionsResults'}},
132 'Cancel': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
133 'Result': {'$ref': '#/definitions/ActionResults'}},
135 'Enqueue': {'properties': {'Params': {'$ref': '#/definitions/Actions'},
136 'Result': {'$ref': '#/definitions/ActionResults'}},
138 'FindActionTagsByPrefix': {'properties': {'Params': {'$ref': '#/definitions/FindTags'},
139 'Result': {'$ref': '#/definitions/FindTagsResults'}},
141 'FindActionsByNames': {'properties': {'Params': {'$ref': '#/definitions/FindActionsByNames'},
142 'Result': {'$ref': '#/definitions/ActionsByNames'}},
144 'ListAll': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
145 'Result': {'$ref': '#/definitions/ActionsByReceivers'}},
147 'ListCompleted': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
148 'Result': {'$ref': '#/definitions/ActionsByReceivers'}},
150 'ListPending': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
151 'Result': {'$ref': '#/definitions/ActionsByReceivers'}},
153 'ListRunning': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
154 'Result': {'$ref': '#/definitions/ActionsByReceivers'}},
156 'Run': {'properties': {'Params': {'$ref': '#/definitions/RunParams'},
157 'Result': {'$ref': '#/definitions/ActionResults'}},
159 'RunOnAllMachines': {'properties': {'Params': {'$ref': '#/definitions/RunParams'},
160 'Result': {'$ref': '#/definitions/ActionResults'}},
165 @ReturnMapping(ActionResults
)
166 async def Actions(self
, entities
):
168 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
169 Returns -> typing.Sequence<+T_co>[~ActionResult]<~ActionResult>
171 # map input types to rpc msg
173 msg
= dict(type='Action', request
='Actions', version
=2, params
=_params
)
174 _params
['entities'] = entities
175 reply
= await self
.rpc(msg
)
180 @ReturnMapping(ApplicationsCharmActionsResults
)
181 async def ApplicationsCharmsActions(self
, entities
):
183 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
184 Returns -> typing.Sequence<+T_co>[~ApplicationCharmActionsResult]<~ApplicationCharmActionsResult>
186 # map input types to rpc msg
188 msg
= dict(type='Action', request
='ApplicationsCharmsActions', version
=2, params
=_params
)
189 _params
['entities'] = entities
190 reply
= await self
.rpc(msg
)
195 @ReturnMapping(ActionResults
)
196 async def Cancel(self
, entities
):
198 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
199 Returns -> typing.Sequence<+T_co>[~ActionResult]<~ActionResult>
201 # map input types to rpc msg
203 msg
= dict(type='Action', request
='Cancel', version
=2, params
=_params
)
204 _params
['entities'] = entities
205 reply
= await self
.rpc(msg
)
210 @ReturnMapping(ActionResults
)
211 async def Enqueue(self
, actions
):
213 actions : typing.Sequence<+T_co>[~Action]<~Action>
214 Returns -> typing.Sequence<+T_co>[~ActionResult]<~ActionResult>
216 # map input types to rpc msg
218 msg
= dict(type='Action', request
='Enqueue', version
=2, params
=_params
)
219 _params
['actions'] = actions
220 reply
= await self
.rpc(msg
)
225 @ReturnMapping(FindTagsResults
)
226 async def FindActionTagsByPrefix(self
, prefixes
):
228 prefixes : typing.Sequence<+T_co>[str]
229 Returns -> typing.Sequence<+T_co>[~Entity]<~Entity>
231 # map input types to rpc msg
233 msg
= dict(type='Action', request
='FindActionTagsByPrefix', version
=2, params
=_params
)
234 _params
['prefixes'] = prefixes
235 reply
= await self
.rpc(msg
)
240 @ReturnMapping(ActionsByNames
)
241 async def FindActionsByNames(self
, names
):
243 names : typing.Sequence<+T_co>[str]
244 Returns -> typing.Sequence<+T_co>[~ActionsByName]<~ActionsByName>
246 # map input types to rpc msg
248 msg
= dict(type='Action', request
='FindActionsByNames', version
=2, params
=_params
)
249 _params
['names'] = names
250 reply
= await self
.rpc(msg
)
255 @ReturnMapping(ActionsByReceivers
)
256 async def ListAll(self
, entities
):
258 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
259 Returns -> typing.Sequence<+T_co>[~ActionsByReceiver]<~ActionsByReceiver>
261 # map input types to rpc msg
263 msg
= dict(type='Action', request
='ListAll', version
=2, params
=_params
)
264 _params
['entities'] = entities
265 reply
= await self
.rpc(msg
)
270 @ReturnMapping(ActionsByReceivers
)
271 async def ListCompleted(self
, entities
):
273 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
274 Returns -> typing.Sequence<+T_co>[~ActionsByReceiver]<~ActionsByReceiver>
276 # map input types to rpc msg
278 msg
= dict(type='Action', request
='ListCompleted', version
=2, params
=_params
)
279 _params
['entities'] = entities
280 reply
= await self
.rpc(msg
)
285 @ReturnMapping(ActionsByReceivers
)
286 async def ListPending(self
, entities
):
288 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
289 Returns -> typing.Sequence<+T_co>[~ActionsByReceiver]<~ActionsByReceiver>
291 # map input types to rpc msg
293 msg
= dict(type='Action', request
='ListPending', version
=2, params
=_params
)
294 _params
['entities'] = entities
295 reply
= await self
.rpc(msg
)
300 @ReturnMapping(ActionsByReceivers
)
301 async def ListRunning(self
, entities
):
303 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
304 Returns -> typing.Sequence<+T_co>[~ActionsByReceiver]<~ActionsByReceiver>
306 # map input types to rpc msg
308 msg
= dict(type='Action', request
='ListRunning', version
=2, params
=_params
)
309 _params
['entities'] = entities
310 reply
= await self
.rpc(msg
)
315 @ReturnMapping(ActionResults
)
316 async def Run(self
, applications
, commands
, machines
, timeout
, units
):
318 applications : typing.Sequence<+T_co>[str]
320 machines : typing.Sequence<+T_co>[str]
322 units : typing.Sequence<+T_co>[str]
323 Returns -> typing.Sequence<+T_co>[~ActionResult]<~ActionResult>
325 # map input types to rpc msg
327 msg
= dict(type='Action', request
='Run', version
=2, params
=_params
)
328 _params
['applications'] = applications
329 _params
['commands'] = commands
330 _params
['machines'] = machines
331 _params
['timeout'] = timeout
332 _params
['units'] = units
333 reply
= await self
.rpc(msg
)
338 @ReturnMapping(ActionResults
)
339 async def RunOnAllMachines(self
, applications
, commands
, machines
, timeout
, units
):
341 applications : typing.Sequence<+T_co>[str]
343 machines : typing.Sequence<+T_co>[str]
345 units : typing.Sequence<+T_co>[str]
346 Returns -> typing.Sequence<+T_co>[~ActionResult]<~ActionResult>
348 # map input types to rpc msg
350 msg
= dict(type='Action', request
='RunOnAllMachines', version
=2, params
=_params
)
351 _params
['applications'] = applications
352 _params
['commands'] = commands
353 _params
['machines'] = machines
354 _params
['timeout'] = timeout
355 _params
['units'] = units
356 reply
= await self
.rpc(msg
)
361 class AgentFacade(Type
):
364 schema
= {'definitions': {'AgentGetEntitiesResult': {'additionalProperties': False,
365 'properties': {'container-type': {'type': 'string'},
366 'error': {'$ref': '#/definitions/Error'},
367 'jobs': {'items': {'type': 'string'},
369 'life': {'type': 'string'}},
374 'AgentGetEntitiesResults': {'additionalProperties': False,
375 'properties': {'entities': {'items': {'$ref': '#/definitions/AgentGetEntitiesResult'},
377 'required': ['entities'],
379 'CloudCredential': {'additionalProperties': False,
380 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}},
382 'auth-type': {'type': 'string'},
383 'redacted': {'items': {'type': 'string'},
385 'required': ['auth-type'],
387 'CloudSpec': {'additionalProperties': False,
388 'properties': {'credential': {'$ref': '#/definitions/CloudCredential'},
389 'endpoint': {'type': 'string'},
390 'identity-endpoint': {'type': 'string'},
391 'name': {'type': 'string'},
392 'region': {'type': 'string'},
393 'storage-endpoint': {'type': 'string'},
394 'type': {'type': 'string'}},
395 'required': ['type', 'name'],
397 'CloudSpecResult': {'additionalProperties': False,
398 'properties': {'error': {'$ref': '#/definitions/Error'},
399 'result': {'$ref': '#/definitions/CloudSpec'}},
401 'CloudSpecResults': {'additionalProperties': False,
402 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'},
405 'ControllerConfigResult': {'additionalProperties': False,
406 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
409 'required': ['config'],
411 'Entities': {'additionalProperties': False,
412 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
414 'required': ['entities'],
416 'Entity': {'additionalProperties': False,
417 'properties': {'tag': {'type': 'string'}},
420 'EntityPassword': {'additionalProperties': False,
421 'properties': {'password': {'type': 'string'},
422 'tag': {'type': 'string'}},
423 'required': ['tag', 'password'],
425 'EntityPasswords': {'additionalProperties': False,
426 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'},
428 'required': ['changes'],
430 'Error': {'additionalProperties': False,
431 'properties': {'code': {'type': 'string'},
432 'info': {'$ref': '#/definitions/ErrorInfo'},
433 'message': {'type': 'string'}},
434 'required': ['message', 'code'],
436 'ErrorInfo': {'additionalProperties': False,
437 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
438 'macaroon-path': {'type': 'string'}},
440 'ErrorResult': {'additionalProperties': False,
441 'properties': {'error': {'$ref': '#/definitions/Error'}},
443 'ErrorResults': {'additionalProperties': False,
444 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
446 'required': ['results'],
448 'IsMasterResult': {'additionalProperties': False,
449 'properties': {'master': {'type': 'boolean'}},
450 'required': ['master'],
452 'Macaroon': {'additionalProperties': False, 'type': 'object'},
453 'ModelConfigResult': {'additionalProperties': False,
454 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
457 'required': ['config'],
459 'ModelTag': {'additionalProperties': False, 'type': 'object'},
460 'NotifyWatchResult': {'additionalProperties': False,
461 'properties': {'NotifyWatcherId': {'type': 'string'},
462 'error': {'$ref': '#/definitions/Error'}},
463 'required': ['NotifyWatcherId'],
465 'NotifyWatchResults': {'additionalProperties': False,
466 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'},
468 'required': ['results'],
470 'StateServingInfo': {'additionalProperties': False,
471 'properties': {'api-port': {'type': 'integer'},
472 'ca-private-key': {'type': 'string'},
473 'cert': {'type': 'string'},
474 'private-key': {'type': 'string'},
475 'shared-secret': {'type': 'string'},
476 'state-port': {'type': 'integer'},
477 'system-identity': {'type': 'string'}},
478 'required': ['api-port',
486 'properties': {'ClearReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
487 'Result': {'$ref': '#/definitions/ErrorResults'}},
489 'CloudSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
490 'Result': {'$ref': '#/definitions/CloudSpecResults'}},
492 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}},
494 'GetCloudSpec': {'properties': {'Params': {'$ref': '#/definitions/ModelTag'},
495 'Result': {'$ref': '#/definitions/CloudSpecResult'}},
497 'GetEntities': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
498 'Result': {'$ref': '#/definitions/AgentGetEntitiesResults'}},
500 'IsMaster': {'properties': {'Result': {'$ref': '#/definitions/IsMasterResult'}},
502 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}},
504 'SetPasswords': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'},
505 'Result': {'$ref': '#/definitions/ErrorResults'}},
507 'StateServingInfo': {'properties': {'Result': {'$ref': '#/definitions/StateServingInfo'}},
509 'WatchCredentials': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
510 'Result': {'$ref': '#/definitions/NotifyWatchResults'}},
512 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}},
517 @ReturnMapping(ErrorResults
)
518 async def ClearReboot(self
, entities
):
520 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
521 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
523 # map input types to rpc msg
525 msg
= dict(type='Agent', request
='ClearReboot', version
=2, params
=_params
)
526 _params
['entities'] = entities
527 reply
= await self
.rpc(msg
)
532 @ReturnMapping(CloudSpecResults
)
533 async def CloudSpec(self
, entities
):
535 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
536 Returns -> typing.Sequence<+T_co>[~CloudSpecResult]<~CloudSpecResult>
538 # map input types to rpc msg
540 msg
= dict(type='Agent', request
='CloudSpec', version
=2, params
=_params
)
541 _params
['entities'] = entities
542 reply
= await self
.rpc(msg
)
547 @ReturnMapping(ControllerConfigResult
)
548 async def ControllerConfig(self
):
551 Returns -> typing.Mapping<~KT, +VT_co>[str, typing.Any]
553 # map input types to rpc msg
555 msg
= dict(type='Agent', request
='ControllerConfig', version
=2, params
=_params
)
557 reply
= await self
.rpc(msg
)
562 @ReturnMapping(CloudSpecResult
)
563 async def GetCloudSpec(self
):
566 Returns -> typing.Union[_ForwardRef('Error'), _ForwardRef('CloudSpec')]
568 # map input types to rpc msg
570 msg
= dict(type='Agent', request
='GetCloudSpec', version
=2, params
=_params
)
572 reply
= await self
.rpc(msg
)
577 @ReturnMapping(AgentGetEntitiesResults
)
578 async def GetEntities(self
, entities
):
580 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
581 Returns -> typing.Sequence<+T_co>[~AgentGetEntitiesResult]<~AgentGetEntitiesResult>
583 # map input types to rpc msg
585 msg
= dict(type='Agent', request
='GetEntities', version
=2, params
=_params
)
586 _params
['entities'] = entities
587 reply
= await self
.rpc(msg
)
592 @ReturnMapping(IsMasterResult
)
593 async def IsMaster(self
):
598 # map input types to rpc msg
600 msg
= dict(type='Agent', request
='IsMaster', version
=2, params
=_params
)
602 reply
= await self
.rpc(msg
)
607 @ReturnMapping(ModelConfigResult
)
608 async def ModelConfig(self
):
611 Returns -> typing.Mapping<~KT, +VT_co>[str, typing.Any]
613 # map input types to rpc msg
615 msg
= dict(type='Agent', request
='ModelConfig', version
=2, params
=_params
)
617 reply
= await self
.rpc(msg
)
622 @ReturnMapping(ErrorResults
)
623 async def SetPasswords(self
, changes
):
625 changes : typing.Sequence<+T_co>[~EntityPassword]<~EntityPassword>
626 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
628 # map input types to rpc msg
630 msg
= dict(type='Agent', request
='SetPasswords', version
=2, params
=_params
)
631 _params
['changes'] = changes
632 reply
= await self
.rpc(msg
)
637 @ReturnMapping(StateServingInfo
)
638 async def StateServingInfo(self
):
641 Returns -> typing.Union[int, str]
643 # map input types to rpc msg
645 msg
= dict(type='Agent', request
='StateServingInfo', version
=2, params
=_params
)
647 reply
= await self
.rpc(msg
)
652 @ReturnMapping(NotifyWatchResults
)
653 async def WatchCredentials(self
, entities
):
655 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
656 Returns -> typing.Sequence<+T_co>[~NotifyWatchResult]<~NotifyWatchResult>
658 # map input types to rpc msg
660 msg
= dict(type='Agent', request
='WatchCredentials', version
=2, params
=_params
)
661 _params
['entities'] = entities
662 reply
= await self
.rpc(msg
)
667 @ReturnMapping(NotifyWatchResult
)
668 async def WatchForModelConfigChanges(self
):
671 Returns -> typing.Union[str, _ForwardRef('Error')]
673 # map input types to rpc msg
675 msg
= dict(type='Agent', request
='WatchForModelConfigChanges', version
=2, params
=_params
)
677 reply
= await self
.rpc(msg
)
682 class AllModelWatcherFacade(Type
):
683 name
= 'AllModelWatcher'
685 schema
= {'definitions': {'AllWatcherNextResults': {'additionalProperties': False,
686 'properties': {'deltas': {'items': {'$ref': '#/definitions/Delta'},
688 'required': ['deltas'],
690 'Delta': {'additionalProperties': False,
691 'properties': {'entity': {'additionalProperties': True,
693 'removed': {'type': 'boolean'}},
694 'required': ['removed', 'entity'],
696 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/AllWatcherNextResults'}},
698 'Stop': {'type': 'object'}},
702 @ReturnMapping(AllWatcherNextResults
)
703 async def Next(self
):
706 Returns -> typing.Sequence<+T_co>[~Delta]<~Delta>
708 # map input types to rpc msg
710 msg
= dict(type='AllModelWatcher', request
='Next', version
=2, params
=_params
)
712 reply
= await self
.rpc(msg
)
718 async def Stop(self
):
723 # map input types to rpc msg
725 msg
= dict(type='AllModelWatcher', request
='Stop', version
=2, params
=_params
)
727 reply
= await self
.rpc(msg
)
732 class AnnotationsFacade(Type
):
735 schema
= {'definitions': {'AnnotationsGetResult': {'additionalProperties': False,
736 'properties': {'annotations': {'patternProperties': {'.*': {'type': 'string'}},
738 'entity': {'type': 'string'},
739 'error': {'$ref': '#/definitions/ErrorResult'}},
740 'required': ['entity', 'annotations'],
742 'AnnotationsGetResults': {'additionalProperties': False,
743 'properties': {'results': {'items': {'$ref': '#/definitions/AnnotationsGetResult'},
745 'required': ['results'],
747 'AnnotationsSet': {'additionalProperties': False,
748 'properties': {'annotations': {'items': {'$ref': '#/definitions/EntityAnnotations'},
750 'required': ['annotations'],
752 'Entities': {'additionalProperties': False,
753 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
755 'required': ['entities'],
757 'Entity': {'additionalProperties': False,
758 'properties': {'tag': {'type': 'string'}},
761 'EntityAnnotations': {'additionalProperties': False,
762 'properties': {'annotations': {'patternProperties': {'.*': {'type': 'string'}},
764 'entity': {'type': 'string'}},
765 'required': ['entity', 'annotations'],
767 'Error': {'additionalProperties': False,
768 'properties': {'code': {'type': 'string'},
769 'info': {'$ref': '#/definitions/ErrorInfo'},
770 'message': {'type': 'string'}},
771 'required': ['message', 'code'],
773 'ErrorInfo': {'additionalProperties': False,
774 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
775 'macaroon-path': {'type': 'string'}},
777 'ErrorResult': {'additionalProperties': False,
778 'properties': {'error': {'$ref': '#/definitions/Error'}},
780 'ErrorResults': {'additionalProperties': False,
781 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
783 'required': ['results'],
785 'Macaroon': {'additionalProperties': False, 'type': 'object'}},
786 'properties': {'Get': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
787 'Result': {'$ref': '#/definitions/AnnotationsGetResults'}},
789 'Set': {'properties': {'Params': {'$ref': '#/definitions/AnnotationsSet'},
790 'Result': {'$ref': '#/definitions/ErrorResults'}},
795 @ReturnMapping(AnnotationsGetResults
)
796 async def Get(self
, entities
):
798 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
799 Returns -> typing.Sequence<+T_co>[~AnnotationsGetResult]<~AnnotationsGetResult>
801 # map input types to rpc msg
803 msg
= dict(type='Annotations', request
='Get', version
=2, params
=_params
)
804 _params
['entities'] = entities
805 reply
= await self
.rpc(msg
)
810 @ReturnMapping(ErrorResults
)
811 async def Set(self
, annotations
):
813 annotations : typing.Sequence<+T_co>[~EntityAnnotations]<~EntityAnnotations>
814 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
816 # map input types to rpc msg
818 msg
= dict(type='Annotations', request
='Set', version
=2, params
=_params
)
819 _params
['annotations'] = annotations
820 reply
= await self
.rpc(msg
)
825 class ApplicationFacade(Type
):
828 schema
= {'definitions': {'AddApplicationUnits': {'additionalProperties': False,
829 'properties': {'application': {'type': 'string'},
830 'num-units': {'type': 'integer'},
831 'placement': {'items': {'$ref': '#/definitions/Placement'},
833 'required': ['application',
837 'AddApplicationUnitsResults': {'additionalProperties': False,
838 'properties': {'units': {'items': {'type': 'string'},
840 'required': ['units'],
842 'AddRelation': {'additionalProperties': False,
843 'properties': {'endpoints': {'items': {'type': 'string'},
845 'required': ['endpoints'],
847 'AddRelationResults': {'additionalProperties': False,
848 'properties': {'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}},
850 'required': ['endpoints'],
852 'ApplicationCharmRelations': {'additionalProperties': False,
853 'properties': {'application': {'type': 'string'}},
854 'required': ['application'],
856 'ApplicationCharmRelationsResults': {'additionalProperties': False,
857 'properties': {'charm-relations': {'items': {'type': 'string'},
859 'required': ['charm-relations'],
861 'ApplicationDeploy': {'additionalProperties': False,
862 'properties': {'application': {'type': 'string'},
863 'channel': {'type': 'string'},
864 'charm-url': {'type': 'string'},
865 'config': {'patternProperties': {'.*': {'type': 'string'}},
867 'config-yaml': {'type': 'string'},
868 'constraints': {'$ref': '#/definitions/Value'},
869 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}},
871 'num-units': {'type': 'integer'},
872 'placement': {'items': {'$ref': '#/definitions/Placement'},
874 'resources': {'patternProperties': {'.*': {'type': 'string'}},
876 'series': {'type': 'string'},
877 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}},
879 'required': ['application',
887 'ApplicationDestroy': {'additionalProperties': False,
888 'properties': {'application': {'type': 'string'}},
889 'required': ['application'],
891 'ApplicationExpose': {'additionalProperties': False,
892 'properties': {'application': {'type': 'string'}},
893 'required': ['application'],
895 'ApplicationGet': {'additionalProperties': False,
896 'properties': {'application': {'type': 'string'}},
897 'required': ['application'],
899 'ApplicationGetResults': {'additionalProperties': False,
900 'properties': {'application': {'type': 'string'},
901 'charm': {'type': 'string'},
902 'config': {'patternProperties': {'.*': {'additionalProperties': True,
905 'constraints': {'$ref': '#/definitions/Value'},
906 'series': {'type': 'string'}},
907 'required': ['application',
913 'ApplicationMetricCredential': {'additionalProperties': False,
914 'properties': {'application': {'type': 'string'},
915 'metrics-credentials': {'items': {'type': 'integer'},
917 'required': ['application',
918 'metrics-credentials'],
920 'ApplicationMetricCredentials': {'additionalProperties': False,
921 'properties': {'creds': {'items': {'$ref': '#/definitions/ApplicationMetricCredential'},
923 'required': ['creds'],
925 'ApplicationSet': {'additionalProperties': False,
926 'properties': {'application': {'type': 'string'},
927 'options': {'patternProperties': {'.*': {'type': 'string'}},
929 'required': ['application', 'options'],
931 'ApplicationSetCharm': {'additionalProperties': False,
932 'properties': {'application': {'type': 'string'},
933 'channel': {'type': 'string'},
934 'charm-url': {'type': 'string'},
935 'config-settings': {'patternProperties': {'.*': {'type': 'string'}},
937 'config-settings-yaml': {'type': 'string'},
938 'force-series': {'type': 'boolean'},
939 'force-units': {'type': 'boolean'},
940 'resource-ids': {'patternProperties': {'.*': {'type': 'string'}},
942 'storage-constraints': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageConstraints'}},
944 'required': ['application',
950 'ApplicationUnexpose': {'additionalProperties': False,
951 'properties': {'application': {'type': 'string'}},
952 'required': ['application'],
954 'ApplicationUnset': {'additionalProperties': False,
955 'properties': {'application': {'type': 'string'},
956 'options': {'items': {'type': 'string'},
958 'required': ['application', 'options'],
960 'ApplicationUpdate': {'additionalProperties': False,
961 'properties': {'application': {'type': 'string'},
962 'charm-url': {'type': 'string'},
963 'constraints': {'$ref': '#/definitions/Value'},
964 'force-charm-url': {'type': 'boolean'},
965 'force-series': {'type': 'boolean'},
966 'min-units': {'type': 'integer'},
967 'settings': {'patternProperties': {'.*': {'type': 'string'}},
969 'settings-yaml': {'type': 'string'}},
970 'required': ['application',
976 'ApplicationsDeploy': {'additionalProperties': False,
977 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'},
979 'required': ['applications'],
981 'CharmRelation': {'additionalProperties': False,
982 'properties': {'interface': {'type': 'string'},
983 'limit': {'type': 'integer'},
984 'name': {'type': 'string'},
985 'optional': {'type': 'boolean'},
986 'role': {'type': 'string'},
987 'scope': {'type': 'string'}},
995 'Constraints': {'additionalProperties': False,
996 'properties': {'Count': {'type': 'integer'},
997 'Pool': {'type': 'string'},
998 'Size': {'type': 'integer'}},
999 'required': ['Pool', 'Size', 'Count'],
1001 'DestroyApplicationUnits': {'additionalProperties': False,
1002 'properties': {'unit-names': {'items': {'type': 'string'},
1004 'required': ['unit-names'],
1006 'DestroyRelation': {'additionalProperties': False,
1007 'properties': {'endpoints': {'items': {'type': 'string'},
1009 'required': ['endpoints'],
1011 'Error': {'additionalProperties': False,
1012 'properties': {'code': {'type': 'string'},
1013 'info': {'$ref': '#/definitions/ErrorInfo'},
1014 'message': {'type': 'string'}},
1015 'required': ['message', 'code'],
1017 'ErrorInfo': {'additionalProperties': False,
1018 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
1019 'macaroon-path': {'type': 'string'}},
1021 'ErrorResult': {'additionalProperties': False,
1022 'properties': {'error': {'$ref': '#/definitions/Error'}},
1024 'ErrorResults': {'additionalProperties': False,
1025 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
1027 'required': ['results'],
1029 'GetApplicationConstraints': {'additionalProperties': False,
1030 'properties': {'application': {'type': 'string'}},
1031 'required': ['application'],
1033 'GetConstraintsResults': {'additionalProperties': False,
1034 'properties': {'constraints': {'$ref': '#/definitions/Value'}},
1035 'required': ['constraints'],
1037 'Macaroon': {'additionalProperties': False, 'type': 'object'},
1038 'Placement': {'additionalProperties': False,
1039 'properties': {'directive': {'type': 'string'},
1040 'scope': {'type': 'string'}},
1041 'required': ['scope', 'directive'],
1043 'SetConstraints': {'additionalProperties': False,
1044 'properties': {'application': {'type': 'string'},
1045 'constraints': {'$ref': '#/definitions/Value'}},
1046 'required': ['application', 'constraints'],
1048 'StorageConstraints': {'additionalProperties': False,
1049 'properties': {'count': {'type': 'integer'},
1050 'pool': {'type': 'string'},
1051 'size': {'type': 'integer'}},
1053 'StringResult': {'additionalProperties': False,
1054 'properties': {'error': {'$ref': '#/definitions/Error'},
1055 'result': {'type': 'string'}},
1056 'required': ['result'],
1058 'Value': {'additionalProperties': False,
1059 'properties': {'arch': {'type': 'string'},
1060 'container': {'type': 'string'},
1061 'cores': {'type': 'integer'},
1062 'cpu-power': {'type': 'integer'},
1063 'instance-type': {'type': 'string'},
1064 'mem': {'type': 'integer'},
1065 'root-disk': {'type': 'integer'},
1066 'spaces': {'items': {'type': 'string'},
1068 'tags': {'items': {'type': 'string'},
1070 'virt-type': {'type': 'string'}},
1072 'properties': {'AddRelation': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'},
1073 'Result': {'$ref': '#/definitions/AddRelationResults'}},
1075 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'},
1076 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}},
1078 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'},
1079 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}},
1081 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'},
1082 'Result': {'$ref': '#/definitions/ErrorResults'}},
1084 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}},
1086 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}},
1088 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}},
1090 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}},
1092 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'},
1093 'Result': {'$ref': '#/definitions/ApplicationGetResults'}},
1095 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'},
1096 'Result': {'$ref': '#/definitions/StringResult'}},
1098 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/GetApplicationConstraints'},
1099 'Result': {'$ref': '#/definitions/GetConstraintsResults'}},
1101 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}},
1103 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}},
1105 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}},
1107 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'},
1108 'Result': {'$ref': '#/definitions/ErrorResults'}},
1110 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}},
1112 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}},
1114 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}},
1119 @ReturnMapping(AddRelationResults
)
1120 async def AddRelation(self
, endpoints
):
1122 endpoints : typing.Sequence<+T_co>[str]
1123 Returns -> typing.Mapping<~KT, +VT_co>[str, ~CharmRelation]<~CharmRelation>
1125 # map input types to rpc msg
1127 msg
= dict(type='Application', request
='AddRelation', version
=2, params
=_params
)
1128 _params
['endpoints'] = endpoints
1129 reply
= await self
.rpc(msg
)
1134 @ReturnMapping(AddApplicationUnitsResults
)
1135 async def AddUnits(self
, application
, num_units
, placement
):
1139 placement : typing.Sequence<+T_co>[~Placement]<~Placement>
1140 Returns -> typing.Sequence<+T_co>[str]
1142 # map input types to rpc msg
1144 msg
= dict(type='Application', request
='AddUnits', version
=2, params
=_params
)
1145 _params
['application'] = application
1146 _params
['num-units'] = num_units
1147 _params
['placement'] = placement
1148 reply
= await self
.rpc(msg
)
1153 @ReturnMapping(ApplicationCharmRelationsResults
)
1154 async def CharmRelations(self
, application
):
1157 Returns -> typing.Sequence<+T_co>[str]
1159 # map input types to rpc msg
1161 msg
= dict(type='Application', request
='CharmRelations', version
=2, params
=_params
)
1162 _params
['application'] = application
1163 reply
= await self
.rpc(msg
)
1168 @ReturnMapping(ErrorResults
)
1169 async def Deploy(self
, applications
):
1171 applications : typing.Sequence<+T_co>[~ApplicationDeploy]<~ApplicationDeploy>
1172 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
1174 # map input types to rpc msg
1176 msg
= dict(type='Application', request
='Deploy', version
=2, params
=_params
)
1177 _params
['applications'] = applications
1178 reply
= await self
.rpc(msg
)
1183 @ReturnMapping(None)
1184 async def Destroy(self
, application
):
1189 # map input types to rpc msg
1191 msg
= dict(type='Application', request
='Destroy', version
=2, params
=_params
)
1192 _params
['application'] = application
1193 reply
= await self
.rpc(msg
)
1198 @ReturnMapping(None)
1199 async def DestroyRelation(self
, endpoints
):
1201 endpoints : typing.Sequence<+T_co>[str]
1204 # map input types to rpc msg
1206 msg
= dict(type='Application', request
='DestroyRelation', version
=2, params
=_params
)
1207 _params
['endpoints'] = endpoints
1208 reply
= await self
.rpc(msg
)
1213 @ReturnMapping(None)
1214 async def DestroyUnits(self
, unit_names
):
1216 unit_names : typing.Sequence<+T_co>[str]
1219 # map input types to rpc msg
1221 msg
= dict(type='Application', request
='DestroyUnits', version
=2, params
=_params
)
1222 _params
['unit-names'] = unit_names
1223 reply
= await self
.rpc(msg
)
1228 @ReturnMapping(None)
1229 async def Expose(self
, application
):
1234 # map input types to rpc msg
1236 msg
= dict(type='Application', request
='Expose', version
=2, params
=_params
)
1237 _params
['application'] = application
1238 reply
= await self
.rpc(msg
)
1243 @ReturnMapping(ApplicationGetResults
)
1244 async def Get(self
, application
):
1247 Returns -> typing.Union[str, typing.Mapping<~KT, +VT_co>[str, typing.Any], _ForwardRef('Value')]
1249 # map input types to rpc msg
1251 msg
= dict(type='Application', request
='Get', version
=2, params
=_params
)
1252 _params
['application'] = application
1253 reply
= await self
.rpc(msg
)
1258 @ReturnMapping(StringResult
)
1259 async def GetCharmURL(self
, application
):
1262 Returns -> typing.Union[_ForwardRef('Error'), str]
1264 # map input types to rpc msg
1266 msg
= dict(type='Application', request
='GetCharmURL', version
=2, params
=_params
)
1267 _params
['application'] = application
1268 reply
= await self
.rpc(msg
)
1273 @ReturnMapping(GetConstraintsResults
)
1274 async def GetConstraints(self
, application
):
1279 # map input types to rpc msg
1281 msg
= dict(type='Application', request
='GetConstraints', version
=2, params
=_params
)
1282 _params
['application'] = application
1283 reply
= await self
.rpc(msg
)
1288 @ReturnMapping(None)
1289 async def Set(self
, application
, options
):
1292 options : typing.Mapping<~KT, +VT_co>[str, str]
1295 # map input types to rpc msg
1297 msg
= dict(type='Application', request
='Set', version
=2, params
=_params
)
1298 _params
['application'] = application
1299 _params
['options'] = options
1300 reply
= await self
.rpc(msg
)
1305 @ReturnMapping(None)
1306 async def SetCharm(self
, application
, channel
, charm_url
, config_settings
, config_settings_yaml
, force_series
, force_units
, resource_ids
, storage_constraints
):
1311 config_settings : typing.Mapping<~KT, +VT_co>[str, str]
1312 config_settings_yaml : str
1315 resource_ids : typing.Mapping<~KT, +VT_co>[str, str]
1316 storage_constraints : typing.Mapping<~KT, +VT_co>[str, ~StorageConstraints]<~StorageConstraints>
1319 # map input types to rpc msg
1321 msg
= dict(type='Application', request
='SetCharm', version
=2, params
=_params
)
1322 _params
['application'] = application
1323 _params
['channel'] = channel
1324 _params
['charm-url'] = charm_url
1325 _params
['config-settings'] = config_settings
1326 _params
['config-settings-yaml'] = config_settings_yaml
1327 _params
['force-series'] = force_series
1328 _params
['force-units'] = force_units
1329 _params
['resource-ids'] = resource_ids
1330 _params
['storage-constraints'] = storage_constraints
1331 reply
= await self
.rpc(msg
)
1336 @ReturnMapping(None)
1337 async def SetConstraints(self
, application
, constraints
):
1343 # map input types to rpc msg
1345 msg
= dict(type='Application', request
='SetConstraints', version
=2, params
=_params
)
1346 _params
['application'] = application
1347 _params
['constraints'] = constraints
1348 reply
= await self
.rpc(msg
)
1353 @ReturnMapping(ErrorResults
)
1354 async def SetMetricCredentials(self
, creds
):
1356 creds : typing.Sequence<+T_co>[~ApplicationMetricCredential]<~ApplicationMetricCredential>
1357 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
1359 # map input types to rpc msg
1361 msg
= dict(type='Application', request
='SetMetricCredentials', version
=2, params
=_params
)
1362 _params
['creds'] = creds
1363 reply
= await self
.rpc(msg
)
1368 @ReturnMapping(None)
1369 async def Unexpose(self
, application
):
1374 # map input types to rpc msg
1376 msg
= dict(type='Application', request
='Unexpose', version
=2, params
=_params
)
1377 _params
['application'] = application
1378 reply
= await self
.rpc(msg
)
1383 @ReturnMapping(None)
1384 async def Unset(self
, application
, options
):
1387 options : typing.Sequence<+T_co>[str]
1390 # map input types to rpc msg
1392 msg
= dict(type='Application', request
='Unset', version
=2, params
=_params
)
1393 _params
['application'] = application
1394 _params
['options'] = options
1395 reply
= await self
.rpc(msg
)
1400 @ReturnMapping(None)
1401 async def Update(self
, application
, charm_url
, constraints
, force_charm_url
, force_series
, min_units
, settings
, settings_yaml
):
1406 force_charm_url : bool
1409 settings : typing.Mapping<~KT, +VT_co>[str, str]
1413 # map input types to rpc msg
1415 msg
= dict(type='Application', request
='Update', version
=2, params
=_params
)
1416 _params
['application'] = application
1417 _params
['charm-url'] = charm_url
1418 _params
['constraints'] = constraints
1419 _params
['force-charm-url'] = force_charm_url
1420 _params
['force-series'] = force_series
1421 _params
['min-units'] = min_units
1422 _params
['settings'] = settings
1423 _params
['settings-yaml'] = settings_yaml
1424 reply
= await self
.rpc(msg
)
1429 class BlockFacade(Type
):
1432 schema
= {'definitions': {'Block': {'additionalProperties': False,
1433 'properties': {'id': {'type': 'string'},
1434 'message': {'type': 'string'},
1435 'tag': {'type': 'string'},
1436 'type': {'type': 'string'}},
1437 'required': ['id', 'tag', 'type'],
1439 'BlockResult': {'additionalProperties': False,
1440 'properties': {'error': {'$ref': '#/definitions/Error'},
1441 'result': {'$ref': '#/definitions/Block'}},
1442 'required': ['result'],
1444 'BlockResults': {'additionalProperties': False,
1445 'properties': {'results': {'items': {'$ref': '#/definitions/BlockResult'},
1448 'BlockSwitchParams': {'additionalProperties': False,
1449 'properties': {'message': {'type': 'string'},
1450 'type': {'type': 'string'}},
1451 'required': ['type'],
1453 'Error': {'additionalProperties': False,
1454 'properties': {'code': {'type': 'string'},
1455 'info': {'$ref': '#/definitions/ErrorInfo'},
1456 'message': {'type': 'string'}},
1457 'required': ['message', 'code'],
1459 'ErrorInfo': {'additionalProperties': False,
1460 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
1461 'macaroon-path': {'type': 'string'}},
1463 'ErrorResult': {'additionalProperties': False,
1464 'properties': {'error': {'$ref': '#/definitions/Error'}},
1466 'Macaroon': {'additionalProperties': False, 'type': 'object'}},
1467 'properties': {'List': {'properties': {'Result': {'$ref': '#/definitions/BlockResults'}},
1469 'SwitchBlockOff': {'properties': {'Params': {'$ref': '#/definitions/BlockSwitchParams'},
1470 'Result': {'$ref': '#/definitions/ErrorResult'}},
1472 'SwitchBlockOn': {'properties': {'Params': {'$ref': '#/definitions/BlockSwitchParams'},
1473 'Result': {'$ref': '#/definitions/ErrorResult'}},
1478 @ReturnMapping(BlockResults
)
1479 async def List(self
):
1482 Returns -> typing.Sequence<+T_co>[~BlockResult]<~BlockResult>
1484 # map input types to rpc msg
1486 msg
= dict(type='Block', request
='List', version
=2, params
=_params
)
1488 reply
= await self
.rpc(msg
)
1493 @ReturnMapping(ErrorResult
)
1494 async def SwitchBlockOff(self
, message
, type_
):
1500 # map input types to rpc msg
1502 msg
= dict(type='Block', request
='SwitchBlockOff', version
=2, params
=_params
)
1503 _params
['message'] = message
1504 _params
['type'] = type_
1505 reply
= await self
.rpc(msg
)
1510 @ReturnMapping(ErrorResult
)
1511 async def SwitchBlockOn(self
, message
, type_
):
1517 # map input types to rpc msg
1519 msg
= dict(type='Block', request
='SwitchBlockOn', version
=2, params
=_params
)
1520 _params
['message'] = message
1521 _params
['type'] = type_
1522 reply
= await self
.rpc(msg
)
1527 class CharmRevisionUpdaterFacade(Type
):
1528 name
= 'CharmRevisionUpdater'
1530 schema
= {'definitions': {'Error': {'additionalProperties': False,
1531 'properties': {'code': {'type': 'string'},
1532 'info': {'$ref': '#/definitions/ErrorInfo'},
1533 'message': {'type': 'string'}},
1534 'required': ['message', 'code'],
1536 'ErrorInfo': {'additionalProperties': False,
1537 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
1538 'macaroon-path': {'type': 'string'}},
1540 'ErrorResult': {'additionalProperties': False,
1541 'properties': {'error': {'$ref': '#/definitions/Error'}},
1543 'Macaroon': {'additionalProperties': False, 'type': 'object'}},
1544 'properties': {'UpdateLatestRevisions': {'properties': {'Result': {'$ref': '#/definitions/ErrorResult'}},
1549 @ReturnMapping(ErrorResult
)
1550 async def UpdateLatestRevisions(self
):
1555 # map input types to rpc msg
1557 msg
= dict(type='CharmRevisionUpdater', request
='UpdateLatestRevisions', version
=2, params
=_params
)
1559 reply
= await self
.rpc(msg
)
1564 class CharmsFacade(Type
):
1567 schema
= {'definitions': {'CharmActionSpec': {'additionalProperties': False,
1568 'properties': {'description': {'type': 'string'},
1569 'params': {'patternProperties': {'.*': {'additionalProperties': True,
1572 'required': ['description', 'params'],
1574 'CharmActions': {'additionalProperties': False,
1575 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}},
1578 'CharmInfo': {'additionalProperties': False,
1579 'properties': {'actions': {'$ref': '#/definitions/CharmActions'},
1580 'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}},
1582 'meta': {'$ref': '#/definitions/CharmMeta'},
1583 'metrics': {'$ref': '#/definitions/CharmMetrics'},
1584 'revision': {'type': 'integer'},
1585 'url': {'type': 'string'}},
1586 'required': ['revision', 'url', 'config'],
1588 'CharmMeta': {'additionalProperties': False,
1589 'properties': {'categories': {'items': {'type': 'string'},
1591 'description': {'type': 'string'},
1592 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}},
1594 'min-juju-version': {'type': 'string'},
1595 'name': {'type': 'string'},
1596 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}},
1598 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}},
1600 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}},
1602 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}},
1604 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}},
1606 'series': {'items': {'type': 'string'},
1608 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}},
1610 'subordinate': {'type': 'boolean'},
1611 'summary': {'type': 'string'},
1612 'tags': {'items': {'type': 'string'},
1614 'terms': {'items': {'type': 'string'},
1616 'required': ['name',
1621 'CharmMetric': {'additionalProperties': False,
1622 'properties': {'description': {'type': 'string'},
1623 'type': {'type': 'string'}},
1624 'required': ['type', 'description'],
1626 'CharmMetrics': {'additionalProperties': False,
1627 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}},
1629 'plan': {'$ref': '#/definitions/CharmPlan'}},
1630 'required': ['metrics', 'plan'],
1632 'CharmOption': {'additionalProperties': False,
1633 'properties': {'default': {'additionalProperties': True,
1635 'description': {'type': 'string'},
1636 'type': {'type': 'string'}},
1637 'required': ['type'],
1639 'CharmPayloadClass': {'additionalProperties': False,
1640 'properties': {'name': {'type': 'string'},
1641 'type': {'type': 'string'}},
1642 'required': ['name', 'type'],
1644 'CharmPlan': {'additionalProperties': False,
1645 'properties': {'required': {'type': 'boolean'}},
1646 'required': ['required'],
1648 'CharmRelation': {'additionalProperties': False,
1649 'properties': {'interface': {'type': 'string'},
1650 'limit': {'type': 'integer'},
1651 'name': {'type': 'string'},
1652 'optional': {'type': 'boolean'},
1653 'role': {'type': 'string'},
1654 'scope': {'type': 'string'}},
1655 'required': ['name',
1662 'CharmResourceMeta': {'additionalProperties': False,
1663 'properties': {'description': {'type': 'string'},
1664 'name': {'type': 'string'},
1665 'path': {'type': 'string'},
1666 'type': {'type': 'string'}},
1667 'required': ['name',
1672 'CharmStorage': {'additionalProperties': False,
1673 'properties': {'count-max': {'type': 'integer'},
1674 'count-min': {'type': 'integer'},
1675 'description': {'type': 'string'},
1676 'location': {'type': 'string'},
1677 'minimum-size': {'type': 'integer'},
1678 'name': {'type': 'string'},
1679 'properties': {'items': {'type': 'string'},
1681 'read-only': {'type': 'boolean'},
1682 'shared': {'type': 'boolean'},
1683 'type': {'type': 'string'}},
1684 'required': ['name',
1693 'CharmURL': {'additionalProperties': False,
1694 'properties': {'url': {'type': 'string'}},
1695 'required': ['url'],
1697 'CharmsList': {'additionalProperties': False,
1698 'properties': {'names': {'items': {'type': 'string'},
1700 'required': ['names'],
1702 'CharmsListResult': {'additionalProperties': False,
1703 'properties': {'charm-urls': {'items': {'type': 'string'},
1705 'required': ['charm-urls'],
1707 'IsMeteredResult': {'additionalProperties': False,
1708 'properties': {'metered': {'type': 'boolean'}},
1709 'required': ['metered'],
1711 'properties': {'CharmInfo': {'properties': {'Params': {'$ref': '#/definitions/CharmURL'},
1712 'Result': {'$ref': '#/definitions/CharmInfo'}},
1714 'IsMetered': {'properties': {'Params': {'$ref': '#/definitions/CharmURL'},
1715 'Result': {'$ref': '#/definitions/IsMeteredResult'}},
1717 'List': {'properties': {'Params': {'$ref': '#/definitions/CharmsList'},
1718 'Result': {'$ref': '#/definitions/CharmsListResult'}},
1723 @ReturnMapping(CharmInfo
)
1724 async def CharmInfo(self
, url
):
1727 Returns -> typing.Union[_ForwardRef('CharmActions'), typing.Mapping<~KT, +VT_co>[str, ~CharmOption]<~CharmOption>, _ForwardRef('CharmMeta'), _ForwardRef('CharmMetrics'), int, str]
1729 # map input types to rpc msg
1731 msg
= dict(type='Charms', request
='CharmInfo', version
=2, params
=_params
)
1732 _params
['url'] = url
1733 reply
= await self
.rpc(msg
)
1738 @ReturnMapping(IsMeteredResult
)
1739 async def IsMetered(self
, url
):
1744 # map input types to rpc msg
1746 msg
= dict(type='Charms', request
='IsMetered', version
=2, params
=_params
)
1747 _params
['url'] = url
1748 reply
= await self
.rpc(msg
)
1753 @ReturnMapping(CharmsListResult
)
1754 async def List(self
, names
):
1756 names : typing.Sequence<+T_co>[str]
1757 Returns -> typing.Sequence<+T_co>[str]
1759 # map input types to rpc msg
1761 msg
= dict(type='Charms', request
='List', version
=2, params
=_params
)
1762 _params
['names'] = names
1763 reply
= await self
.rpc(msg
)
1768 class CleanerFacade(Type
):
1771 schema
= {'definitions': {'Error': {'additionalProperties': False,
1772 'properties': {'code': {'type': 'string'},
1773 'info': {'$ref': '#/definitions/ErrorInfo'},
1774 'message': {'type': 'string'}},
1775 'required': ['message', 'code'],
1777 'ErrorInfo': {'additionalProperties': False,
1778 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
1779 'macaroon-path': {'type': 'string'}},
1781 'Macaroon': {'additionalProperties': False, 'type': 'object'},
1782 'NotifyWatchResult': {'additionalProperties': False,
1783 'properties': {'NotifyWatcherId': {'type': 'string'},
1784 'error': {'$ref': '#/definitions/Error'}},
1785 'required': ['NotifyWatcherId'],
1787 'properties': {'Cleanup': {'type': 'object'},
1788 'WatchCleanups': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}},
1793 @ReturnMapping(None)
1794 async def Cleanup(self
):
1799 # map input types to rpc msg
1801 msg
= dict(type='Cleaner', request
='Cleanup', version
=2, params
=_params
)
1803 reply
= await self
.rpc(msg
)
1808 @ReturnMapping(NotifyWatchResult
)
1809 async def WatchCleanups(self
):
1812 Returns -> typing.Union[str, _ForwardRef('Error')]
1814 # map input types to rpc msg
1816 msg
= dict(type='Cleaner', request
='WatchCleanups', version
=2, params
=_params
)
1818 reply
= await self
.rpc(msg
)
1823 class DiscoverSpacesFacade(Type
):
1824 name
= 'DiscoverSpaces'
1826 schema
= {'definitions': {'AddSubnetParams': {'additionalProperties': False,
1827 'properties': {'provider-network-id': {'type': 'string'},
1828 'space-tag': {'type': 'string'},
1829 'subnet-provider-id': {'type': 'string'},
1830 'subnet-tag': {'type': 'string'},
1831 'vlan-tag': {'type': 'integer'},
1832 'zones': {'items': {'type': 'string'},
1834 'required': ['space-tag'],
1836 'AddSubnetsParams': {'additionalProperties': False,
1837 'properties': {'subnets': {'items': {'$ref': '#/definitions/AddSubnetParams'},
1839 'required': ['subnets'],
1841 'CreateSpaceParams': {'additionalProperties': False,
1842 'properties': {'provider-id': {'type': 'string'},
1843 'public': {'type': 'boolean'},
1844 'space-tag': {'type': 'string'},
1845 'subnet-tags': {'items': {'type': 'string'},
1847 'required': ['subnet-tags',
1851 'CreateSpacesParams': {'additionalProperties': False,
1852 'properties': {'spaces': {'items': {'$ref': '#/definitions/CreateSpaceParams'},
1854 'required': ['spaces'],
1856 'DiscoverSpacesResults': {'additionalProperties': False,
1857 'properties': {'results': {'items': {'$ref': '#/definitions/ProviderSpace'},
1859 'required': ['results'],
1861 'Error': {'additionalProperties': False,
1862 'properties': {'code': {'type': 'string'},
1863 'info': {'$ref': '#/definitions/ErrorInfo'},
1864 'message': {'type': 'string'}},
1865 'required': ['message', 'code'],
1867 'ErrorInfo': {'additionalProperties': False,
1868 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
1869 'macaroon-path': {'type': 'string'}},
1871 'ErrorResult': {'additionalProperties': False,
1872 'properties': {'error': {'$ref': '#/definitions/Error'}},
1874 'ErrorResults': {'additionalProperties': False,
1875 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
1877 'required': ['results'],
1879 'ListSubnetsResults': {'additionalProperties': False,
1880 'properties': {'results': {'items': {'$ref': '#/definitions/Subnet'},
1882 'required': ['results'],
1884 'Macaroon': {'additionalProperties': False, 'type': 'object'},
1885 'ModelConfigResult': {'additionalProperties': False,
1886 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
1889 'required': ['config'],
1891 'ProviderSpace': {'additionalProperties': False,
1892 'properties': {'error': {'$ref': '#/definitions/Error'},
1893 'name': {'type': 'string'},
1894 'provider-id': {'type': 'string'},
1895 'subnets': {'items': {'$ref': '#/definitions/Subnet'},
1897 'required': ['name',
1901 'Subnet': {'additionalProperties': False,
1902 'properties': {'cidr': {'type': 'string'},
1903 'life': {'type': 'string'},
1904 'provider-id': {'type': 'string'},
1905 'provider-network-id': {'type': 'string'},
1906 'space-tag': {'type': 'string'},
1907 'status': {'type': 'string'},
1908 'vlan-tag': {'type': 'integer'},
1909 'zones': {'items': {'type': 'string'},
1911 'required': ['cidr',
1917 'SubnetsFilters': {'additionalProperties': False,
1918 'properties': {'space-tag': {'type': 'string'},
1919 'zone': {'type': 'string'}},
1921 'properties': {'AddSubnets': {'properties': {'Params': {'$ref': '#/definitions/AddSubnetsParams'},
1922 'Result': {'$ref': '#/definitions/ErrorResults'}},
1924 'CreateSpaces': {'properties': {'Params': {'$ref': '#/definitions/CreateSpacesParams'},
1925 'Result': {'$ref': '#/definitions/ErrorResults'}},
1927 'ListSpaces': {'properties': {'Result': {'$ref': '#/definitions/DiscoverSpacesResults'}},
1929 'ListSubnets': {'properties': {'Params': {'$ref': '#/definitions/SubnetsFilters'},
1930 'Result': {'$ref': '#/definitions/ListSubnetsResults'}},
1932 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}},
1937 @ReturnMapping(ErrorResults
)
1938 async def AddSubnets(self
, subnets
):
1940 subnets : typing.Sequence<+T_co>[~AddSubnetParams]<~AddSubnetParams>
1941 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
1943 # map input types to rpc msg
1945 msg
= dict(type='DiscoverSpaces', request
='AddSubnets', version
=2, params
=_params
)
1946 _params
['subnets'] = subnets
1947 reply
= await self
.rpc(msg
)
1952 @ReturnMapping(ErrorResults
)
1953 async def CreateSpaces(self
, spaces
):
1955 spaces : typing.Sequence<+T_co>[~CreateSpaceParams]<~CreateSpaceParams>
1956 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
1958 # map input types to rpc msg
1960 msg
= dict(type='DiscoverSpaces', request
='CreateSpaces', version
=2, params
=_params
)
1961 _params
['spaces'] = spaces
1962 reply
= await self
.rpc(msg
)
1967 @ReturnMapping(DiscoverSpacesResults
)
1968 async def ListSpaces(self
):
1971 Returns -> typing.Sequence<+T_co>[~ProviderSpace]<~ProviderSpace>
1973 # map input types to rpc msg
1975 msg
= dict(type='DiscoverSpaces', request
='ListSpaces', version
=2, params
=_params
)
1977 reply
= await self
.rpc(msg
)
1982 @ReturnMapping(ListSubnetsResults
)
1983 async def ListSubnets(self
, space_tag
, zone
):
1987 Returns -> typing.Sequence<+T_co>[~Subnet]<~Subnet>
1989 # map input types to rpc msg
1991 msg
= dict(type='DiscoverSpaces', request
='ListSubnets', version
=2, params
=_params
)
1992 _params
['space-tag'] = space_tag
1993 _params
['zone'] = zone
1994 reply
= await self
.rpc(msg
)
1999 @ReturnMapping(ModelConfigResult
)
2000 async def ModelConfig(self
):
2003 Returns -> typing.Mapping<~KT, +VT_co>[str, typing.Any]
2005 # map input types to rpc msg
2007 msg
= dict(type='DiscoverSpaces', request
='ModelConfig', version
=2, params
=_params
)
2009 reply
= await self
.rpc(msg
)
2014 class DiskManagerFacade(Type
):
2015 name
= 'DiskManager'
2017 schema
= {'definitions': {'BlockDevice': {'additionalProperties': False,
2018 'properties': {'BusAddress': {'type': 'string'},
2019 'DeviceLinks': {'items': {'type': 'string'},
2021 'DeviceName': {'type': 'string'},
2022 'FilesystemType': {'type': 'string'},
2023 'HardwareId': {'type': 'string'},
2024 'InUse': {'type': 'boolean'},
2025 'Label': {'type': 'string'},
2026 'MountPoint': {'type': 'string'},
2027 'Size': {'type': 'integer'},
2028 'UUID': {'type': 'string'}},
2029 'required': ['DeviceName',
2040 'Error': {'additionalProperties': False,
2041 'properties': {'code': {'type': 'string'},
2042 'info': {'$ref': '#/definitions/ErrorInfo'},
2043 'message': {'type': 'string'}},
2044 'required': ['message', 'code'],
2046 'ErrorInfo': {'additionalProperties': False,
2047 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2048 'macaroon-path': {'type': 'string'}},
2050 'ErrorResult': {'additionalProperties': False,
2051 'properties': {'error': {'$ref': '#/definitions/Error'}},
2053 'ErrorResults': {'additionalProperties': False,
2054 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
2056 'required': ['results'],
2058 'Macaroon': {'additionalProperties': False, 'type': 'object'},
2059 'MachineBlockDevices': {'additionalProperties': False,
2060 'properties': {'block-devices': {'items': {'$ref': '#/definitions/BlockDevice'},
2062 'machine': {'type': 'string'}},
2063 'required': ['machine'],
2065 'SetMachineBlockDevices': {'additionalProperties': False,
2066 'properties': {'machine-block-devices': {'items': {'$ref': '#/definitions/MachineBlockDevices'},
2068 'required': ['machine-block-devices'],
2070 'properties': {'SetMachineBlockDevices': {'properties': {'Params': {'$ref': '#/definitions/SetMachineBlockDevices'},
2071 'Result': {'$ref': '#/definitions/ErrorResults'}},
2076 @ReturnMapping(ErrorResults
)
2077 async def SetMachineBlockDevices(self
, machine_block_devices
):
2079 machine_block_devices : typing.Sequence<+T_co>[~MachineBlockDevices]<~MachineBlockDevices>
2080 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
2082 # map input types to rpc msg
2084 msg
= dict(type='DiskManager', request
='SetMachineBlockDevices', version
=2, params
=_params
)
2085 _params
['machine-block-devices'] = machine_block_devices
2086 reply
= await self
.rpc(msg
)
2091 class EntityWatcherFacade(Type
):
2092 name
= 'EntityWatcher'
2094 schema
= {'definitions': {'EntitiesWatchResult': {'additionalProperties': False,
2095 'properties': {'changes': {'items': {'type': 'string'},
2097 'error': {'$ref': '#/definitions/Error'},
2098 'watcher-id': {'type': 'string'}},
2099 'required': ['watcher-id'],
2101 'Error': {'additionalProperties': False,
2102 'properties': {'code': {'type': 'string'},
2103 'info': {'$ref': '#/definitions/ErrorInfo'},
2104 'message': {'type': 'string'}},
2105 'required': ['message', 'code'],
2107 'ErrorInfo': {'additionalProperties': False,
2108 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2109 'macaroon-path': {'type': 'string'}},
2111 'Macaroon': {'additionalProperties': False, 'type': 'object'}},
2112 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/EntitiesWatchResult'}},
2114 'Stop': {'type': 'object'}},
2118 @ReturnMapping(EntitiesWatchResult
)
2119 async def Next(self
):
2122 Returns -> typing.Union[typing.Sequence<+T_co>[str], _ForwardRef('Error')]
2124 # map input types to rpc msg
2126 msg
= dict(type='EntityWatcher', request
='Next', version
=2, params
=_params
)
2128 reply
= await self
.rpc(msg
)
2133 @ReturnMapping(None)
2134 async def Stop(self
):
2139 # map input types to rpc msg
2141 msg
= dict(type='EntityWatcher', request
='Stop', version
=2, params
=_params
)
2143 reply
= await self
.rpc(msg
)
2148 class FilesystemAttachmentsWatcherFacade(Type
):
2149 name
= 'FilesystemAttachmentsWatcher'
2151 schema
= {'definitions': {'Error': {'additionalProperties': False,
2152 'properties': {'code': {'type': 'string'},
2153 'info': {'$ref': '#/definitions/ErrorInfo'},
2154 'message': {'type': 'string'}},
2155 'required': ['message', 'code'],
2157 'ErrorInfo': {'additionalProperties': False,
2158 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2159 'macaroon-path': {'type': 'string'}},
2161 'Macaroon': {'additionalProperties': False, 'type': 'object'},
2162 'MachineStorageId': {'additionalProperties': False,
2163 'properties': {'attachment-tag': {'type': 'string'},
2164 'machine-tag': {'type': 'string'}},
2165 'required': ['machine-tag',
2168 'MachineStorageIdsWatchResult': {'additionalProperties': False,
2169 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'},
2171 'error': {'$ref': '#/definitions/Error'},
2172 'watcher-id': {'type': 'string'}},
2173 'required': ['watcher-id',
2176 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}},
2178 'Stop': {'type': 'object'}},
2182 @ReturnMapping(MachineStorageIdsWatchResult
)
2183 async def Next(self
):
2186 Returns -> typing.Union[typing.Sequence<+T_co>[~MachineStorageId]<~MachineStorageId>, _ForwardRef('Error')]
2188 # map input types to rpc msg
2190 msg
= dict(type='FilesystemAttachmentsWatcher', request
='Next', version
=2, params
=_params
)
2192 reply
= await self
.rpc(msg
)
2197 @ReturnMapping(None)
2198 async def Stop(self
):
2203 # map input types to rpc msg
2205 msg
= dict(type='FilesystemAttachmentsWatcher', request
='Stop', version
=2, params
=_params
)
2207 reply
= await self
.rpc(msg
)
2212 class HighAvailabilityFacade(Type
):
2213 name
= 'HighAvailability'
2215 schema
= {'definitions': {'Address': {'additionalProperties': False,
2216 'properties': {'Scope': {'type': 'string'},
2217 'SpaceName': {'type': 'string'},
2218 'SpaceProviderId': {'type': 'string'},
2219 'Type': {'type': 'string'},
2220 'Value': {'type': 'string'}},
2221 'required': ['Value',
2227 'ControllersChangeResult': {'additionalProperties': False,
2228 'properties': {'error': {'$ref': '#/definitions/Error'},
2229 'result': {'$ref': '#/definitions/ControllersChanges'}},
2230 'required': ['result'],
2232 'ControllersChangeResults': {'additionalProperties': False,
2233 'properties': {'results': {'items': {'$ref': '#/definitions/ControllersChangeResult'},
2235 'required': ['results'],
2237 'ControllersChanges': {'additionalProperties': False,
2238 'properties': {'added': {'items': {'type': 'string'},
2240 'converted': {'items': {'type': 'string'},
2242 'demoted': {'items': {'type': 'string'},
2244 'maintained': {'items': {'type': 'string'},
2246 'promoted': {'items': {'type': 'string'},
2248 'removed': {'items': {'type': 'string'},
2251 'ControllersSpec': {'additionalProperties': False,
2252 'properties': {'constraints': {'$ref': '#/definitions/Value'},
2253 'num-controllers': {'type': 'integer'},
2254 'placement': {'items': {'type': 'string'},
2256 'series': {'type': 'string'}},
2257 'required': ['num-controllers'],
2259 'ControllersSpecs': {'additionalProperties': False,
2260 'properties': {'specs': {'items': {'$ref': '#/definitions/ControllersSpec'},
2262 'required': ['specs'],
2264 'Error': {'additionalProperties': False,
2265 'properties': {'code': {'type': 'string'},
2266 'info': {'$ref': '#/definitions/ErrorInfo'},
2267 'message': {'type': 'string'}},
2268 'required': ['message', 'code'],
2270 'ErrorInfo': {'additionalProperties': False,
2271 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2272 'macaroon-path': {'type': 'string'}},
2274 'HAMember': {'additionalProperties': False,
2275 'properties': {'public-address': {'$ref': '#/definitions/Address'},
2276 'series': {'type': 'string'},
2277 'tag': {'type': 'string'}},
2278 'required': ['tag', 'public-address', 'series'],
2280 'Macaroon': {'additionalProperties': False, 'type': 'object'},
2281 'Member': {'additionalProperties': False,
2282 'properties': {'Address': {'type': 'string'},
2283 'Arbiter': {'type': 'boolean'},
2284 'BuildIndexes': {'type': 'boolean'},
2285 'Hidden': {'type': 'boolean'},
2286 'Id': {'type': 'integer'},
2287 'Priority': {'type': 'number'},
2288 'SlaveDelay': {'type': 'integer'},
2289 'Tags': {'patternProperties': {'.*': {'type': 'string'}},
2291 'Votes': {'type': 'integer'}},
2302 'MongoUpgradeResults': {'additionalProperties': False,
2303 'properties': {'ha-members': {'items': {'$ref': '#/definitions/HAMember'},
2305 'master': {'$ref': '#/definitions/HAMember'},
2306 'rs-members': {'items': {'$ref': '#/definitions/Member'},
2308 'required': ['rs-members',
2312 'MongoVersion': {'additionalProperties': False,
2313 'properties': {'engine': {'type': 'string'},
2314 'major': {'type': 'integer'},
2315 'minor': {'type': 'integer'},
2316 'patch': {'type': 'string'}},
2317 'required': ['major',
2322 'ResumeReplicationParams': {'additionalProperties': False,
2323 'properties': {'members': {'items': {'$ref': '#/definitions/Member'},
2325 'required': ['members'],
2327 'UpgradeMongoParams': {'additionalProperties': False,
2328 'properties': {'target': {'$ref': '#/definitions/MongoVersion'}},
2329 'required': ['target'],
2331 'Value': {'additionalProperties': False,
2332 'properties': {'arch': {'type': 'string'},
2333 'container': {'type': 'string'},
2334 'cores': {'type': 'integer'},
2335 'cpu-power': {'type': 'integer'},
2336 'instance-type': {'type': 'string'},
2337 'mem': {'type': 'integer'},
2338 'root-disk': {'type': 'integer'},
2339 'spaces': {'items': {'type': 'string'},
2341 'tags': {'items': {'type': 'string'},
2343 'virt-type': {'type': 'string'}},
2345 'properties': {'EnableHA': {'properties': {'Params': {'$ref': '#/definitions/ControllersSpecs'},
2346 'Result': {'$ref': '#/definitions/ControllersChangeResults'}},
2348 'ResumeHAReplicationAfterUpgrade': {'properties': {'Params': {'$ref': '#/definitions/ResumeReplicationParams'}},
2350 'StopHAReplicationForUpgrade': {'properties': {'Params': {'$ref': '#/definitions/UpgradeMongoParams'},
2351 'Result': {'$ref': '#/definitions/MongoUpgradeResults'}},
2356 @ReturnMapping(ControllersChangeResults
)
2357 async def EnableHA(self
, specs
):
2359 specs : typing.Sequence<+T_co>[~ControllersSpec]<~ControllersSpec>
2360 Returns -> typing.Sequence<+T_co>[~ControllersChangeResult]<~ControllersChangeResult>
2362 # map input types to rpc msg
2364 msg
= dict(type='HighAvailability', request
='EnableHA', version
=2, params
=_params
)
2365 _params
['specs'] = specs
2366 reply
= await self
.rpc(msg
)
2371 @ReturnMapping(None)
2372 async def ResumeHAReplicationAfterUpgrade(self
, members
):
2374 members : typing.Sequence<+T_co>[~Member]<~Member>
2377 # map input types to rpc msg
2379 msg
= dict(type='HighAvailability', request
='ResumeHAReplicationAfterUpgrade', version
=2, params
=_params
)
2380 _params
['members'] = members
2381 reply
= await self
.rpc(msg
)
2386 @ReturnMapping(MongoUpgradeResults
)
2387 async def StopHAReplicationForUpgrade(self
, target
):
2389 target : MongoVersion
2390 Returns -> typing.Union[_ForwardRef('HAMember'), typing.Sequence<+T_co>[~Member]<~Member>]
2392 # map input types to rpc msg
2394 msg
= dict(type='HighAvailability', request
='StopHAReplicationForUpgrade', version
=2, params
=_params
)
2395 _params
['target'] = target
2396 reply
= await self
.rpc(msg
)
2401 class ImageManagerFacade(Type
):
2402 name
= 'ImageManager'
2404 schema
= {'definitions': {'Error': {'additionalProperties': False,
2405 'properties': {'code': {'type': 'string'},
2406 'info': {'$ref': '#/definitions/ErrorInfo'},
2407 'message': {'type': 'string'}},
2408 'required': ['message', 'code'],
2410 'ErrorInfo': {'additionalProperties': False,
2411 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2412 'macaroon-path': {'type': 'string'}},
2414 'ErrorResult': {'additionalProperties': False,
2415 'properties': {'error': {'$ref': '#/definitions/Error'}},
2417 'ErrorResults': {'additionalProperties': False,
2418 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
2420 'required': ['results'],
2422 'ImageFilterParams': {'additionalProperties': False,
2423 'properties': {'images': {'items': {'$ref': '#/definitions/ImageSpec'},
2425 'required': ['images'],
2427 'ImageMetadata': {'additionalProperties': False,
2428 'properties': {'arch': {'type': 'string'},
2429 'created': {'format': 'date-time',
2431 'kind': {'type': 'string'},
2432 'series': {'type': 'string'},
2433 'url': {'type': 'string'}},
2434 'required': ['kind',
2440 'ImageSpec': {'additionalProperties': False,
2441 'properties': {'arch': {'type': 'string'},
2442 'kind': {'type': 'string'},
2443 'series': {'type': 'string'}},
2444 'required': ['kind', 'arch', 'series'],
2446 'ListImageResult': {'additionalProperties': False,
2447 'properties': {'result': {'items': {'$ref': '#/definitions/ImageMetadata'},
2449 'required': ['result'],
2451 'Macaroon': {'additionalProperties': False, 'type': 'object'}},
2452 'properties': {'DeleteImages': {'properties': {'Params': {'$ref': '#/definitions/ImageFilterParams'},
2453 'Result': {'$ref': '#/definitions/ErrorResults'}},
2455 'ListImages': {'properties': {'Params': {'$ref': '#/definitions/ImageFilterParams'},
2456 'Result': {'$ref': '#/definitions/ListImageResult'}},
2461 @ReturnMapping(ErrorResults
)
2462 async def DeleteImages(self
, images
):
2464 images : typing.Sequence<+T_co>[~ImageSpec]<~ImageSpec>
2465 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
2467 # map input types to rpc msg
2469 msg
= dict(type='ImageManager', request
='DeleteImages', version
=2, params
=_params
)
2470 _params
['images'] = images
2471 reply
= await self
.rpc(msg
)
2476 @ReturnMapping(ListImageResult
)
2477 async def ListImages(self
, images
):
2479 images : typing.Sequence<+T_co>[~ImageSpec]<~ImageSpec>
2480 Returns -> typing.Sequence<+T_co>[~ImageMetadata]<~ImageMetadata>
2482 # map input types to rpc msg
2484 msg
= dict(type='ImageManager', request
='ListImages', version
=2, params
=_params
)
2485 _params
['images'] = images
2486 reply
= await self
.rpc(msg
)
2491 class ImageMetadataFacade(Type
):
2492 name
= 'ImageMetadata'
2494 schema
= {'definitions': {'CloudImageMetadata': {'additionalProperties': False,
2495 'properties': {'arch': {'type': 'string'},
2496 'image-id': {'type': 'string'},
2497 'priority': {'type': 'integer'},
2498 'region': {'type': 'string'},
2499 'root-storage-size': {'type': 'integer'},
2500 'root-storage-type': {'type': 'string'},
2501 'series': {'type': 'string'},
2502 'source': {'type': 'string'},
2503 'stream': {'type': 'string'},
2504 'version': {'type': 'string'},
2505 'virt-type': {'type': 'string'}},
2506 'required': ['image-id',
2514 'CloudImageMetadataList': {'additionalProperties': False,
2515 'properties': {'metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'},
2518 'Error': {'additionalProperties': False,
2519 'properties': {'code': {'type': 'string'},
2520 'info': {'$ref': '#/definitions/ErrorInfo'},
2521 'message': {'type': 'string'}},
2522 'required': ['message', 'code'],
2524 'ErrorInfo': {'additionalProperties': False,
2525 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2526 'macaroon-path': {'type': 'string'}},
2528 'ErrorResult': {'additionalProperties': False,
2529 'properties': {'error': {'$ref': '#/definitions/Error'}},
2531 'ErrorResults': {'additionalProperties': False,
2532 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
2534 'required': ['results'],
2536 'ImageMetadataFilter': {'additionalProperties': False,
2537 'properties': {'arches': {'items': {'type': 'string'},
2539 'region': {'type': 'string'},
2540 'root-storage-type': {'type': 'string'},
2541 'series': {'items': {'type': 'string'},
2543 'stream': {'type': 'string'},
2544 'virt-type': {'type': 'string'}},
2546 'ListCloudImageMetadataResult': {'additionalProperties': False,
2547 'properties': {'result': {'items': {'$ref': '#/definitions/CloudImageMetadata'},
2549 'required': ['result'],
2551 'Macaroon': {'additionalProperties': False, 'type': 'object'},
2552 'MetadataImageIds': {'additionalProperties': False,
2553 'properties': {'image-ids': {'items': {'type': 'string'},
2555 'required': ['image-ids'],
2557 'MetadataSaveParams': {'additionalProperties': False,
2558 'properties': {'metadata': {'items': {'$ref': '#/definitions/CloudImageMetadataList'},
2561 'properties': {'Delete': {'properties': {'Params': {'$ref': '#/definitions/MetadataImageIds'},
2562 'Result': {'$ref': '#/definitions/ErrorResults'}},
2564 'List': {'properties': {'Params': {'$ref': '#/definitions/ImageMetadataFilter'},
2565 'Result': {'$ref': '#/definitions/ListCloudImageMetadataResult'}},
2567 'Save': {'properties': {'Params': {'$ref': '#/definitions/MetadataSaveParams'},
2568 'Result': {'$ref': '#/definitions/ErrorResults'}},
2570 'UpdateFromPublishedImages': {'type': 'object'}},
2574 @ReturnMapping(ErrorResults
)
2575 async def Delete(self
, image_ids
):
2577 image_ids : typing.Sequence<+T_co>[str]
2578 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
2580 # map input types to rpc msg
2582 msg
= dict(type='ImageMetadata', request
='Delete', version
=2, params
=_params
)
2583 _params
['image-ids'] = image_ids
2584 reply
= await self
.rpc(msg
)
2589 @ReturnMapping(ListCloudImageMetadataResult
)
2590 async def List(self
, arches
, region
, root_storage_type
, series
, stream
, virt_type
):
2592 arches : typing.Sequence<+T_co>[str]
2594 root_storage_type : str
2595 series : typing.Sequence<+T_co>[str]
2598 Returns -> typing.Sequence<+T_co>[~CloudImageMetadata]<~CloudImageMetadata>
2600 # map input types to rpc msg
2602 msg
= dict(type='ImageMetadata', request
='List', version
=2, params
=_params
)
2603 _params
['arches'] = arches
2604 _params
['region'] = region
2605 _params
['root-storage-type'] = root_storage_type
2606 _params
['series'] = series
2607 _params
['stream'] = stream
2608 _params
['virt-type'] = virt_type
2609 reply
= await self
.rpc(msg
)
2614 @ReturnMapping(ErrorResults
)
2615 async def Save(self
, metadata
):
2617 metadata : typing.Sequence<+T_co>[~CloudImageMetadataList]<~CloudImageMetadataList>
2618 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
2620 # map input types to rpc msg
2622 msg
= dict(type='ImageMetadata', request
='Save', version
=2, params
=_params
)
2623 _params
['metadata'] = metadata
2624 reply
= await self
.rpc(msg
)
2629 @ReturnMapping(None)
2630 async def UpdateFromPublishedImages(self
):
2635 # map input types to rpc msg
2637 msg
= dict(type='ImageMetadata', request
='UpdateFromPublishedImages', version
=2, params
=_params
)
2639 reply
= await self
.rpc(msg
)
2644 class LeadershipServiceFacade(Type
):
2645 name
= 'LeadershipService'
2647 schema
= {'definitions': {'ApplicationTag': {'additionalProperties': False,
2648 'properties': {'Name': {'type': 'string'}},
2649 'required': ['Name'],
2651 'ClaimLeadershipBulkParams': {'additionalProperties': False,
2652 'properties': {'params': {'items': {'$ref': '#/definitions/ClaimLeadershipParams'},
2654 'required': ['params'],
2656 'ClaimLeadershipBulkResults': {'additionalProperties': False,
2657 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
2659 'required': ['results'],
2661 'ClaimLeadershipParams': {'additionalProperties': False,
2662 'properties': {'application-tag': {'type': 'string'},
2663 'duration': {'type': 'number'},
2664 'unit-tag': {'type': 'string'}},
2665 'required': ['application-tag',
2669 'Error': {'additionalProperties': False,
2670 'properties': {'code': {'type': 'string'},
2671 'info': {'$ref': '#/definitions/ErrorInfo'},
2672 'message': {'type': 'string'}},
2673 'required': ['message', 'code'],
2675 'ErrorInfo': {'additionalProperties': False,
2676 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2677 'macaroon-path': {'type': 'string'}},
2679 'ErrorResult': {'additionalProperties': False,
2680 'properties': {'error': {'$ref': '#/definitions/Error'}},
2682 'Macaroon': {'additionalProperties': False, 'type': 'object'}},
2683 'properties': {'BlockUntilLeadershipReleased': {'properties': {'Params': {'$ref': '#/definitions/ApplicationTag'},
2684 'Result': {'$ref': '#/definitions/ErrorResult'}},
2686 'ClaimLeadership': {'properties': {'Params': {'$ref': '#/definitions/ClaimLeadershipBulkParams'},
2687 'Result': {'$ref': '#/definitions/ClaimLeadershipBulkResults'}},
2692 @ReturnMapping(ErrorResult
)
2693 async def BlockUntilLeadershipReleased(self
, name
):
2698 # map input types to rpc msg
2700 msg
= dict(type='LeadershipService', request
='BlockUntilLeadershipReleased', version
=2, params
=_params
)
2701 _params
['Name'] = name
2702 reply
= await self
.rpc(msg
)
2707 @ReturnMapping(ClaimLeadershipBulkResults
)
2708 async def ClaimLeadership(self
, params
):
2710 params : typing.Sequence<+T_co>[~ClaimLeadershipParams]<~ClaimLeadershipParams>
2711 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
2713 # map input types to rpc msg
2715 msg
= dict(type='LeadershipService', request
='ClaimLeadership', version
=2, params
=_params
)
2716 _params
['params'] = params
2717 reply
= await self
.rpc(msg
)
2722 class MachineManagerFacade(Type
):
2723 name
= 'MachineManager'
2725 schema
= {'definitions': {'AddMachineParams': {'additionalProperties': False,
2726 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'},
2728 'constraints': {'$ref': '#/definitions/Value'},
2729 'container-type': {'type': 'string'},
2730 'disks': {'items': {'$ref': '#/definitions/Constraints'},
2732 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'},
2733 'instance-id': {'type': 'string'},
2734 'jobs': {'items': {'type': 'string'},
2736 'nonce': {'type': 'string'},
2737 'parent-id': {'type': 'string'},
2738 'placement': {'$ref': '#/definitions/Placement'},
2739 'series': {'type': 'string'}},
2740 'required': ['series',
2747 'hardware-characteristics',
2750 'AddMachines': {'additionalProperties': False,
2751 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'},
2753 'required': ['params'],
2755 'AddMachinesResult': {'additionalProperties': False,
2756 'properties': {'error': {'$ref': '#/definitions/Error'},
2757 'machine': {'type': 'string'}},
2758 'required': ['machine'],
2760 'AddMachinesResults': {'additionalProperties': False,
2761 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'},
2763 'required': ['machines'],
2765 'Address': {'additionalProperties': False,
2766 'properties': {'scope': {'type': 'string'},
2767 'space-name': {'type': 'string'},
2768 'type': {'type': 'string'},
2769 'value': {'type': 'string'}},
2770 'required': ['value', 'type', 'scope'],
2772 'Constraints': {'additionalProperties': False,
2773 'properties': {'Count': {'type': 'integer'},
2774 'Pool': {'type': 'string'},
2775 'Size': {'type': 'integer'}},
2776 'required': ['Pool', 'Size', 'Count'],
2778 'Error': {'additionalProperties': False,
2779 'properties': {'code': {'type': 'string'},
2780 'info': {'$ref': '#/definitions/ErrorInfo'},
2781 'message': {'type': 'string'}},
2782 'required': ['message', 'code'],
2784 'ErrorInfo': {'additionalProperties': False,
2785 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2786 'macaroon-path': {'type': 'string'}},
2788 'HardwareCharacteristics': {'additionalProperties': False,
2789 'properties': {'arch': {'type': 'string'},
2790 'availability-zone': {'type': 'string'},
2791 'cpu-cores': {'type': 'integer'},
2792 'cpu-power': {'type': 'integer'},
2793 'mem': {'type': 'integer'},
2794 'root-disk': {'type': 'integer'},
2795 'tags': {'items': {'type': 'string'},
2798 'InstanceType': {'additionalProperties': False,
2799 'properties': {'arches': {'items': {'type': 'string'},
2801 'cost': {'type': 'integer'},
2802 'cpu-cores': {'type': 'integer'},
2803 'deprecated': {'type': 'boolean'},
2804 'memory': {'type': 'integer'},
2805 'name': {'type': 'string'},
2806 'root-disk': {'type': 'integer'},
2807 'virt-type': {'type': 'string'}},
2808 'required': ['arches', 'cpu-cores', 'memory'],
2810 'InstanceTypesResult': {'additionalProperties': False,
2811 'properties': {'cost-currency': {'type': 'string'},
2812 'cost-divisor': {'type': 'integer'},
2813 'cost-unit': {'type': 'string'},
2814 'error': {'$ref': '#/definitions/Error'},
2815 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'},
2818 'InstanceTypesResults': {'additionalProperties': False,
2819 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'},
2821 'required': ['results'],
2823 'Macaroon': {'additionalProperties': False, 'type': 'object'},
2824 'ModelInstanceTypesConstraint': {'additionalProperties': False,
2825 'properties': {'value': {'$ref': '#/definitions/Value'}},
2827 'ModelInstanceTypesConstraints': {'additionalProperties': False,
2828 'properties': {'constraints': {'items': {'$ref': '#/definitions/ModelInstanceTypesConstraint'},
2830 'required': ['constraints'],
2832 'Placement': {'additionalProperties': False,
2833 'properties': {'directive': {'type': 'string'},
2834 'scope': {'type': 'string'}},
2835 'required': ['scope', 'directive'],
2837 'Value': {'additionalProperties': False,
2838 'properties': {'arch': {'type': 'string'},
2839 'container': {'type': 'string'},
2840 'cores': {'type': 'integer'},
2841 'cpu-power': {'type': 'integer'},
2842 'instance-type': {'type': 'string'},
2843 'mem': {'type': 'integer'},
2844 'root-disk': {'type': 'integer'},
2845 'spaces': {'items': {'type': 'string'},
2847 'tags': {'items': {'type': 'string'},
2849 'virt-type': {'type': 'string'}},
2851 'properties': {'AddMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'},
2852 'Result': {'$ref': '#/definitions/AddMachinesResults'}},
2854 'InstanceTypes': {'properties': {'Params': {'$ref': '#/definitions/ModelInstanceTypesConstraints'},
2855 'Result': {'$ref': '#/definitions/InstanceTypesResults'}},
2860 @ReturnMapping(AddMachinesResults
)
2861 async def AddMachines(self
, params
):
2863 params : typing.Sequence<+T_co>[~AddMachineParams]<~AddMachineParams>
2864 Returns -> typing.Sequence<+T_co>[~AddMachinesResult]<~AddMachinesResult>
2866 # map input types to rpc msg
2868 msg
= dict(type='MachineManager', request
='AddMachines', version
=2, params
=_params
)
2869 _params
['params'] = params
2870 reply
= await self
.rpc(msg
)
2875 @ReturnMapping(InstanceTypesResults
)
2876 async def InstanceTypes(self
, constraints
):
2878 constraints : typing.Sequence<+T_co>[~ModelInstanceTypesConstraint]<~ModelInstanceTypesConstraint>
2879 Returns -> typing.Sequence<+T_co>[~InstanceTypesResult]<~InstanceTypesResult>
2881 # map input types to rpc msg
2883 msg
= dict(type='MachineManager', request
='InstanceTypes', version
=2, params
=_params
)
2884 _params
['constraints'] = constraints
2885 reply
= await self
.rpc(msg
)
2890 class MetricsAdderFacade(Type
):
2891 name
= 'MetricsAdder'
2893 schema
= {'definitions': {'Error': {'additionalProperties': False,
2894 'properties': {'code': {'type': 'string'},
2895 'info': {'$ref': '#/definitions/ErrorInfo'},
2896 'message': {'type': 'string'}},
2897 'required': ['message', 'code'],
2899 'ErrorInfo': {'additionalProperties': False,
2900 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2901 'macaroon-path': {'type': 'string'}},
2903 'ErrorResult': {'additionalProperties': False,
2904 'properties': {'error': {'$ref': '#/definitions/Error'}},
2906 'ErrorResults': {'additionalProperties': False,
2907 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
2909 'required': ['results'],
2911 'Macaroon': {'additionalProperties': False, 'type': 'object'},
2912 'Metric': {'additionalProperties': False,
2913 'properties': {'key': {'type': 'string'},
2914 'time': {'format': 'date-time',
2916 'value': {'type': 'string'}},
2917 'required': ['key', 'value', 'time'],
2919 'MetricBatch': {'additionalProperties': False,
2920 'properties': {'charm-url': {'type': 'string'},
2921 'created': {'format': 'date-time',
2923 'metrics': {'items': {'$ref': '#/definitions/Metric'},
2925 'uuid': {'type': 'string'}},
2926 'required': ['uuid',
2931 'MetricBatchParam': {'additionalProperties': False,
2932 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'},
2933 'tag': {'type': 'string'}},
2934 'required': ['tag', 'batch'],
2936 'MetricBatchParams': {'additionalProperties': False,
2937 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'},
2939 'required': ['batches'],
2941 'properties': {'AddMetricBatches': {'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'},
2942 'Result': {'$ref': '#/definitions/ErrorResults'}},
2947 @ReturnMapping(ErrorResults
)
2948 async def AddMetricBatches(self
, batches
):
2950 batches : typing.Sequence<+T_co>[~MetricBatchParam]<~MetricBatchParam>
2951 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
2953 # map input types to rpc msg
2955 msg
= dict(type='MetricsAdder', request
='AddMetricBatches', version
=2, params
=_params
)
2956 _params
['batches'] = batches
2957 reply
= await self
.rpc(msg
)
2962 class MetricsDebugFacade(Type
):
2963 name
= 'MetricsDebug'
2965 schema
= {'definitions': {'Entities': {'additionalProperties': False,
2966 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
2968 'required': ['entities'],
2970 'Entity': {'additionalProperties': False,
2971 'properties': {'tag': {'type': 'string'}},
2972 'required': ['tag'],
2974 'EntityMetrics': {'additionalProperties': False,
2975 'properties': {'error': {'$ref': '#/definitions/Error'},
2976 'metrics': {'items': {'$ref': '#/definitions/MetricResult'},
2979 'Error': {'additionalProperties': False,
2980 'properties': {'code': {'type': 'string'},
2981 'info': {'$ref': '#/definitions/ErrorInfo'},
2982 'message': {'type': 'string'}},
2983 'required': ['message', 'code'],
2985 'ErrorInfo': {'additionalProperties': False,
2986 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
2987 'macaroon-path': {'type': 'string'}},
2989 'ErrorResult': {'additionalProperties': False,
2990 'properties': {'error': {'$ref': '#/definitions/Error'}},
2992 'ErrorResults': {'additionalProperties': False,
2993 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
2995 'required': ['results'],
2997 'Macaroon': {'additionalProperties': False, 'type': 'object'},
2998 'MeterStatusParam': {'additionalProperties': False,
2999 'properties': {'code': {'type': 'string'},
3000 'info': {'type': 'string'},
3001 'tag': {'type': 'string'}},
3002 'required': ['tag', 'code', 'info'],
3004 'MeterStatusParams': {'additionalProperties': False,
3005 'properties': {'statues': {'items': {'$ref': '#/definitions/MeterStatusParam'},
3007 'required': ['statues'],
3009 'MetricResult': {'additionalProperties': False,
3010 'properties': {'key': {'type': 'string'},
3011 'time': {'format': 'date-time',
3013 'unit': {'type': 'string'},
3014 'value': {'type': 'string'}},
3015 'required': ['time', 'key', 'value', 'unit'],
3017 'MetricResults': {'additionalProperties': False,
3018 'properties': {'results': {'items': {'$ref': '#/definitions/EntityMetrics'},
3020 'required': ['results'],
3022 'properties': {'GetMetrics': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3023 'Result': {'$ref': '#/definitions/MetricResults'}},
3025 'SetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/MeterStatusParams'},
3026 'Result': {'$ref': '#/definitions/ErrorResults'}},
3031 @ReturnMapping(MetricResults
)
3032 async def GetMetrics(self
, entities
):
3034 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3035 Returns -> typing.Sequence<+T_co>[~EntityMetrics]<~EntityMetrics>
3037 # map input types to rpc msg
3039 msg
= dict(type='MetricsDebug', request
='GetMetrics', version
=2, params
=_params
)
3040 _params
['entities'] = entities
3041 reply
= await self
.rpc(msg
)
3046 @ReturnMapping(ErrorResults
)
3047 async def SetMeterStatus(self
, statues
):
3049 statues : typing.Sequence<+T_co>[~MeterStatusParam]<~MeterStatusParam>
3050 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
3052 # map input types to rpc msg
3054 msg
= dict(type='MetricsDebug', request
='SetMeterStatus', version
=2, params
=_params
)
3055 _params
['statues'] = statues
3056 reply
= await self
.rpc(msg
)
3061 class ModelManagerFacade(Type
):
3062 name
= 'ModelManager'
3064 schema
= {'definitions': {'Entities': {'additionalProperties': False,
3065 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
3067 'required': ['entities'],
3069 'Entity': {'additionalProperties': False,
3070 'properties': {'tag': {'type': 'string'}},
3071 'required': ['tag'],
3073 'EntityStatus': {'additionalProperties': False,
3074 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
3077 'info': {'type': 'string'},
3078 'since': {'format': 'date-time',
3080 'status': {'type': 'string'}},
3081 'required': ['status', 'info', 'since'],
3083 'Error': {'additionalProperties': False,
3084 'properties': {'code': {'type': 'string'},
3085 'info': {'$ref': '#/definitions/ErrorInfo'},
3086 'message': {'type': 'string'}},
3087 'required': ['message', 'code'],
3089 'ErrorInfo': {'additionalProperties': False,
3090 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
3091 'macaroon-path': {'type': 'string'}},
3093 'ErrorResult': {'additionalProperties': False,
3094 'properties': {'error': {'$ref': '#/definitions/Error'}},
3096 'ErrorResults': {'additionalProperties': False,
3097 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
3099 'required': ['results'],
3101 'Macaroon': {'additionalProperties': False, 'type': 'object'},
3102 'MachineHardware': {'additionalProperties': False,
3103 'properties': {'arch': {'type': 'string'},
3104 'availability-zone': {'type': 'string'},
3105 'cores': {'type': 'integer'},
3106 'cpu-power': {'type': 'integer'},
3107 'mem': {'type': 'integer'},
3108 'root-disk': {'type': 'integer'},
3109 'tags': {'items': {'type': 'string'},
3112 'MapResult': {'additionalProperties': False,
3113 'properties': {'error': {'$ref': '#/definitions/Error'},
3114 'result': {'patternProperties': {'.*': {'additionalProperties': True,
3117 'required': ['result'],
3119 'MapResults': {'additionalProperties': False,
3120 'properties': {'results': {'items': {'$ref': '#/definitions/MapResult'},
3122 'required': ['results'],
3124 'Model': {'additionalProperties': False,
3125 'properties': {'name': {'type': 'string'},
3126 'owner-tag': {'type': 'string'},
3127 'uuid': {'type': 'string'}},
3128 'required': ['name', 'uuid', 'owner-tag'],
3130 'ModelCreateArgs': {'additionalProperties': False,
3131 'properties': {'cloud-tag': {'type': 'string'},
3132 'config': {'patternProperties': {'.*': {'additionalProperties': True,
3135 'credential': {'type': 'string'},
3136 'name': {'type': 'string'},
3137 'owner-tag': {'type': 'string'},
3138 'region': {'type': 'string'}},
3139 'required': ['name', 'owner-tag'],
3141 'ModelDefaultValues': {'additionalProperties': False,
3142 'properties': {'cloud-region': {'type': 'string'},
3143 'cloud-tag': {'type': 'string'},
3144 'config': {'patternProperties': {'.*': {'additionalProperties': True,
3147 'required': ['config'],
3149 'ModelDefaults': {'additionalProperties': False,
3150 'properties': {'controller': {'additionalProperties': True,
3152 'default': {'additionalProperties': True,
3154 'regions': {'items': {'$ref': '#/definitions/RegionDefaults'},
3157 'ModelDefaultsResult': {'additionalProperties': False,
3158 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ModelDefaults'}},
3160 'required': ['config'],
3162 'ModelInfo': {'additionalProperties': False,
3163 'properties': {'cloud-credential-tag': {'type': 'string'},
3164 'cloud-region': {'type': 'string'},
3165 'cloud-tag': {'type': 'string'},
3166 'controller-uuid': {'type': 'string'},
3167 'default-series': {'type': 'string'},
3168 'life': {'type': 'string'},
3169 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'},
3171 'migration': {'$ref': '#/definitions/ModelMigrationStatus'},
3172 'name': {'type': 'string'},
3173 'owner-tag': {'type': 'string'},
3174 'provider-type': {'type': 'string'},
3175 'sla': {'$ref': '#/definitions/ModelSLAInfo'},
3176 'status': {'$ref': '#/definitions/EntityStatus'},
3177 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'},
3179 'uuid': {'type': 'string'}},
3180 'required': ['name',
3193 'ModelInfoResult': {'additionalProperties': False,
3194 'properties': {'error': {'$ref': '#/definitions/Error'},
3195 'result': {'$ref': '#/definitions/ModelInfo'}},
3197 'ModelInfoResults': {'additionalProperties': False,
3198 'properties': {'results': {'items': {'$ref': '#/definitions/ModelInfoResult'},
3200 'required': ['results'],
3202 'ModelMachineInfo': {'additionalProperties': False,
3203 'properties': {'hardware': {'$ref': '#/definitions/MachineHardware'},
3204 'has-vote': {'type': 'boolean'},
3205 'id': {'type': 'string'},
3206 'instance-id': {'type': 'string'},
3207 'status': {'type': 'string'},
3208 'wants-vote': {'type': 'boolean'}},
3211 'ModelMigrationStatus': {'additionalProperties': False,
3212 'properties': {'end': {'format': 'date-time',
3214 'start': {'format': 'date-time',
3216 'status': {'type': 'string'}},
3217 'required': ['status', 'start'],
3219 'ModelSLAInfo': {'additionalProperties': False,
3220 'properties': {'level': {'type': 'string'},
3221 'owner': {'type': 'string'}},
3222 'required': ['level', 'owner'],
3224 'ModelStatus': {'additionalProperties': False,
3225 'properties': {'application-count': {'type': 'integer'},
3226 'hosted-machine-count': {'type': 'integer'},
3227 'life': {'type': 'string'},
3228 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'},
3230 'model-tag': {'type': 'string'},
3231 'owner-tag': {'type': 'string'}},
3232 'required': ['model-tag',
3234 'hosted-machine-count',
3235 'application-count',
3238 'ModelStatusResults': {'additionalProperties': False,
3239 'properties': {'models': {'items': {'$ref': '#/definitions/ModelStatus'},
3241 'required': ['models'],
3243 'ModelUnsetKeys': {'additionalProperties': False,
3244 'properties': {'cloud-region': {'type': 'string'},
3245 'cloud-tag': {'type': 'string'},
3246 'keys': {'items': {'type': 'string'},
3248 'required': ['keys'],
3250 'ModelUserInfo': {'additionalProperties': False,
3251 'properties': {'access': {'type': 'string'},
3252 'display-name': {'type': 'string'},
3253 'last-connection': {'format': 'date-time',
3255 'user': {'type': 'string'}},
3256 'required': ['user',
3261 'ModifyModelAccess': {'additionalProperties': False,
3262 'properties': {'access': {'type': 'string'},
3263 'action': {'type': 'string'},
3264 'model-tag': {'type': 'string'},
3265 'user-tag': {'type': 'string'}},
3266 'required': ['user-tag',
3271 'ModifyModelAccessRequest': {'additionalProperties': False,
3272 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyModelAccess'},
3274 'required': ['changes'],
3276 'RegionDefaults': {'additionalProperties': False,
3277 'properties': {'region-name': {'type': 'string'},
3278 'value': {'additionalProperties': True,
3280 'required': ['region-name', 'value'],
3282 'SetModelDefaults': {'additionalProperties': False,
3283 'properties': {'config': {'items': {'$ref': '#/definitions/ModelDefaultValues'},
3285 'required': ['config'],
3287 'UnsetModelDefaults': {'additionalProperties': False,
3288 'properties': {'keys': {'items': {'$ref': '#/definitions/ModelUnsetKeys'},
3290 'required': ['keys'],
3292 'UserModel': {'additionalProperties': False,
3293 'properties': {'last-connection': {'format': 'date-time',
3295 'model': {'$ref': '#/definitions/Model'}},
3296 'required': ['model', 'last-connection'],
3298 'UserModelList': {'additionalProperties': False,
3299 'properties': {'user-models': {'items': {'$ref': '#/definitions/UserModel'},
3301 'required': ['user-models'],
3303 'properties': {'CreateModel': {'properties': {'Params': {'$ref': '#/definitions/ModelCreateArgs'},
3304 'Result': {'$ref': '#/definitions/ModelInfo'}},
3306 'DestroyModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3307 'Result': {'$ref': '#/definitions/ErrorResults'}},
3309 'DumpModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3310 'Result': {'$ref': '#/definitions/MapResults'}},
3312 'DumpModelsDB': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3313 'Result': {'$ref': '#/definitions/MapResults'}},
3315 'ListModels': {'properties': {'Params': {'$ref': '#/definitions/Entity'},
3316 'Result': {'$ref': '#/definitions/UserModelList'}},
3318 'ModelDefaults': {'properties': {'Result': {'$ref': '#/definitions/ModelDefaultsResult'}},
3320 'ModelInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3321 'Result': {'$ref': '#/definitions/ModelInfoResults'}},
3323 'ModelStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3324 'Result': {'$ref': '#/definitions/ModelStatusResults'}},
3326 'ModifyModelAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyModelAccessRequest'},
3327 'Result': {'$ref': '#/definitions/ErrorResults'}},
3329 'SetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/SetModelDefaults'},
3330 'Result': {'$ref': '#/definitions/ErrorResults'}},
3332 'UnsetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'},
3333 'Result': {'$ref': '#/definitions/ErrorResults'}},
3338 @ReturnMapping(ModelInfo
)
3339 async def CreateModel(self
, cloud_tag
, config
, credential
, name
, owner_tag
, region
):
3342 config : typing.Mapping<~KT, +VT_co>[str, typing.Any]
3347 Returns -> typing.Union[_ForwardRef('ModelMigrationStatus'), _ForwardRef('ModelSLAInfo'), _ForwardRef('EntityStatus'), typing.Sequence<+T_co>[~ModelUserInfo]<~ModelUserInfo>]
3349 # map input types to rpc msg
3351 msg
= dict(type='ModelManager', request
='CreateModel', version
=2, params
=_params
)
3352 _params
['cloud-tag'] = cloud_tag
3353 _params
['config'] = config
3354 _params
['credential'] = credential
3355 _params
['name'] = name
3356 _params
['owner-tag'] = owner_tag
3357 _params
['region'] = region
3358 reply
= await self
.rpc(msg
)
3363 @ReturnMapping(ErrorResults
)
3364 async def DestroyModels(self
, entities
):
3366 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3367 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
3369 # map input types to rpc msg
3371 msg
= dict(type='ModelManager', request
='DestroyModels', version
=2, params
=_params
)
3372 _params
['entities'] = entities
3373 reply
= await self
.rpc(msg
)
3378 @ReturnMapping(MapResults
)
3379 async def DumpModels(self
, entities
):
3381 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3382 Returns -> typing.Sequence<+T_co>[~MapResult]<~MapResult>
3384 # map input types to rpc msg
3386 msg
= dict(type='ModelManager', request
='DumpModels', version
=2, params
=_params
)
3387 _params
['entities'] = entities
3388 reply
= await self
.rpc(msg
)
3393 @ReturnMapping(MapResults
)
3394 async def DumpModelsDB(self
, entities
):
3396 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3397 Returns -> typing.Sequence<+T_co>[~MapResult]<~MapResult>
3399 # map input types to rpc msg
3401 msg
= dict(type='ModelManager', request
='DumpModelsDB', version
=2, params
=_params
)
3402 _params
['entities'] = entities
3403 reply
= await self
.rpc(msg
)
3408 @ReturnMapping(UserModelList
)
3409 async def ListModels(self
, tag
):
3412 Returns -> typing.Sequence<+T_co>[~UserModel]<~UserModel>
3414 # map input types to rpc msg
3416 msg
= dict(type='ModelManager', request
='ListModels', version
=2, params
=_params
)
3417 _params
['tag'] = tag
3418 reply
= await self
.rpc(msg
)
3423 @ReturnMapping(ModelDefaultsResult
)
3424 async def ModelDefaults(self
):
3427 Returns -> typing.Mapping<~KT, +VT_co>[str, ~ModelDefaults]<~ModelDefaults>
3429 # map input types to rpc msg
3431 msg
= dict(type='ModelManager', request
='ModelDefaults', version
=2, params
=_params
)
3433 reply
= await self
.rpc(msg
)
3438 @ReturnMapping(ModelInfoResults
)
3439 async def ModelInfo(self
, entities
):
3441 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3442 Returns -> typing.Sequence<+T_co>[~ModelInfoResult]<~ModelInfoResult>
3444 # map input types to rpc msg
3446 msg
= dict(type='ModelManager', request
='ModelInfo', version
=2, params
=_params
)
3447 _params
['entities'] = entities
3448 reply
= await self
.rpc(msg
)
3453 @ReturnMapping(ModelStatusResults
)
3454 async def ModelStatus(self
, entities
):
3456 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3457 Returns -> typing.Sequence<+T_co>[~ModelStatus]<~ModelStatus>
3459 # map input types to rpc msg
3461 msg
= dict(type='ModelManager', request
='ModelStatus', version
=2, params
=_params
)
3462 _params
['entities'] = entities
3463 reply
= await self
.rpc(msg
)
3468 @ReturnMapping(ErrorResults
)
3469 async def ModifyModelAccess(self
, changes
):
3471 changes : typing.Sequence<+T_co>[~ModifyModelAccess]<~ModifyModelAccess>
3472 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
3474 # map input types to rpc msg
3476 msg
= dict(type='ModelManager', request
='ModifyModelAccess', version
=2, params
=_params
)
3477 _params
['changes'] = changes
3478 reply
= await self
.rpc(msg
)
3483 @ReturnMapping(ErrorResults
)
3484 async def SetModelDefaults(self
, config
):
3486 config : typing.Sequence<+T_co>[~ModelDefaultValues]<~ModelDefaultValues>
3487 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
3489 # map input types to rpc msg
3491 msg
= dict(type='ModelManager', request
='SetModelDefaults', version
=2, params
=_params
)
3492 _params
['config'] = config
3493 reply
= await self
.rpc(msg
)
3498 @ReturnMapping(ErrorResults
)
3499 async def UnsetModelDefaults(self
, keys
):
3501 keys : typing.Sequence<+T_co>[~ModelUnsetKeys]<~ModelUnsetKeys>
3502 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
3504 # map input types to rpc msg
3506 msg
= dict(type='ModelManager', request
='UnsetModelDefaults', version
=2, params
=_params
)
3507 _params
['keys'] = keys
3508 reply
= await self
.rpc(msg
)
3513 class RebootFacade(Type
):
3516 schema
= {'definitions': {'Entities': {'additionalProperties': False,
3517 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
3519 'required': ['entities'],
3521 'Entity': {'additionalProperties': False,
3522 'properties': {'tag': {'type': 'string'}},
3523 'required': ['tag'],
3525 'Error': {'additionalProperties': False,
3526 'properties': {'code': {'type': 'string'},
3527 'info': {'$ref': '#/definitions/ErrorInfo'},
3528 'message': {'type': 'string'}},
3529 'required': ['message', 'code'],
3531 'ErrorInfo': {'additionalProperties': False,
3532 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
3533 'macaroon-path': {'type': 'string'}},
3535 'ErrorResult': {'additionalProperties': False,
3536 'properties': {'error': {'$ref': '#/definitions/Error'}},
3538 'ErrorResults': {'additionalProperties': False,
3539 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
3541 'required': ['results'],
3543 'Macaroon': {'additionalProperties': False, 'type': 'object'},
3544 'NotifyWatchResult': {'additionalProperties': False,
3545 'properties': {'NotifyWatcherId': {'type': 'string'},
3546 'error': {'$ref': '#/definitions/Error'}},
3547 'required': ['NotifyWatcherId'],
3549 'RebootActionResult': {'additionalProperties': False,
3550 'properties': {'error': {'$ref': '#/definitions/Error'},
3551 'result': {'type': 'string'}},
3553 'RebootActionResults': {'additionalProperties': False,
3554 'properties': {'results': {'items': {'$ref': '#/definitions/RebootActionResult'},
3557 'properties': {'ClearReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3558 'Result': {'$ref': '#/definitions/ErrorResults'}},
3560 'GetRebootAction': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3561 'Result': {'$ref': '#/definitions/RebootActionResults'}},
3563 'RequestReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3564 'Result': {'$ref': '#/definitions/ErrorResults'}},
3566 'WatchForRebootEvent': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}},
3571 @ReturnMapping(ErrorResults
)
3572 async def ClearReboot(self
, entities
):
3574 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3575 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
3577 # map input types to rpc msg
3579 msg
= dict(type='Reboot', request
='ClearReboot', version
=2, params
=_params
)
3580 _params
['entities'] = entities
3581 reply
= await self
.rpc(msg
)
3586 @ReturnMapping(RebootActionResults
)
3587 async def GetRebootAction(self
, entities
):
3589 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3590 Returns -> typing.Sequence<+T_co>[~RebootActionResult]<~RebootActionResult>
3592 # map input types to rpc msg
3594 msg
= dict(type='Reboot', request
='GetRebootAction', version
=2, params
=_params
)
3595 _params
['entities'] = entities
3596 reply
= await self
.rpc(msg
)
3601 @ReturnMapping(ErrorResults
)
3602 async def RequestReboot(self
, entities
):
3604 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3605 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
3607 # map input types to rpc msg
3609 msg
= dict(type='Reboot', request
='RequestReboot', version
=2, params
=_params
)
3610 _params
['entities'] = entities
3611 reply
= await self
.rpc(msg
)
3616 @ReturnMapping(NotifyWatchResult
)
3617 async def WatchForRebootEvent(self
):
3620 Returns -> typing.Union[str, _ForwardRef('Error')]
3622 # map input types to rpc msg
3624 msg
= dict(type='Reboot', request
='WatchForRebootEvent', version
=2, params
=_params
)
3626 reply
= await self
.rpc(msg
)
3631 class ResumerFacade(Type
):
3634 schema
= {'properties': {'ResumeTransactions': {'type': 'object'}}, 'type': 'object'}
3637 @ReturnMapping(None)
3638 async def ResumeTransactions(self
):
3643 # map input types to rpc msg
3645 msg
= dict(type='Resumer', request
='ResumeTransactions', version
=2, params
=_params
)
3647 reply
= await self
.rpc(msg
)
3652 class SSHClientFacade(Type
):
3655 schema
= {'definitions': {'Entities': {'additionalProperties': False,
3656 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
3658 'required': ['entities'],
3660 'Entity': {'additionalProperties': False,
3661 'properties': {'tag': {'type': 'string'}},
3662 'required': ['tag'],
3664 'Error': {'additionalProperties': False,
3665 'properties': {'code': {'type': 'string'},
3666 'info': {'$ref': '#/definitions/ErrorInfo'},
3667 'message': {'type': 'string'}},
3668 'required': ['message', 'code'],
3670 'ErrorInfo': {'additionalProperties': False,
3671 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
3672 'macaroon-path': {'type': 'string'}},
3674 'Macaroon': {'additionalProperties': False, 'type': 'object'},
3675 'SSHAddressResult': {'additionalProperties': False,
3676 'properties': {'address': {'type': 'string'},
3677 'error': {'$ref': '#/definitions/Error'}},
3679 'SSHAddressResults': {'additionalProperties': False,
3680 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressResult'},
3682 'required': ['results'],
3684 'SSHAddressesResult': {'additionalProperties': False,
3685 'properties': {'addresses': {'items': {'type': 'string'},
3687 'error': {'$ref': '#/definitions/Error'}},
3688 'required': ['addresses'],
3690 'SSHAddressesResults': {'additionalProperties': False,
3691 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressesResult'},
3693 'required': ['results'],
3695 'SSHProxyResult': {'additionalProperties': False,
3696 'properties': {'use-proxy': {'type': 'boolean'}},
3697 'required': ['use-proxy'],
3699 'SSHPublicKeysResult': {'additionalProperties': False,
3700 'properties': {'error': {'$ref': '#/definitions/Error'},
3701 'public-keys': {'items': {'type': 'string'},
3704 'SSHPublicKeysResults': {'additionalProperties': False,
3705 'properties': {'results': {'items': {'$ref': '#/definitions/SSHPublicKeysResult'},
3707 'required': ['results'],
3709 'properties': {'AllAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3710 'Result': {'$ref': '#/definitions/SSHAddressesResults'}},
3712 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3713 'Result': {'$ref': '#/definitions/SSHAddressResults'}},
3715 'Proxy': {'properties': {'Result': {'$ref': '#/definitions/SSHProxyResult'}},
3717 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3718 'Result': {'$ref': '#/definitions/SSHAddressResults'}},
3720 'PublicKeys': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
3721 'Result': {'$ref': '#/definitions/SSHPublicKeysResults'}},
3726 @ReturnMapping(SSHAddressesResults
)
3727 async def AllAddresses(self
, entities
):
3729 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3730 Returns -> typing.Sequence<+T_co>[~SSHAddressesResult]<~SSHAddressesResult>
3732 # map input types to rpc msg
3734 msg
= dict(type='SSHClient', request
='AllAddresses', version
=2, params
=_params
)
3735 _params
['entities'] = entities
3736 reply
= await self
.rpc(msg
)
3741 @ReturnMapping(SSHAddressResults
)
3742 async def PrivateAddress(self
, entities
):
3744 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3745 Returns -> typing.Sequence<+T_co>[~SSHAddressResult]<~SSHAddressResult>
3747 # map input types to rpc msg
3749 msg
= dict(type='SSHClient', request
='PrivateAddress', version
=2, params
=_params
)
3750 _params
['entities'] = entities
3751 reply
= await self
.rpc(msg
)
3756 @ReturnMapping(SSHProxyResult
)
3757 async def Proxy(self
):
3762 # map input types to rpc msg
3764 msg
= dict(type='SSHClient', request
='Proxy', version
=2, params
=_params
)
3766 reply
= await self
.rpc(msg
)
3771 @ReturnMapping(SSHAddressResults
)
3772 async def PublicAddress(self
, entities
):
3774 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3775 Returns -> typing.Sequence<+T_co>[~SSHAddressResult]<~SSHAddressResult>
3777 # map input types to rpc msg
3779 msg
= dict(type='SSHClient', request
='PublicAddress', version
=2, params
=_params
)
3780 _params
['entities'] = entities
3781 reply
= await self
.rpc(msg
)
3786 @ReturnMapping(SSHPublicKeysResults
)
3787 async def PublicKeys(self
, entities
):
3789 entities : typing.Sequence<+T_co>[~Entity]<~Entity>
3790 Returns -> typing.Sequence<+T_co>[~SSHPublicKeysResult]<~SSHPublicKeysResult>
3792 # map input types to rpc msg
3794 msg
= dict(type='SSHClient', request
='PublicKeys', version
=2, params
=_params
)
3795 _params
['entities'] = entities
3796 reply
= await self
.rpc(msg
)
3801 class SpacesFacade(Type
):
3804 schema
= {'definitions': {'CreateSpaceParams': {'additionalProperties': False,
3805 'properties': {'provider-id': {'type': 'string'},
3806 'public': {'type': 'boolean'},
3807 'space-tag': {'type': 'string'},
3808 'subnet-tags': {'items': {'type': 'string'},
3810 'required': ['subnet-tags',
3814 'CreateSpacesParams': {'additionalProperties': False,
3815 'properties': {'spaces': {'items': {'$ref': '#/definitions/CreateSpaceParams'},
3817 'required': ['spaces'],
3819 'Error': {'additionalProperties': False,
3820 'properties': {'code': {'type': 'string'},
3821 'info': {'$ref': '#/definitions/ErrorInfo'},
3822 'message': {'type': 'string'}},
3823 'required': ['message', 'code'],
3825 'ErrorInfo': {'additionalProperties': False,
3826 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
3827 'macaroon-path': {'type': 'string'}},
3829 'ErrorResult': {'additionalProperties': False,
3830 'properties': {'error': {'$ref': '#/definitions/Error'}},
3832 'ErrorResults': {'additionalProperties': False,
3833 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
3835 'required': ['results'],
3837 'ListSpacesResults': {'additionalProperties': False,
3838 'properties': {'results': {'items': {'$ref': '#/definitions/Space'},
3840 'required': ['results'],
3842 'Macaroon': {'additionalProperties': False, 'type': 'object'},
3843 'Space': {'additionalProperties': False,
3844 'properties': {'error': {'$ref': '#/definitions/Error'},
3845 'name': {'type': 'string'},
3846 'subnets': {'items': {'$ref': '#/definitions/Subnet'},
3848 'required': ['name', 'subnets'],
3850 'Subnet': {'additionalProperties': False,
3851 'properties': {'cidr': {'type': 'string'},
3852 'life': {'type': 'string'},
3853 'provider-id': {'type': 'string'},
3854 'provider-network-id': {'type': 'string'},
3855 'space-tag': {'type': 'string'},
3856 'status': {'type': 'string'},
3857 'vlan-tag': {'type': 'integer'},
3858 'zones': {'items': {'type': 'string'},
3860 'required': ['cidr',
3866 'properties': {'CreateSpaces': {'properties': {'Params': {'$ref': '#/definitions/CreateSpacesParams'},
3867 'Result': {'$ref': '#/definitions/ErrorResults'}},
3869 'ListSpaces': {'properties': {'Result': {'$ref': '#/definitions/ListSpacesResults'}},
3874 @ReturnMapping(ErrorResults
)
3875 async def CreateSpaces(self
, spaces
):
3877 spaces : typing.Sequence<+T_co>[~CreateSpaceParams]<~CreateSpaceParams>
3878 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
3880 # map input types to rpc msg
3882 msg
= dict(type='Spaces', request
='CreateSpaces', version
=2, params
=_params
)
3883 _params
['spaces'] = spaces
3884 reply
= await self
.rpc(msg
)
3889 @ReturnMapping(ListSpacesResults
)
3890 async def ListSpaces(self
):
3893 Returns -> typing.Sequence<+T_co>[~Space]<~Space>
3895 # map input types to rpc msg
3897 msg
= dict(type='Spaces', request
='ListSpaces', version
=2, params
=_params
)
3899 reply
= await self
.rpc(msg
)
3904 class StatusHistoryFacade(Type
):
3905 name
= 'StatusHistory'
3907 schema
= {'definitions': {'Error': {'additionalProperties': False,
3908 'properties': {'code': {'type': 'string'},
3909 'info': {'$ref': '#/definitions/ErrorInfo'},
3910 'message': {'type': 'string'}},
3911 'required': ['message', 'code'],
3913 'ErrorInfo': {'additionalProperties': False,
3914 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
3915 'macaroon-path': {'type': 'string'}},
3917 'Macaroon': {'additionalProperties': False, 'type': 'object'},
3918 'ModelConfigResult': {'additionalProperties': False,
3919 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
3922 'required': ['config'],
3924 'NotifyWatchResult': {'additionalProperties': False,
3925 'properties': {'NotifyWatcherId': {'type': 'string'},
3926 'error': {'$ref': '#/definitions/Error'}},
3927 'required': ['NotifyWatcherId'],
3929 'StatusHistoryPruneArgs': {'additionalProperties': False,
3930 'properties': {'max-history-mb': {'type': 'integer'},
3931 'max-history-time': {'type': 'integer'}},
3932 'required': ['max-history-time',
3935 'properties': {'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}},
3937 'Prune': {'properties': {'Params': {'$ref': '#/definitions/StatusHistoryPruneArgs'}},
3939 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}},
3944 @ReturnMapping(ModelConfigResult
)
3945 async def ModelConfig(self
):
3948 Returns -> typing.Mapping<~KT, +VT_co>[str, typing.Any]
3950 # map input types to rpc msg
3952 msg
= dict(type='StatusHistory', request
='ModelConfig', version
=2, params
=_params
)
3954 reply
= await self
.rpc(msg
)
3959 @ReturnMapping(None)
3960 async def Prune(self
, max_history_mb
, max_history_time
):
3962 max_history_mb : int
3963 max_history_time : int
3966 # map input types to rpc msg
3968 msg
= dict(type='StatusHistory', request
='Prune', version
=2, params
=_params
)
3969 _params
['max-history-mb'] = max_history_mb
3970 _params
['max-history-time'] = max_history_time
3971 reply
= await self
.rpc(msg
)
3976 @ReturnMapping(NotifyWatchResult
)
3977 async def WatchForModelConfigChanges(self
):
3980 Returns -> typing.Union[str, _ForwardRef('Error')]
3982 # map input types to rpc msg
3984 msg
= dict(type='StatusHistory', request
='WatchForModelConfigChanges', version
=2, params
=_params
)
3986 reply
= await self
.rpc(msg
)
3991 class SubnetsFacade(Type
):
3994 schema
= {'definitions': {'AddSubnetParams': {'additionalProperties': False,
3995 'properties': {'provider-network-id': {'type': 'string'},
3996 'space-tag': {'type': 'string'},
3997 'subnet-provider-id': {'type': 'string'},
3998 'subnet-tag': {'type': 'string'},
3999 'vlan-tag': {'type': 'integer'},
4000 'zones': {'items': {'type': 'string'},
4002 'required': ['space-tag'],
4004 'AddSubnetsParams': {'additionalProperties': False,
4005 'properties': {'subnets': {'items': {'$ref': '#/definitions/AddSubnetParams'},
4007 'required': ['subnets'],
4009 'Error': {'additionalProperties': False,
4010 'properties': {'code': {'type': 'string'},
4011 'info': {'$ref': '#/definitions/ErrorInfo'},
4012 'message': {'type': 'string'}},
4013 'required': ['message', 'code'],
4015 'ErrorInfo': {'additionalProperties': False,
4016 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
4017 'macaroon-path': {'type': 'string'}},
4019 'ErrorResult': {'additionalProperties': False,
4020 'properties': {'error': {'$ref': '#/definitions/Error'}},
4022 'ErrorResults': {'additionalProperties': False,
4023 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
4025 'required': ['results'],
4027 'ListSubnetsResults': {'additionalProperties': False,
4028 'properties': {'results': {'items': {'$ref': '#/definitions/Subnet'},
4030 'required': ['results'],
4032 'Macaroon': {'additionalProperties': False, 'type': 'object'},
4033 'SpaceResult': {'additionalProperties': False,
4034 'properties': {'error': {'$ref': '#/definitions/Error'},
4035 'tag': {'type': 'string'}},
4036 'required': ['tag'],
4038 'SpaceResults': {'additionalProperties': False,
4039 'properties': {'results': {'items': {'$ref': '#/definitions/SpaceResult'},
4041 'required': ['results'],
4043 'Subnet': {'additionalProperties': False,
4044 'properties': {'cidr': {'type': 'string'},
4045 'life': {'type': 'string'},
4046 'provider-id': {'type': 'string'},
4047 'provider-network-id': {'type': 'string'},
4048 'space-tag': {'type': 'string'},
4049 'status': {'type': 'string'},
4050 'vlan-tag': {'type': 'integer'},
4051 'zones': {'items': {'type': 'string'},
4053 'required': ['cidr',
4059 'SubnetsFilters': {'additionalProperties': False,
4060 'properties': {'space-tag': {'type': 'string'},
4061 'zone': {'type': 'string'}},
4063 'ZoneResult': {'additionalProperties': False,
4064 'properties': {'available': {'type': 'boolean'},
4065 'error': {'$ref': '#/definitions/Error'},
4066 'name': {'type': 'string'}},
4067 'required': ['name', 'available'],
4069 'ZoneResults': {'additionalProperties': False,
4070 'properties': {'results': {'items': {'$ref': '#/definitions/ZoneResult'},
4072 'required': ['results'],
4074 'properties': {'AddSubnets': {'properties': {'Params': {'$ref': '#/definitions/AddSubnetsParams'},
4075 'Result': {'$ref': '#/definitions/ErrorResults'}},
4077 'AllSpaces': {'properties': {'Result': {'$ref': '#/definitions/SpaceResults'}},
4079 'AllZones': {'properties': {'Result': {'$ref': '#/definitions/ZoneResults'}},
4081 'ListSubnets': {'properties': {'Params': {'$ref': '#/definitions/SubnetsFilters'},
4082 'Result': {'$ref': '#/definitions/ListSubnetsResults'}},
4087 @ReturnMapping(ErrorResults
)
4088 async def AddSubnets(self
, subnets
):
4090 subnets : typing.Sequence<+T_co>[~AddSubnetParams]<~AddSubnetParams>
4091 Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
4093 # map input types to rpc msg
4095 msg
= dict(type='Subnets', request
='AddSubnets', version
=2, params
=_params
)
4096 _params
['subnets'] = subnets
4097 reply
= await self
.rpc(msg
)
4102 @ReturnMapping(SpaceResults
)
4103 async def AllSpaces(self
):
4106 Returns -> typing.Sequence<+T_co>[~SpaceResult]<~SpaceResult>
4108 # map input types to rpc msg
4110 msg
= dict(type='Subnets', request
='AllSpaces', version
=2, params
=_params
)
4112 reply
= await self
.rpc(msg
)
4117 @ReturnMapping(ZoneResults
)
4118 async def AllZones(self
):
4121 Returns -> typing.Sequence<+T_co>[~ZoneResult]<~ZoneResult>
4123 # map input types to rpc msg
4125 msg
= dict(type='Subnets', request
='AllZones', version
=2, params
=_params
)
4127 reply
= await self
.rpc(msg
)
4132 @ReturnMapping(ListSubnetsResults
)
4133 async def ListSubnets(self
, space_tag
, zone
):
4137 Returns -> typing.Sequence<+T_co>[~Subnet]<~Subnet>
4139 # map input types to rpc msg
4141 msg
= dict(type='Subnets', request
='ListSubnets', version
=2, params
=_params
)
4142 _params
['space-tag'] = space_tag
4143 _params
['zone'] = zone
4144 reply
= await self
.rpc(msg
)
4149 class VolumeAttachmentsWatcherFacade(Type
):
4150 name
= 'VolumeAttachmentsWatcher'
4152 schema
= {'definitions': {'Error': {'additionalProperties': False,
4153 'properties': {'code': {'type': 'string'},
4154 'info': {'$ref': '#/definitions/ErrorInfo'},
4155 'message': {'type': 'string'}},
4156 'required': ['message', 'code'],
4158 'ErrorInfo': {'additionalProperties': False,
4159 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
4160 'macaroon-path': {'type': 'string'}},
4162 'Macaroon': {'additionalProperties': False, 'type': 'object'},
4163 'MachineStorageId': {'additionalProperties': False,
4164 'properties': {'attachment-tag': {'type': 'string'},
4165 'machine-tag': {'type': 'string'}},
4166 'required': ['machine-tag',
4169 'MachineStorageIdsWatchResult': {'additionalProperties': False,
4170 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'},
4172 'error': {'$ref': '#/definitions/Error'},
4173 'watcher-id': {'type': 'string'}},
4174 'required': ['watcher-id',
4177 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}},
4179 'Stop': {'type': 'object'}},
4183 @ReturnMapping(MachineStorageIdsWatchResult
)
4184 async def Next(self
):
4187 Returns -> typing.Union[typing.Sequence<+T_co>[~MachineStorageId]<~MachineStorageId>, _ForwardRef('Error')]
4189 # map input types to rpc msg
4191 msg
= dict(type='VolumeAttachmentsWatcher', request
='Next', version
=2, params
=_params
)
4193 reply
= await self
.rpc(msg
)
4198 @ReturnMapping(None)
4199 async def Stop(self
):
4204 # map input types to rpc msg
4206 msg
= dict(type='VolumeAttachmentsWatcher', request
='Stop', version
=2, params
=_params
)
4208 reply
= await self
.rpc(msg
)