Skip to content

Commit 3aeb392

Browse files
committed
updating docs and skills for new job run capabilities
1 parent 2891aeb commit 3aeb392

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

docs/cli/jobs.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ In addition to [global flags](./index#global-flags):
2727
| `--wait`, `-w` | Wait for job to complete | `false` |
2828
| `--timeout`, `-t` | Timeout in seconds when waiting | No timeout |
2929
| `--param`, `-P` | Job parameter in format "name=value" (repeatable) | |
30+
| `--body`, `-B` | Raw JSON request body (for system jobs with non-standard schemas) | |
3031
| `--no-wait-running` | Do not wait for running job to finish before starting | `false` |
3132
| `--show-log` | Show job log on failure | `true` |
3233

34+
Note: `--param` and `--body` are mutually exclusive.
35+
3336
### Examples
3437

3538
```bash
@@ -42,13 +45,25 @@ b2c job run my-custom-job --wait
4245
# Execute with timeout
4346
b2c job run my-custom-job --wait --timeout 600
4447

45-
# Execute with parameters
48+
# Execute with parameters (standard jobs)
4649
b2c job run my-custom-job -P "SiteScope={\"all_storefront_sites\":true}" -P OtherParam=value
4750

4851
# Output as JSON
4952
b2c job run my-custom-job --wait --json
5053
```
5154

55+
### System Jobs with Custom Request Bodies
56+
57+
Some system jobs (like search indexing) use non-standard request schemas that don't follow the `parameters` array format. Use `--body` to provide a raw JSON request body:
58+
59+
```bash
60+
# Run search index job for specific sites
61+
b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":["RefArch","SiteGenesis"]}'
62+
63+
# Run search index job for a single site
64+
b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":["RefArch"]}'
65+
```
66+
5267
### Authentication
5368

5469
This command requires OAuth authentication with OCAPI permissions for the `/jobs` resource.

plugins/b2c-cli/skills/b2c-job/SKILL.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,27 @@ b2c job run my-custom-job --wait
2121
# run a job with a timeout (in seconds)
2222
b2c job run my-custom-job --wait --timeout 600
2323

24-
# run a job with parameters
24+
# run a job with parameters (standard jobs)
2525
b2c job run my-custom-job -P "SiteScope={\"all_storefront_sites\":true}" -P OtherParam=value
2626

2727
# show job log if the job fails
2828
b2c job run my-custom-job --wait --show-log
2929
```
3030

31+
### Run System Jobs with Custom Request Bodies
32+
33+
Some system jobs (like search indexing) use non-standard request schemas. Use `--body` to provide a raw JSON request body:
34+
35+
```bash
36+
# run search index job for specific sites
37+
b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":["RefArch","SiteGenesis"]}'
38+
39+
# run search index job for a single site
40+
b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":["RefArch"]}'
41+
```
42+
43+
Note: `--body` and `-P` are mutually exclusive.
44+
3145
### Import Site Archives
3246

3347
```bash

0 commit comments

Comments
 (0)