Skip to content

Commit 09d5f7c

Browse files
authored
Feat: Support maintenance schedule in CLI (#155)
1 parent fcb8c76 commit 09d5f7c

File tree

9 files changed

+2233
-0
lines changed

9 files changed

+2233
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
## orch-cli create schedule
2+
3+
Creates a schedule configuration
4+
5+
```
6+
orch-cli create schedule [flags]
7+
```
8+
9+
### Examples
10+
11+
```
12+
# Create a new repeated schedule, an osupdate , using days of week
13+
orch-cli create schedules my-schedule --timezone GMT --frequency-type repeated --maintenance-type osupdate --target site-532d1d07 --frequency weekly --start-time "10:10" --day-of-week "1-3,5" --months "2,4,7-8" --duration 3600
14+
15+
# Create a new repeated schedule, a maintenance , using days of month
16+
orch-cli create schedules my-schedule --timezone GMT --frequency-type repeated --maintenance-type maintenance --target site-532d1d07 --frequency monthly --start-time "10:10" --day-of-month "1,6,31" --months "2,4,7-12" --duration 3600
17+
18+
# Create a new single schedule, an osupdate
19+
orch-cli create schedules my-schedule --timezone GMT --frequency-type single --maintenance-type osupdate --target region-65c0d433 --start-time "2026-12-01 20:20" --end-time "2027-12-01 20:20"
20+
21+
```
22+
23+
### Options
24+
25+
```
26+
-D, --day-of-month string Day of the month for repeated schedule: --day-of-month "1-4,31"
27+
-d, --day-of-week string Day of the week for repeated schedule: --day-of-week "mon,tue,wed,thu,fri,sat,sun"
28+
-u, --duration int Duration of the maintenance window in seconds: --duration 3600
29+
-e, --end-time string End time of the schedule: --end-time "2025-12-15 14:00"
30+
-f, --frequency string Frequency of the schedule: --frequency daily|weekly|monthly
31+
-F, --frequency-type string Frequency of the schedule: --frequency-type single|repeated
32+
-h, --help help for schedule
33+
-H, --hour string Hour of the day for repeated schedule (0-23): --hour 2
34+
-m, --maintenance-type string Type of maintenance: --maintenance-type maintenance|osupdate
35+
-M, --minute string Minute of the hour for repeated schedule (0-59): --minute 30
36+
-x, --months string The months in which the schedule should run --months "1-2,12"
37+
-s, --start-time string Start time of the schedule: --start-time "2025-12-15 12:00"
38+
-T, --target string Target maintenance on a host|region|site using it's resource ID: --target host-abcd1234|region-abcd1234|site-abcd1234
39+
-t, --timezone string Set time in particular timezone: --timezone Europe/Berlin
40+
```
41+
42+
### Options inherited from parent commands
43+
44+
```
45+
--api-endpoint string API Service Endpoint (default "https://api.orch-10-114-181-120.espdqa.infra-host.com")
46+
--debug-headers emit debug-style headers separating columns via '|' character
47+
-n, --noauth use without authentication checks
48+
-p, --project string Active project name (default "itep")
49+
-v, --verbose produce verbose output
50+
```
51+
52+
### SEE ALSO
53+
54+
* [orch-cli create](orch-cli_create.md) - Create various orchestrator service entities
55+
56+
###### Auto generated by spf13/cobra on 2-Oct-2025
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## orch-cli delete schedule
2+
3+
Delete a schedule configuration
4+
5+
```
6+
orch-cli delete schedule <name> [flags]
7+
```
8+
9+
### Examples
10+
11+
```
12+
# Delete a schedule resource using it's resource ID
13+
orch-cli delete schedule repeatedsche-abcd1234 --project some-project
14+
```
15+
16+
### Options
17+
18+
```
19+
-h, --help help for schedule
20+
```
21+
22+
### Options inherited from parent commands
23+
24+
```
25+
--api-endpoint string API Service Endpoint (default "https://api.orch-10-114-181-120.espdqa.infra-host.com")
26+
--debug-headers emit debug-style headers separating columns via '|' character
27+
-n, --noauth use without authentication checks
28+
-p, --project string Active project name (default "itep")
29+
-v, --verbose produce verbose output
30+
```
31+
32+
### SEE ALSO
33+
34+
* [orch-cli delete](orch-cli_delete.md) - Delete various orchestrator service entities
35+
36+
###### Auto generated by spf13/cobra on 2-Oct-2025

docs/cli/orch-cli_get_schedule.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## orch-cli get schedule
2+
3+
Get a schedule configuration
4+
5+
```
6+
orch-cli get schedule <name> [flags]
7+
```
8+
9+
### Examples
10+
11+
```
12+
# Get detailed information about specific schedule resource using it's resource ID
13+
orch-cli get schedule repeatedsche-abcd1234 --project some-project
14+
```
15+
16+
### Options
17+
18+
```
19+
-h, --help help for schedule
20+
-t, --timezone string Display time in particular timezone: --timezone Europe/Berlin
21+
```
22+
23+
### Options inherited from parent commands
24+
25+
```
26+
--api-endpoint string API Service Endpoint (default "https://api.orch-10-114-181-120.espdqa.infra-host.com")
27+
--debug-headers emit debug-style headers separating columns via '|' character
28+
-n, --noauth use without authentication checks
29+
-p, --project string Active project name (default "itep")
30+
-v, --verbose produce verbose output
31+
```
32+
33+
### SEE ALSO
34+
35+
* [orch-cli get](orch-cli_get.md) - Get various orchestrator service entities
36+
37+
###### Auto generated by spf13/cobra on 2-Oct-2025

docs/cli/orch-cli_list_schedule.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## orch-cli list schedule
2+
3+
List all schedule configurations
4+
5+
```
6+
orch-cli list schedule [flags]
7+
```
8+
9+
### Examples
10+
11+
```
12+
# List all schedule resources
13+
orch-cli list schedule --project some-project
14+
15+
```
16+
17+
### Options
18+
19+
```
20+
-h, --help help for schedule
21+
```
22+
23+
### Options inherited from parent commands
24+
25+
```
26+
--api-endpoint string API Service Endpoint (default "https://api.orch-10-114-181-120.espdqa.infra-host.com")
27+
--debug-headers emit debug-style headers separating columns via '|' character
28+
-n, --noauth use without authentication checks
29+
-p, --project string Active project name (default "itep")
30+
-v, --verbose produce verbose output
31+
```
32+
33+
### SEE ALSO
34+
35+
* [orch-cli list](orch-cli_list.md) - List various orchestrator service entities
36+
37+
###### Auto generated by spf13/cobra on 2-Oct-2025

docs/cli/orch-cli_set_schedule.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## orch-cli set schedule
2+
3+
Update a schedule configuration
4+
5+
```
6+
orch-cli set schedule <name> [flags]
7+
```
8+
9+
### Examples
10+
11+
```
12+
# Update a repeated schedule resource (by month day) using it's resource ID (not all parameters need to be updated at same time --timezone is mandatory)
13+
orch-cli set schedules repeatedsche-abcd1234 --timezone GMT --maintenance-type osupdate --frequency weekly --start-time "10:10" --day-of-week "1-3,5" --months "2,4,7-8" --duration 3600
14+
15+
# Update a repeated schedule resource (by weekday) using it's resource ID (not all parameters need to be updated at same time --timezone is mandatory)
16+
orch-cli set schedules repeatedsche-abcd1234 --timezone GMT --maintenance-type osupdate --frequency monthly --start-time "10:10" --day-of-month "1-3,5" --months "2,4,7-8" --duration 3600
17+
18+
# Update a single schedule resource using it's resource ID (not all parameters need to be updated at same time, --timezone is mandatory)
19+
orch-cli set schedules repeatedsche-abcd1234 --timezone GMT --maintenance-type osupdate --start-time "2026-02-02 10:10" --end-time "2026-02-02 10:10"
20+
21+
```
22+
23+
### Options
24+
25+
```
26+
-D, --day-of-month string Day of the month for repeated schedule: --day-of-month "1-4,31"
27+
-d, --day-of-week string Day of the week for repeated schedule: --day-of-week "mon,tue,wed,thu,fri,sat,sun"
28+
-u, --duration int Duration of the maintenance window in seconds: --duration 3600
29+
-e, --end-time string End time of the schedule: --end-time "2025-12-15 14:00"
30+
-f, --frequency string Frequency of the schedule: --frequency daily|weekly|monthly
31+
-h, --help help for schedule
32+
-H, --hour string Hour of the day for repeated schedule (0-23): --hour 2
33+
-m, --maintenance-type string Type of maintenance: --maintenance-type maintenance|osupdate
34+
-M, --minute string Minute of the hour for repeated schedule (0-59): --minute 30
35+
-x, --months string The months in which the schedule should run --months "1-2,12"
36+
-N, --name string Schedule name
37+
-s, --start-time string Start time of the schedule: --start-time "2025-12-15 12:00"
38+
-t, --timezone string Set time in particular timezone: --timezone Europe/Berlin
39+
```
40+
41+
### Options inherited from parent commands
42+
43+
```
44+
--api-endpoint string API Service Endpoint (default "https://api.orch-10-114-181-120.espdqa.infra-host.com")
45+
--debug-headers emit debug-style headers separating columns via '|' character
46+
-n, --noauth use without authentication checks
47+
-p, --project string Active project name (default "itep")
48+
-v, --verbose produce verbose output
49+
```
50+
51+
### SEE ALSO
52+
53+
* [orch-cli set](orch-cli_set.md) - Update various orchestrator service entities
54+
55+
###### Auto generated by spf13/cobra on 3-Oct-2025

internal/cli/crud.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var (
2929
registryAliases = []string{"registry", "registries", "reg", "regs"}
3030
regionAliases = []string{"region", "regions", "regn", "regns"}
3131
siteAliases = []string{"site", "sites", "st", "sts"}
32+
scheduleAliases = []string{"schedule", "schedules", "sch", "schs"}
3233
sshKeyAliases = []string{"sshkey", "sshkeys", "ssh", "sshs"}
3334
)
3435

@@ -63,6 +64,7 @@ func getCreateCommand() *cobra.Command {
6364
getCreateOSProfileCommand(),
6465
getCreateProviderCommand(),
6566
getCreateSSHKeyCommand(),
67+
getCreateScheduleCommand(),
6668
)
6769
return cmd
6870
}
@@ -97,6 +99,7 @@ func getListCommand() *cobra.Command {
9799
getListHostCommand(),
98100
getListProviderCommand(),
99101
getListSSHKeyCommand(),
102+
getListScheduleCommand(),
100103
)
101104
return catalogListRootCmd
102105
}
@@ -129,6 +132,7 @@ func getGetCommand() *cobra.Command {
129132
getGetHostCommand(),
130133
getGetProviderCommand(),
131134
getGetSSHKeyCommand(),
135+
getGetScheduleCommand(),
132136
)
133137
return catalogGetRootCmd
134138
}
@@ -153,6 +157,7 @@ func getSetCommand() *cobra.Command {
153157
getSetNetworkCommand(),
154158

155159
getSetHostCommand(),
160+
getSetScheduleCommand(),
156161
)
157162
return cmd
158163
}
@@ -186,6 +191,7 @@ func getDeleteCommand() *cobra.Command {
186191
getDeleteHostCommand(),
187192
getDeleteProviderCommand(),
188193
getDeleteSSHKeyCommand(),
194+
getDeleteScheduleCommand(),
189195
)
190196
return catalogDeleteRootCmd
191197
}

0 commit comments

Comments
 (0)