|
9 | 9 | import base64 |
10 | 10 | from contextlib import closing |
11 | 11 | from pathlib import Path |
| 12 | +from typing import Dict, Optional |
12 | 13 |
|
13 | 14 | import yaml |
14 | 15 |
|
@@ -555,14 +556,20 @@ class AddApplicationChange(ChangeInfo): |
555 | 556 | this will be used to scale the application. |
556 | 557 | :options: holds application options. |
557 | 558 | :constraints: optional application constraints. |
558 | | - :storage: optional storage constraints. |
| 559 | + :storage: optional storage constraints, in the form of `{label: constraint}`. |
| 560 | + The label is a string specified by the charm, while the constraint is a string following |
| 561 | + `the juju storage constraint directive format <https://juju.is/docs/juju/storage-constraint>`_, |
| 562 | + specifying the storage pool, number of volumes, and size of each volume. |
559 | 563 | :devices: optional devices constraints. |
560 | 564 | :endpoint_bindings: optional endpoint bindings |
561 | 565 | :resources: identifies the revision to use for each resource of the |
562 | 566 | application's charm. |
563 | 567 | :local_resources: identifies the path to the local resource of the |
564 | 568 | application's charm. |
565 | 569 | """ |
| 570 | + |
| 571 | + storage: Optional[Dict[str, str]] |
| 572 | + |
566 | 573 | @staticmethod |
567 | 574 | def method(): |
568 | 575 | """method returns an associated ID for the Juju API call. |
@@ -631,7 +638,11 @@ async def run(self, context): |
631 | 638 | constraints=self.constraints, |
632 | 639 | endpoint_bindings=self.endpoint_bindings, |
633 | 640 | resources=resources, |
634 | | - storage={k: parse_storage_constraint(v) for k, v in (self.storage or dict()).items()}, |
| 641 | + storage={ |
| 642 | + label: parse_storage_constraint(constraint) |
| 643 | + for label, constraint |
| 644 | + in (self.storage or {}).items() |
| 645 | + }, |
635 | 646 | channel=self.channel, |
636 | 647 | devices=self.devices, |
637 | 648 | num_units=self.num_units, |
|
0 commit comments