Skip to content

Commit 6771d7a

Browse files
authored
Keep realm topic under ods (#315)
* @W-21766828 add storage,multi realm usage and settings support * fixing lint * Keeping realm topic only under ODS
1 parent ca22f4d commit 6771d7a

8 files changed

Lines changed: 50 additions & 43 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@salesforce/b2c-cli': minor
3+
---
4+
5+
Add ODS sandbox management enhancements, including sandbox storage and settings commands, multi-realm usage reporting, and dedicated realm configuration support.
6+
7+
Keep sandbox realm workflows under `b2c sandbox realm` / `b2c ods realm` by removing top-level `b2c realm` aliases.

docs/cli/sandbox.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,27 +1038,27 @@ For the complete response including all metadata, use the `--json` flag.
10381038

10391039
## Realm-Level Commands
10401040

1041-
Realm commands operate at the **realm** level rather than on an individual sandbox. They are available as both `realm` topic commands and as `sandbox realm` subcommands:
1041+
Realm commands operate at the **realm** level rather than on an individual sandbox. Use them under the existing sandbox topics:
10421042

1043-
- `b2c realm list` (`b2c sandbox realm list`)
1044-
- `b2c realm configuration` (`b2c sandbox realm configuration`)
1045-
- `b2c realm get` (`b2c sandbox realm get`)
1046-
- `b2c realm update` (`b2c sandbox realm update`)
1047-
- `b2c realm usage` (`b2c sandbox realm usage`)
1048-
- `b2c realm usages` (`b2c sandbox realm usages`)
1043+
- `b2c sandbox realm list` (or `b2c ods realm list`)
1044+
- `b2c sandbox realm configuration` (or `b2c ods realm configuration`)
1045+
- `b2c sandbox realm get` (or `b2c ods realm get`)
1046+
- `b2c sandbox realm update` (or `b2c ods realm update`)
1047+
- `b2c sandbox realm usage` (or `b2c ods realm usage`)
1048+
- `b2c sandbox realm usages` (or `b2c ods realm usages`)
10491049

10501050
### Required Access for Realm Commands
10511051

1052-
To run `b2c realm` commands, your user or API client must have **realm‑level access** in Account Manager (typically a role ending in `_sbx` for sandbox management).
1052+
To run `b2c sandbox realm` (or `b2c ods realm`) commands, your user or API client must have **realm‑level access** in Account Manager (typically a role ending in `_sbx` for sandbox management).
10531053

1054-
### b2c realm list
1054+
### b2c sandbox realm list
10551055

10561056
List realms eligible for sandbox management.
10571057

10581058
#### Usage
10591059

10601060
```bash
1061-
b2c realm list [REALM]
1061+
b2c sandbox realm list [REALM]
10621062
```
10631063

10641064
#### Arguments
@@ -1071,25 +1071,25 @@ b2c realm list [REALM]
10711071

10721072
```bash
10731073
# List all realms you can manage
1074-
b2c realm list
1074+
b2c sandbox realm list
10751075

10761076
# List a single realm
1077-
b2c realm list zzzz
1077+
b2c sandbox realm list zzzz
10781078

10791079
# JSON output
1080-
b2c realm list --json
1080+
b2c sandbox realm list --json
10811081
```
10821082

10831083
When `REALM` is omitted, the command discovers realms from the `/me` endpoint.
10841084

1085-
### b2c realm configuration
1085+
### b2c sandbox realm configuration
10861086

10871087
Get sandbox configuration for a specific realm.
10881088

10891089
#### Usage
10901090

10911091
```bash
1092-
b2c realm configuration <REALM>
1092+
b2c sandbox realm configuration <REALM>
10931093
```
10941094

10951095
#### Arguments
@@ -1102,22 +1102,22 @@ b2c realm configuration <REALM>
11021102

11031103
```bash
11041104
# Get realm sandbox configuration
1105-
b2c realm configuration zzzz
1105+
b2c sandbox realm configuration zzzz
11061106

11071107
# JSON output
1108-
b2c realm configuration zzzz --json
1108+
b2c sandbox realm configuration zzzz --json
11091109
```
11101110

11111111
When not using `--json`, the command prints configuration details such as emails, sandbox limits, TTL values, and start/stop schedulers.
11121112

1113-
### b2c realm get
1113+
### b2c sandbox realm get
11141114

11151115
Get detailed information about a specific realm, including configuration.
11161116

11171117
#### Usage
11181118

11191119
```bash
1120-
b2c realm get <REALM>
1120+
b2c sandbox realm get <REALM>
11211121
```
11221122

11231123
#### Arguments
@@ -1130,10 +1130,10 @@ b2c realm get <REALM>
11301130

11311131
```bash
11321132
# Get realm details
1133-
b2c realm get zzzz
1133+
b2c sandbox realm get zzzz
11341134

11351135
# JSON output (includes configuration and account details when available)
1136-
b2c realm get zzzz --json
1136+
b2c sandbox realm get zzzz --json
11371137
```
11381138

11391139
#### Output
@@ -1150,14 +1150,14 @@ The command prints:
11501150
- Whether local users are allowed
11511151
- Start/stop scheduler definitions (as JSON) when present
11521152

1153-
### b2c realm update
1153+
### b2c sandbox realm update
11541154

11551155
Update realm‑level sandbox configuration for TTL and start/stop schedulers.
11561156

11571157
#### Usage
11581158

11591159
```bash
1160-
b2c realm update <REALM> [FLAGS]
1160+
b2c sandbox realm update <REALM> [FLAGS]
11611161
```
11621162

11631163
#### Arguments
@@ -1186,27 +1186,27 @@ The scheduler flags expect a JSON value or the literal string `"null"`:
11861186

11871187
```bash
11881188
# Set max TTL to unlimited and default TTL to 24 hours
1189-
b2c realm update zzzz --max-sandbox-ttl 0 --default-sandbox-ttl 24
1189+
b2c sandbox realm update zzzz --max-sandbox-ttl 0 --default-sandbox-ttl 24
11901190

11911191
# Configure weekday start/stop schedules
1192-
b2c realm update zzzz \
1192+
b2c sandbox realm update zzzz \
11931193
--start-scheduler '{"weekdays":["MONDAY","TUESDAY"],"time":"08:00:00Z"}' \
11941194
--stop-scheduler '{"weekdays":["MONDAY","TUESDAY"],"time":"19:00:00Z"}'
11951195

11961196
# Remove an existing stop scheduler
1197-
b2c realm update zzzz --stop-scheduler "null"
1197+
b2c sandbox realm update zzzz --stop-scheduler "null"
11981198
```
11991199

12001200
If no update flags are provided, the command fails with a helpful error explaining which flags can be used.
12011201

1202-
### b2c realm usage
1202+
### b2c sandbox realm usage
12031203

12041204
Show usage information for a realm across all sandboxes in that realm.
12051205

12061206
#### Usage
12071207

12081208
```bash
1209-
b2c realm usage <REALM> [FLAGS]
1209+
b2c sandbox realm usage <REALM> [FLAGS]
12101210
```
12111211

12121212
#### Arguments
@@ -1228,13 +1228,13 @@ b2c realm usage <REALM> [FLAGS]
12281228

12291229
```bash
12301230
# Realm usage for a recent window
1231-
b2c realm usage zzzz
1231+
b2c sandbox realm usage zzzz
12321232

12331233
# Realm usage for a specific range
1234-
b2c realm usage zzzz --from 2024-01-01 --to 2024-01-31
1234+
b2c sandbox realm usage zzzz --from 2024-01-01 --to 2024-01-31
12351235

12361236
# Daily granularity with full JSON response
1237-
b2c realm usage zzzz --granularity daily --detailed-report --json
1237+
b2c sandbox realm usage zzzz --granularity daily --detailed-report --json
12381238
```
12391239

12401240
When not using `--json`, the command prints a summary including:
@@ -1246,14 +1246,14 @@ When not using `--json`, the command prints a summary including:
12461246

12471247
If detailed usage is available, it prints a hint to re-run with `--json` for the full structure. If no usage data is returned for the requested period, it prints a friendly message instead of failing.
12481248

1249-
### b2c realm usages
1249+
### b2c sandbox realm usages
12501250

12511251
Show usage information for multiple realms in one request.
12521252

12531253
#### Usage
12541254

12551255
```bash
1256-
b2c realm usages [FLAGS]
1256+
b2c sandbox realm usages [FLAGS]
12571257
```
12581258

12591259
#### Flags
@@ -1271,16 +1271,16 @@ If `--realm` is omitted, the command auto-discovers realms from `/me` and querie
12711271

12721272
```bash
12731273
# Usage for all realms available to the current user
1274-
b2c realm usages
1274+
b2c sandbox realm usages
12751275

12761276
# Usage for two specific realms
1277-
b2c realm usages --realm zzzz --realm yyyy
1277+
b2c sandbox realm usages --realm zzzz --realm yyyy
12781278

12791279
# Usage for comma-separated realms and date range
1280-
b2c realm usages --realm zzzz,yyyy --from 2024-01-01 --to 2024-01-31
1280+
b2c sandbox realm usages --realm zzzz,yyyy --from 2024-01-01 --to 2024-01-31
12811281

12821282
# Detailed report in JSON
1283-
b2c realm usages --detailed-report --json
1283+
b2c sandbox realm usages --detailed-report --json
12841284
```
12851285

12861286
When not using `--json`, the command prints one row per realm with summary metrics such as:

packages/b2c-cli/src/commands/sandbox/realm/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type RealmConfigurationResponse = OdsComponents['schemas']['RealmConfigurationRe
1616
* Get realm sandbox configuration.
1717
*/
1818
export default class SandboxRealmConfiguration extends OdsCommand<typeof SandboxRealmConfiguration> {
19-
static aliases = ['ods:realm:configuration', 'realm:configuration'];
19+
static aliases = ['ods:realm:configuration'];
2020

2121
static args = {
2222
realm: Args.string({

packages/b2c-cli/src/commands/sandbox/realm/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type RealmModel = OdsComponents['schemas']['RealmModel'];
1717
* Get details of a specific realm.
1818
*/
1919
export default class SandboxRealmGet extends OdsCommand<typeof SandboxRealmGet> {
20-
static aliases = ['ods:realm:get', 'realm:get'];
20+
static aliases = ['ods:realm:get'];
2121

2222
static args = {
2323
realm: Args.string({

packages/b2c-cli/src/commands/sandbox/realm/list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface RealmListResponse {
2121
* List realms eligible for sandbox management.
2222
*/
2323
export default class SandboxRealmList extends OdsCommand<typeof SandboxRealmList> {
24-
static aliases = ['ods:realm:list', 'realm:list'];
24+
static aliases = ['ods:realm:list'];
2525

2626
static args = {
2727
realm: Args.string({

packages/b2c-cli/src/commands/sandbox/realm/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type RealmConfigurationResponse = OdsComponents['schemas']['RealmConfigurationRe
1616
* Update realm-level ODS configuration (TTL and schedulers).
1717
*/
1818
export default class SandboxRealmUpdate extends OdsCommand<typeof SandboxRealmUpdate> {
19-
static aliases = ['ods:realm:update', 'realm:update'];
19+
static aliases = ['ods:realm:update'];
2020

2121
static args = {
2222
realm: Args.string({

packages/b2c-cli/src/commands/sandbox/realm/usage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type RealmUsageModel = OdsComponents['schemas']['RealmUsageModel'];
1515
* Show realm-level usage information.
1616
*/
1717
export default class SandboxRealmUsage extends OdsCommand<typeof SandboxRealmUsage> {
18-
static aliases = ['ods:realm:usage', 'realm:usage'];
18+
static aliases = ['ods:realm:usage'];
1919

2020
static args = {
2121
realm: Args.string({

packages/b2c-cli/src/commands/sandbox/realm/usages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type MultiRealmUsageResponse = OdsComponents['schemas']['MultiRealmUsageResponse
1616
* Show usage information for multiple realms.
1717
*/
1818
export default class SandboxRealmUsages extends OdsCommand<typeof SandboxRealmUsages> {
19-
static aliases = ['ods:realm:usages', 'realm:usages'];
19+
static aliases = ['ods:realm:usages'];
2020

2121
static description = withDocs(
2222
t('commands.realm.usages.description', 'Show usage information for multiple realms'),

0 commit comments

Comments
 (0)