Skip to content

Commit 8d048b9

Browse files
authored
feat(testmonitor): add product create, update, and delete commands (#72)
Add CRUD operations for Test Monitor products: - product create: Create products with part number, name, family, workspace, keywords, and properties - product update: Update existing products with merge or replace mode - product delete: Delete single or multiple products with confirmation Includes: - 12 new unit tests (944 total passing) - README documentation with usage examples - SKILL.md updated with new command reference - Proper error handling with ExitCodes - Readonly mode checking - JSON and table output formats
1 parent f62ee6b commit 8d048b9

File tree

4 files changed

+739
-1
lines changed

4 files changed

+739
-1
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,60 @@ slcli testmonitor product get 02600cf8-c2bb-4ff9-a139-031e943fb0c0
19821982
slcli testmonitor product get 02600cf8-c2bb-4ff9-a139-031e943fb0c0 --format json
19831983
```
19841984
1985+
### Create a product
1986+
1987+
```bash
1988+
# Create a new product (part number is required)
1989+
slcli testmonitor product create --part-number "156502A-11L" --name "cRIO-9030" --family "cRIO"
1990+
1991+
# Create with keywords and properties
1992+
slcli testmonitor product create \
1993+
--part-number "156502A-11L" \
1994+
--name "cRIO-9030" \
1995+
--family "cRIO" \
1996+
--keyword "embedded" \
1997+
--keyword "controller" \
1998+
--property "region=us" \
1999+
--property "owner=team-a"
2000+
2001+
# Create in a specific workspace
2002+
slcli testmonitor product create --part-number "PN-001" --workspace "Production"
2003+
2004+
# Output created product as JSON
2005+
slcli testmonitor product create --part-number "PN-001" --name "My Product" --format json
2006+
```
2007+
2008+
### Update a product
2009+
2010+
```bash
2011+
# Update a product's name and family
2012+
slcli testmonitor product update 02600cf8-c2bb-4ff9-a139-031e943fb0c0 --name "cRIO-9030 Rev B" --family "cRIO Gen2"
2013+
2014+
# Merge additional keywords into an existing product
2015+
slcli testmonitor product update 02600cf8-c2bb-4ff9-a139-031e943fb0c0 --keyword "v2" --keyword "updated"
2016+
2017+
# Replace all properties (instead of merging) using --replace
2018+
slcli testmonitor product update 02600cf8-c2bb-4ff9-a139-031e943fb0c0 \
2019+
--property "owner=team-b" \
2020+
--replace
2021+
2022+
# Output updated product as JSON
2023+
slcli testmonitor product update 02600cf8-c2bb-4ff9-a139-031e943fb0c0 --name "Updated" --format json
2024+
```
2025+
2026+
### Delete a product
2027+
2028+
```bash
2029+
# Delete a single product (prompts for confirmation)
2030+
slcli testmonitor product delete 02600cf8-c2bb-4ff9-a139-031e943fb0c0
2031+
2032+
# Delete without confirmation prompt
2033+
slcli testmonitor product delete --yes 02600cf8-c2bb-4ff9-a139-031e943fb0c0
2034+
2035+
# Delete multiple products at once
2036+
slcli testmonitor product delete --yes prod-id-1 prod-id-2 prod-id-3
2037+
```
2038+
19852039
### Get result details with steps and measurements
19862040
19872041
```bash

skills/slcli/SKILL.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,30 @@ slcli testmonitor product list [OPTIONS]
111111

112112
# Get a single product
113113
slcli testmonitor product get <PRODUCT_ID> [-f json]
114+
115+
# Create a product
116+
slcli testmonitor product create --part-number TEXT [OPTIONS]
117+
--part-number TEXT # Part number (required)
118+
--name TEXT # Product name
119+
--family TEXT # Product family
120+
--workspace, -w TEXT # Workspace name or ID
121+
--keyword TEXT # Keyword (repeatable)
122+
--property KEY=VALUE # Key-value property (repeatable)
123+
-f [table|json]
124+
125+
# Update a product
126+
slcli testmonitor product update <PRODUCT_ID> [OPTIONS]
127+
--name TEXT # New product name
128+
--family TEXT # New product family
129+
--workspace, -w TEXT # New workspace name or ID
130+
--keyword TEXT # Keyword (repeatable; replaces all if --replace)
131+
--property KEY=VALUE # Key-value property (repeatable; replaces all if --replace)
132+
--replace # Replace fields instead of merging
133+
-f [table|json]
134+
135+
# Delete products
136+
slcli testmonitor product delete [--yes] <PRODUCT_ID>...
137+
--yes, -y # Skip confirmation prompt
114138
```
115139

116140
### asset — Asset and calibration management

0 commit comments

Comments
 (0)