modify_hosts
async
¶
modify_hosts(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
host_recovery: Optional[HostRecovery] = None,
instance_type: Optional[String] = None,
instance_family: Optional[String] = None,
host_maintenance: Optional[HostMaintenance] = None,
host_ids: Optional[RequestHostIdList] = None,
auto_placement: Optional[AutoPlacement] = None,
) -> ModifyHostsResult
Modify the auto-placement setting of a Dedicated Host. When auto-placement is enabled, any instances that you launch with a tenancy of host but without a specific host ID are placed onto any available Dedicated Host in your account that has auto-placement enabled. When auto-placement is disabled, you need to provide a host ID to have the instance launch onto a specific host. If no host ID is provided, the instance is launched onto a suitable host with auto-placement enabled.
You can also use this API action to modify a Dedicated Host to support either multiple instance types in an instance family, or to support a specific instance type only.
Parameters:
-
host_recovery(Optional[HostRecovery], default:None) –Indicates whether to enable or disable host recovery for the Dedicated Host. For more information, see Host recovery in the Amazon EC2 User Guide.
-
instance_type(Optional[String], default:None) –Specifies the instance type to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support only a specific instance type.
If you want to modify a Dedicated Host to support multiple instance types in its current instance family, omit this parameter and specify InstanceFamily instead. You cannot specify InstanceType and InstanceFamily in the same request.
-
instance_family(Optional[String], default:None) –Specifies the instance family to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support multiple instance types within its current instance family.
If you want to modify a Dedicated Host to support a specific instance type only, omit this parameter and specify InstanceType instead. You cannot specify InstanceFamily and InstanceType in the same request.
-
host_maintenance(Optional[HostMaintenance], default:None) –Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see Host maintenance in the Amazon EC2 User Guide.
-
host_ids(Optional[RequestHostIdList], default:None) –The IDs of the Dedicated Hosts to modify.
-
auto_placement(Optional[AutoPlacement], default:None) –Specify whether to enable or disable auto-placement.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/async_ec2.py
50492 50493 50494 50495 50496 50497 50498 50499 50500 50501 50502 50503 50504 50505 50506 50507 50508 50509 50510 50511 50512 50513 50514 50515 50516 50517 50518 50519 50520 50521 50522 50523 50524 50525 50526 50527 50528 50529 50530 50531 50532 50533 50534 50535 50536 50537 50538 50539 50540 50541 50542 50543 50544 50545 50546 50547 50548 50549 50550 50551 50552 50553 50554 50555 50556 50557 50558 50559 | |