Unable to addrs using RESTful-API

0

I manually created a new real server "172.20.3.225:3080" in a VS "206.15.152.XXX:3080" using the web user interface. 

I'm able to run these commands successfully:

But when I try to create the RS using RESTful API, I get an error:

$ curl -k "https://bal:xxxxx@lb.example.net/access/addrs?vs=206.15.152.XXX&port=3080&prot=tcp&rs=172.20.3.225&rsport=3080"
<?xml version="1.0" encoding="ISO-8859-1"?>
<Response stat="422" code="fail">
<Error>Couldn't create RS</Error>
</Response>

Is this a access permissions issue with user "bal"? How Do I permit this user to add real servers using RESTful API?

Thanks in advance,

 

Ed Sulit

eduardos@broadvoice.com

 

6 comments

Avatar
0
eduardos

I created a new user "eduardos" using the web user interface under sysconfig-->sysadmin-->user management. I gave it "All Permissions". When I tried to create the RS using RESTful API, I get a difference error:

$ curl -k "https://eduardos:xxxxxx@lb.example.net/access/addrs?vs=206.15.152.XXX&port=3080&prot=tcp&rs=172.20.3.225&rsport=3080"
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>401 Authorization Required</TITLE>
</HEAD><BODY>
<H1>Authorization Required</H1>
You do not have authorization to perform the requested operation
<P>
<HR>
<ADDRESS>mini-http/1.0 (unix)</ADDRESS>
</BODY></HTML>

Avatar
0
derkiely

Hi Eduardos,

I don't believe that this is a permissions issue. Bal is not restricted. The command you have there will create an RS on the VS specified. If the RS is already created you will get an error. Was the RS already there?

Hope this helps.

Avatar
0
eduardos

The RS does not exist in that VS, but it exists in other VSs using different ports.

Avatar
0
eduardos

I deleted the RS from all other VSs just to see if that might be thge cause. I get the same error when creating the RS using user "bal".

Avatar
0
sean.dailey

I am also getting this same error When I run the addrs command

 

 

<Response stat="422" code="fail">
<Error>Couldn't create RS</Error>
</Response>
 
 
Avatar
0
jonathan.lefebvre

to anyone stumbling on the same issue, you need to add "&non_local=1" at the end of the API call to explicitely request a non local real server. 

full request should look like that : curl -k "https://bal:ccc@10.22.213.xx:8443/access/addrs?vs=10.22.213.xx&port=81&prot=tcp&rs=10.22.221.yy&rsport=81&non_local=1"