7070 ExportSnapshotResponse ,
7171 GetBootscriptResponse ,
7272 GetDashboardResponse ,
73+ GetEncryptedRdpPasswordResponse ,
7374 GetImageResponse ,
7475 GetIpResponse ,
7576 GetPlacementGroupResponse ,
165166 unmarshal_ExportSnapshotResponse ,
166167 unmarshal_GetBootscriptResponse ,
167168 unmarshal_GetDashboardResponse ,
169+ unmarshal_GetEncryptedRdpPasswordResponse ,
168170 unmarshal_GetImageResponse ,
169171 unmarshal_GetIpResponse ,
170172 unmarshal_GetPlacementGroupResponse ,
@@ -528,6 +530,7 @@ async def _create_server(
528530 tags : Optional [List [str ]] = None ,
529531 security_group : Optional [str ] = None ,
530532 placement_group : Optional [str ] = None ,
533+ admin_password_encryption_ssh_key_id : Optional [str ] = None ,
531534 ) -> CreateServerResponse :
532535 """
533536 Create an Instance.
@@ -552,6 +555,7 @@ async def _create_server(
552555 :param tags: Instance tags.
553556 :param security_group: Security group ID.
554557 :param placement_group: Placement group ID if Instance must be part of a placement group.
558+ :param admin_password_encryption_ssh_key_id: UUID of the SSH RSA key that will be used to encrypt the initial admin password for OS requiring it. Mandatory for Windows OS.
555559 :return: :class:`CreateServerResponse <CreateServerResponse>`
556560
557561 Usage:
@@ -585,6 +589,7 @@ async def _create_server(
585589 tags = tags ,
586590 security_group = security_group ,
587591 placement_group = placement_group ,
592+ admin_password_encryption_ssh_key_id = admin_password_encryption_ssh_key_id ,
588593 project = project ,
589594 organization = organization ,
590595 ),
@@ -4169,3 +4174,65 @@ async def apply_block_migration(
41694174 )
41704175
41714176 self ._throw_on_error (res )
4177+
4178+ async def get_encrypted_rdp_password (
4179+ self ,
4180+ * ,
4181+ server_id : str ,
4182+ zone : Optional [Zone ] = None ,
4183+ ) -> GetEncryptedRdpPasswordResponse :
4184+ """
4185+ Get the encrypted RDP password.
4186+ Get the initial administrator password for Windows RDP. This password is encrypted using the SSH RSA key specified at the time of Instance creation.
4187+ :param server_id: UUID of the Instance.
4188+ :param zone: Zone to target. If none is passed will use default zone from the config.
4189+ :return: :class:`GetEncryptedRdpPasswordResponse <GetEncryptedRdpPasswordResponse>`
4190+
4191+ Usage:
4192+ ::
4193+
4194+ result = await api.get_encrypted_rdp_password(
4195+ server_id="example",
4196+ )
4197+ """
4198+
4199+ param_zone = validate_path_param ("zone" , zone or self .client .default_zone )
4200+ param_server_id = validate_path_param ("server_id" , server_id )
4201+
4202+ res = self ._request (
4203+ "GET" ,
4204+ f"/instance/v1/zones/{ param_zone } /servers/{ param_server_id } /encrypted_rdp_password" ,
4205+ )
4206+
4207+ self ._throw_on_error (res )
4208+ return unmarshal_GetEncryptedRdpPasswordResponse (res .json ())
4209+
4210+ async def delete_encrypted_rdp_password (
4211+ self ,
4212+ * ,
4213+ server_id : str ,
4214+ zone : Optional [Zone ] = None ,
4215+ ) -> None :
4216+ """
4217+ Delete the encrypted RDP password.
4218+ Delete the initial administrator password for Windows RDP.
4219+ :param server_id: UUID of the Instance.
4220+ :param zone: Zone to target. If none is passed will use default zone from the config.
4221+
4222+ Usage:
4223+ ::
4224+
4225+ result = await api.delete_encrypted_rdp_password(
4226+ server_id="example",
4227+ )
4228+ """
4229+
4230+ param_zone = validate_path_param ("zone" , zone or self .client .default_zone )
4231+ param_server_id = validate_path_param ("server_id" , server_id )
4232+
4233+ res = self ._request (
4234+ "DELETE" ,
4235+ f"/instance/v1/zones/{ param_zone } /servers/{ param_server_id } /encrypted_rdp_password" ,
4236+ )
4237+
4238+ self ._throw_on_error (res )
0 commit comments