garycs
December 11, 2015, 12:07am
1
I am trying to retrieve computers by a specific IP address, but it isn’t working.
I am using URL:
https://xxxx.xxx.xxx:52311/api/query?relevance=(id of it) of bes computers whose ( ip address of it as string contains "9.12.234.182" )
The Result is null
with return code 200
and msg of OK
. The IP Address is in an entry on the server.
What is wrong with query?
leewei
December 11, 2015, 4:26am
2
Can’t spot any errors with your Relevance Statement.
What do you get when you enter the statement into Web Report QNA?
https://WebReportsServer:52312/webreports?page=QNA
jgstew
December 11, 2015, 11:04am
3
The relevance query usually needs to be in quotes with the inner quotes escaped. You may need to escape the spaces as well in some cases.
How are you making the REST call? cURL?
garycs
December 11, 2015, 2:05pm
4
When I click on this link, I get server not found
jmaple
December 11, 2015, 2:06pm
5
You need to replace the link with that of your server.
1 Like
garycs
December 11, 2015, 2:08pm
6
I am using curl. Here are the results.
curl -k -n "https://ROOT_SERVER_FQDN:52311/api/query?relevance=(id%20of%20it)%20of%20bes%20computers%20whose%20(%20ip%20address%20of%20it%20as%20string%20contains%20%229.12.248.58%22%20)"
<?xml version="1.0" encoding="UTF-8"?>
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
<Query Resource="(id of it) of bes computers whose ( ip address of it as string contains "9.12.248.58" )">
<Result></Result>
<Evaluation>
<Time>16.953ms</Time>
<Plurality>Plural</Plurality>
</Evaluation>
</Query>
</BESAPI>
Here are IP Address contents when isting by ID
<Property Name="IP Address">10.112.80.58</Property>
<Property Name="IP Address">9.12.248.58</Property>
<Property Name="IPv6 Address">fe80:0:0:0:408:69ff:fec1:dba8</Property>
garycs
December 11, 2015, 2:13pm
7
I am getting unable to connect. Sending note to owner of the server regarding port 52312
garycs
December 11, 2015, 2:14pm
8
Here is curl data returned:
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
<Query Resource="(id of it) of bes computers whose ( ip address of it as string contains "9.12.248.58" )">
<Result></Result>
<Evaluation>
<Time>16.953ms</Time>
<Plurality>Plural</Plurality>
</Evaluation>
</Query>
</BESAPI>
garycs
December 11, 2015, 2:41pm
9
Lets try again to post result from curl command:
Query Resource="(id of it) of bes computers whose ( ip address of it as string contains "9.12.248.58" )"
garycs
December 11, 2015, 5:32pm
10
I think I found the problem. I went to the webreports?page=QNA
I entered this query:
Q: (id of it) of bes computers whose ( ip address of it as string contains "9.12.188.54" )
A: 10070881
This computer has only one IP Address property
Property Name=“IP Address”>9.12.188.54</Property
I then did:
Q: (id of it) of bes computers whose ( ip address of it as string contains "9.12.248.58" )
No answer was returned on evaluate.
I noticed that this computer has 2 IP Address property stanzas
Property Name="IP Address">10.112.80.58</Property
Property Name="IP Address">9.12.248.58</Property
I also tried using IP Address 10.112.80.58
with no answer returned.
I looks like if there is more than one IP Address property stanza the computer entry isn’t found.
I tried using property name ips9, but got error ips9 not valid.
Where do I go from here?
gearoid
December 12, 2015, 5:39am
11
ids of bes computers whose ( exists ip address whose (it as string contains "9.12.248.58") of it )
1 Like
jgstew
December 12, 2015, 8:14pm
13
I fixed your posts above so the contents you pasted in show up properly.
You just need to highlight the code / XML / etc… and click the </>
button in the toolbar.
Also, it just occurred to me that it is probably better to use IP Addresses in private IP space for working out examples like this. ( Like: 192.168.1.x
)
You generally should redact any server domain names and public IP addresses from forum posts.
Can we get the list of all the computers by an array ip address ?