Main Content

renameTarget

Rename target computer

Since R2022b

    Description

    renameTarget(tgs, oldTargetName, newTargetName) updates the name of the target from oldTargetName to newTargetName.

    example

    Examples

    collapse all

    Create a target object and add a target with name LinuxTarget1 containing user name user1 and password myPassword.

    tgs = linux.Targets();
    tg = tgs.addTarget("LinuxTarget1", "178.10.10.1", "user1", "myPassword");

    Rename the target.

    renameTarget(tgs, "LinuxTarget1", "LinuxTarget2");

    Input Arguments

    collapse all

    Target object created by the linux.Targets class.

    Example: tgs, target_object

    Specify the current name of the target to be updated.

    Example: "TargetName"

    Specify the new name for the target.

    Example: "Target'sNewName"

    Version History

    Introduced in R2022b