@@ -1297,14 +1297,63 @@ let create_params =
12971297 ; param_doc=
12981298 " The SHA256 checksum of updateinfo of the most recently applied update \
12991299 on the host"
1300- ; param_release= numbered_release " 24.39.0-next "
1300+ ; param_release= numbered_release " 24.40.0 "
13011301 ; param_default= Some (VString " " )
13021302 }
1303+ ; {
1304+ param_type= Bool
1305+ ; param_name= " ssh_enabled"
1306+ ; param_doc= " True if SSH access is enabled for the host"
1307+ ; param_release= numbered_release " 25.20.0-next"
1308+ ; param_default= Some (VBool Constants. default_ssh_enabled)
1309+ }
1310+ ; {
1311+ param_type= Int
1312+ ; param_name= " ssh_enabled_timeout"
1313+ ; param_doc=
1314+ " The timeout in seconds after which SSH access will be automatically \
1315+ disabled (0 means never), this setting will be applied every time the \
1316+ SSH is enabled by XAPI"
1317+ ; param_release= numbered_release " 25.20.0-next"
1318+ ; param_default= Some (VInt Constants. default_ssh_enabled_timeout)
1319+ }
1320+ ; {
1321+ param_type= DateTime
1322+ ; param_name= " ssh_expiry"
1323+ ; param_doc=
1324+ " The time in UTC after which the SSH access will be automatically \
1325+ disabled"
1326+ ; param_release= numbered_release " 25.20.0-next"
1327+ ; param_default= Some (VDateTime Date. epoch)
1328+ }
1329+ ; {
1330+ param_type= Int
1331+ ; param_name= " console_idle_timeout"
1332+ ; param_doc=
1333+ " The timeout in seconds after which idle console will be automatically \
1334+ terminated (0 means never)"
1335+ ; param_release= numbered_release " 25.20.0-next"
1336+ ; param_default= Some (VInt Constants. default_console_idle_timeout)
1337+ }
13031338 ]
13041339
13051340let create =
13061341 call ~name: " create" ~in_oss_since: None
1307- ~lifecycle: [(Published , rel_rio, " Create a new host record" )]
1342+ ~lifecycle:
1343+ [
1344+ (Published , rel_rio, " Create a new host record" )
1345+ ; ( Changed
1346+ , " 24.40.0"
1347+ , " Added --last_update_hash option to allow last_update_hash to be \
1348+ kept for host joined a pool"
1349+ )
1350+ ; ( Changed
1351+ , " 25.20.0-next"
1352+ , " Added --ssh_enabled --ssh_enabled_timeout --ssh_expiry \
1353+ --console_idle_timeout options to allow them to be configured for \
1354+ new host"
1355+ )
1356+ ]
13081357 ~versioned_params: create_params ~doc: " Create a new host record"
13091358 ~result: (Ref _host, " Reference to the newly created host object." )
13101359 ~hide_from_docs: true ~allowed_roles: _R_POOL_OP ()
@@ -2368,6 +2417,29 @@ let disable_ssh =
23682417 ~params: [(Ref _host, " self" , " The host" )]
23692418 ~allowed_roles: _R_POOL_ADMIN ()
23702419
2420+ let set_ssh_enabled_timeout =
2421+ call ~name: " set_ssh_enabled_timeout" ~lifecycle: []
2422+ ~doc: " Set the SSH service enabled timeout for the host"
2423+ ~params:
2424+ [
2425+ (Ref _host, " self" , " The host" )
2426+ ; ( Int
2427+ , " value"
2428+ , " The SSH enabled timeout in seconds (0 means no timeout, max 2 days)"
2429+ )
2430+ ]
2431+ ~allowed_roles: _R_POOL_ADMIN ()
2432+
2433+ let set_console_idle_timeout =
2434+ call ~name: " set_console_idle_timeout" ~lifecycle: []
2435+ ~doc: " Set the console idle timeout for the host"
2436+ ~params:
2437+ [
2438+ (Ref _host, " self" , " The host" )
2439+ ; (Int , " value" , " The console idle timeout in seconds" )
2440+ ]
2441+ ~allowed_roles: _R_POOL_ADMIN ()
2442+
23712443let latest_synced_updates_applied_state =
23722444 Enum
23732445 ( " latest_synced_updates_applied_state"
@@ -2527,6 +2599,8 @@ let t =
25272599 ; emergency_clear_mandatory_guidance
25282600 ; enable_ssh
25292601 ; disable_ssh
2602+ ; set_ssh_enabled_timeout
2603+ ; set_console_idle_timeout
25302604 ]
25312605 ~contents:
25322606 ([
@@ -2964,6 +3038,24 @@ let t =
29643038 ~default_value: (Some (VString " " )) " last_update_hash"
29653039 " The SHA256 checksum of updateinfo of the most recently applied \
29663040 update on the host"
3041+ ; field ~qualifier: DynamicRO ~lifecycle: [] ~ty: Bool
3042+ ~default_value: (Some (VBool Constants. default_ssh_enabled))
3043+ " ssh_enabled" " True if SSH access is enabled for the host"
3044+ ; field ~qualifier: DynamicRO ~lifecycle: [] ~ty: Int
3045+ ~default_value: (Some (VInt Constants. default_ssh_enabled_timeout))
3046+ " ssh_enabled_timeout"
3047+ " The timeout in seconds after which SSH access will be \
3048+ automatically disabled (0 means never), this setting will be \
3049+ applied every time the SSH is enabled by XAPI"
3050+ ; field ~qualifier: DynamicRO ~lifecycle: [] ~ty: DateTime
3051+ ~default_value: (Some (VDateTime Date. epoch)) " ssh_expiry"
3052+ " The time in UTC after which the SSH access will be automatically \
3053+ disabled"
3054+ ; field ~qualifier: DynamicRO ~lifecycle: [] ~ty: Int
3055+ ~default_value: (Some (VInt Constants. default_console_idle_timeout))
3056+ " console_idle_timeout"
3057+ " The timeout in seconds after which idle console will be \
3058+ automatically terminated (0 means never)"
29673059 ]
29683060 )
29693061 ()
0 commit comments