Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed auto-generated CLI usage examples in the docs rendering the wrong command name for resources whose class name differs from the entry-point name. The base `DuploResourceV2`/`DuploResourceV3` docstrings now use `{{command}}` (the entry-point name) instead of `{{kind | lower}}` (derived from the class name). Affects `aws_secret` (was `awssecret`), `ssm_param` (was `param`), `pvc` (was `persistentvolumeclaim`), and `ecs` (was `ecsservice`).
- Fixed `asg create` docstring showing `duploctl hosts create` instead of `duploctl asg create`
- Fixed `asg scale` docstring advertising a non-existent `-n <name>` flag; `name` is a positional argument
- Fixed `ecs list_task_def_family` docstring referencing a non-existent `list_definitions` command
Expand Down
2 changes: 1 addition & 1 deletion scripts/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def gen_resource_page(endpoint: str):
command_opts = member_opts + "\n is_command: true"

with open(fp, 'w') as f:
f.write(f"---\nkind: {kind}\n---\n")
f.write(f"---\nkind: {kind}\ncommand: {resource_name}\n---\n")
f.write(f"::: {ref}\n options:\n members: false\n inherited_members: false\n\n")
if command_methods:
f.write("## Commands\n\n")
Expand Down
16 changes: 8 additions & 8 deletions src/duplocloud/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def list(self) -> list:

Usage: cli usage
```sh
duploctl {{kind | lower}} list
duploctl {{command}} list
```

Returns:
Expand All @@ -126,7 +126,7 @@ def find(self,

Usage: cli usage
```sh
duploctl {{kind | lower}} find <name>
duploctl {{command}} find <name>
```

Args:
Expand Down Expand Up @@ -182,7 +182,7 @@ def list(self) -> list:

Usage: cli usage
```sh
duploctl {{kind | lower}} list
duploctl {{command}} list
```

Returns:
Expand All @@ -198,7 +198,7 @@ def find(self,

Usage: cli usage
```sh
duploctl {{kind | lower}} find <name>
duploctl {{command}} find <name>
```

Args:
Expand All @@ -221,7 +221,7 @@ def delete(self,

Usage: cli usage
```sh
duploctl {{kind | lower}} delete <name>
duploctl {{command}} delete <name>
```

Args:
Expand All @@ -247,7 +247,7 @@ def create(self,

Usage: CLI Usage
```sh
duploctl {{kind | lower}} create -f '{{kind | lower}}.yaml'
duploctl {{command}} create -f '{{kind | lower}}.yaml'
```
Contents of the `{{kind|lower}}.yaml` file
```yaml
Expand All @@ -258,7 +258,7 @@ def create(self,
```sh
echo \"\"\"
--8<-- "src/tests/data/{{kind|lower}}.yaml"
\"\"\" | duploctl {{kind | lower}} create -f -
\"\"\" | duploctl {{command}} create -f -
```

Args:
Expand Down Expand Up @@ -321,7 +321,7 @@ def apply(self,

Usage: CLI Usage
```sh
duploctl {{kind | lower}} apply -f '{{kind | lower}}.yaml'
duploctl {{command}} apply -f '{{kind | lower}}.yaml'
```
Contents of the `{{kind|lower}}.yaml` file
```yaml
Expand Down
Loading