Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with virtual host alias creation

Former Member
0 Likes
1,148
  • SAP Managed Tags

Hello,

We are trying to to add an alias name for the default virtual host in SAP API management.


We have created an XML file, called: newvh.xml, with the following code

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<VirtualHost name="default">

<HostAliases>

<HostAlias><FQDN for the server where router and message processor are installed</HostAlias>

</HostAliases>

<Interfaces/>

<Port>9001</Port>

</VirtualHost>

This is the command that I run in order to update the alias:

curl -u <admin user email>:<password> -X PUT http://<management server address:8080/v1/organization/<org name>/environment/<env name>/virtualhosts/default -d’@./newvh.xml -H "Content-Type:application/xml"

This does not create the alias for the virtual host.

Please suggest a solution to get this fixed.

Thanks in advance.

4 REPLIES 4
Read only

Elijah_Martinez1
Product and Topic Expert
Product and Topic Expert
0 Likes
875
  • SAP Managed Tags

This question sounds very close to the issue answered here .

can you assist here again?

Read only

0 Likes
875
  • SAP Managed Tags

Hi Geethika,

Can you provide the output of the below curl command :

curl -u username:pwd -X GET 'http://mgmtserverIp:8080/v1/o/<Org_name>/e/<Env_Name>/virtualhosts/default .

Regards,

Suma

Read only

0 Likes
875
  • SAP Managed Tags

Hi Suma

Here's the output -

{

  "hostAliases" : [ ],

  "interfaces" : [ ],

  "name" : "default",

  "port" : "9001"

}


Thanks

Geetika

Read only

0 Likes
875
  • SAP Managed Tags

Hi Geetika,

Are you executing these curl commands in Management Server . The steps you followed are correct .

Follow these steps in management server :

  1. Delete the existing VH

     curl -u userId:password  -X DELETE http://localhost:8080/v1/o/<Org_name>/e/<testname>/virtualhosts/default -v 

  1. Execute the below command from the location where *.xml is created .

curl -u userId:password -X POST http://localhost:8080/v1/o/<Org_name>/e/<testname>/virtualhosts/ -d '@./*.xml' -H "Content-Type:application/xml"

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<VirtualHost name="default">

<HostAliases>

<HostAlias>FQDN of Router</HostAlias>

</HostAliases>

    <Interfaces/>

    <Port>Enter port details here</Port>

</VirtualHost>

Regards,

Suma