Define prefix for cloud host name

Available in versions: 25.1 and higher.

Description

Add a custom prefix to Azure virtual machines and Amazon instance names.

URL

Copy code
/Admin/rest/v1/cloud/templates/{templateId}

Remarks

This API should be authorized for the Application, Tenant, and Site Admin permission levels.

HTTP method

PATCH

Request

Headers:

Content-Type: application/xml

Cookies:

Versions 25.1 and later

ADM_LWSSO={ADM_LWSSO_COOKIE_VALUE};

Request body:

PATCH: An XML with the name prefix.

Request example:

Copy code
PATCH http://<Server>/Admin/rest/v1/cloud/templates/{templateId}
Content-Type: application/xml
Accept: application/xml
Cookie: ADM_LWSSO={AdmLwssoCookie};

<CloudTemplate>    
   <HostNamePrefix>ABCDEFG</HostNamePrefix>
</CloudTemplate>

Response

Headers:

Content-Type: application/xml

Cookies:

None

HTML return code:

One of the HTTP return codes

Upon successful deletion, returns HTTP status 200 (OK).

HTML body:

The response body contains XML of the patched template.

Response example:

Copy code
  <CloudHostTemplate>
    <ID>16</ID>
    <Name>azure_win_new</Name>
    <ResourceType>cloud-host-templates</ResourceType>
    <AccountID>3</AccountID>
    <AccountName>azure</AccountName>
    <LocationID>35</LocationID>
    <LocationName>South Central US</LocationName>
    <Installation>OneLG</Installation>
    <Image>/subscriptions/11113fd5-74d9-4094-a256-e104833f6b82/resourceGroups/LRE_ONELG_QA/providers/Microsoft.Compute/images/LR-LRE_Load_Generator_2024.3_Win2022</Image>
    <Purpose>Load Generator</Purpose>
    <InstanceType>Standard_D2s_v3</InstanceType>
    <SecurityGroupID>7</SecurityGroupID>
    <SecurityGroupName>My_SecurityGroup_SouthCentralUS_LG_PORTS (/subscriptions/11113fd5-74d9-4094-a256-e104833f6b82/resourceGroups/ ResourceGroup/providers/Microsoft.Network/networkSecurityGroups/ SecurityGroup_SouthCentralUS_LG_PORTS)</SecurityGroupName>
    <Platform>Windows</Platform>
    <UseElasticIP>false</UseElasticIP>
    <Valid>true</Valid>
    <NetworkId>4</NetworkId>
    <NetworkName> ResourceGroup-vnet</NetworkName>
    <UsePrivateIP>false</UsePrivateIP>
    <HostNamePrefix> ABCDEFG -</HostNamePrefix>
</CloudHostTemplate>

See also: