Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- 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
- Added missing `Usage: CLI Usage` blocks to all remaining `ecs` commands without one (`create_service`, `update_service`, `update_taskdef`, `delete_service`, `find_def`, `find_def_by_arn`, `find_service_family`, `find_task_def_family`) so the generated docs show how to invoke them
- Fixed `user apply` failing with `KeyError: 'Name'` by overriding `name_from_body` and `apply` to use `Username` and set the correct `State` for create vs update
- Updated broken links in batch documentation
- Fixed `batch_scheduling_policy update` returning 405 by PUTting to the collection endpoint instead of a named resource path
Expand Down
8 changes: 4 additions & 4 deletions src/duplo_resource/asg.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def create(self,

Usage: CLI Usage
```sh
duploctl hosts create -f 'asg.yaml'
duploctl asg create -f 'asg.yaml'
```
Contents of the `asg.yaml` file
```yaml
Expand Down Expand Up @@ -184,11 +184,11 @@ def scale(self,

Usage: CLI Usage
```sh
duploctl asg scale -n <name> [-m <min>] [-M <max>]
duploctl asg scale <name> [-m <min>] [-M <max>]
```

Args:
name: The name of the ASG to scale.
name: The name of the ASG to scale (positional).
min: The new minimum number of instances the ASG should maintain. Use -m flag to set.
max: The new maximum number of instances the ASG can scale to. Use -M flag to set.

Expand Down
51 changes: 46 additions & 5 deletions src/duplo_resource/ecs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,14 @@ def list_detailed_services(self) -> list:
def find_service_family(self,
name: args.NAME):
"""Find Service Family by Name

Find an ECS Services task definition family by name.

Usage: CLI Usage
```sh
duploctl ecs find_service_family <name>
```

Args:
name: The name of the ECS task definition to find.

Expand All @@ -101,7 +106,14 @@ def find_service_family(self,
@Command()
def delete_service(self,
name: args.NAME) -> dict:
"""Delete an ECS service.
"""Delete an ECS Service.

Delete an ECS service by name.

Usage: CLI Usage
```sh
duploctl ecs delete_service <name>
```

Args:
name: The name of the ECS service to delete.
Expand All @@ -120,10 +132,9 @@ def list_task_def_family(self) -> dict:

Retrieve a list of all ECS task definitions in a tenant.

Example:
CLI usage
Usage: CLI Usage
```sh
duploctl ecs list_definitions
duploctl ecs list_task_def_family
```

Returns:
Expand All @@ -139,6 +150,11 @@ def find_def(self,
name: args.NAME):
"""Find the latest version of an ECS task definition by family name.

Usage: CLI Usage
```sh
duploctl ecs find_def <name>
```

Args:
name: The family name of the ECS task definition to find.

Expand All @@ -160,6 +176,11 @@ def find_def_by_arn(self,

Find a task definition by its AWS ARN.

Usage: CLI Usage
```sh
duploctl ecs find_def_by_arn <arn>
```

Args:
arn: The ARN of the ECS task definition to find.

Expand All @@ -178,6 +199,11 @@ def find_task_def_family(self,
name: args.NAME):
"""Find a ECS task definition family by name.

Usage: CLI Usage
```sh
duploctl ecs find_task_def_family <name>
```

Args:
name: The name of the ECS task definition to find.

Expand All @@ -198,6 +224,11 @@ def create_service(self,
body: args.BODY) -> dict:
"""Create an ECS service.

Usage: CLI Usage
```sh
duploctl ecs create_service -f 'ecs_service.yaml'
```

Args:
body: The ECS service definition object.

Expand All @@ -216,6 +247,11 @@ def update_service(self,
body: args.BODY) -> dict:
"""Update an ECS service.

Usage: CLI Usage
```sh
duploctl ecs update_service -f 'ecs_service.yaml'
```

Args:
body: The updated ECS service object.

Expand All @@ -237,6 +273,11 @@ def update_taskdef(self,
Updates a task definition. This creates a new revision of the task definition and returns the new ARN.
Note each definition is immutable so this is effectively a create operation for one item in a set and the latest one is the active one.

Usage: CLI Usage
```sh
duploctl ecs update_taskdef -f 'ecs_td.yaml'
```

Args:
body: The updated ECS task definition object.

Expand Down
Loading