Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Launch 3VR System Manager.

  2. In the Configure panel of System Manager, right-click the name of the appliance and select Start Web Services.

    Image RemovedImage Added
  3. A pop up will appear indicating that web services is now running.

...

Code Block
import urllib2, sys
def auth(hostname,username,password):
url = “https://%s:8080/” % (hostname)
password _ mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
handler = urllib2.HTTPBasicAuthHandler(password _ mgr)
opener = urllib2.build _ opener(handler)
urllib2.install _ opener(opener)
password _ mgr.add _ password(None, url, username, password)
def get _ settings(hostname):
url = "https://%s:8080/settings" % (hostname) #url path to request settings
try:
req = urllib2.urlopen(url)
return req.read()
except urllib2.HTTPError, e:
print "HTTP error: %s" % e.code
except Exception, e:
print e
return ""
if _ _ name _ _ == "_ _ main _ _":
try:
hostname = sys.argv[1]
except:
print "usage: settingsAPI.py [IP address or hostname]"
sys.exit(1)
auth(hostname,"techrep","3MeDeee")
settingsxml = get _ settings(hostname)

Headers and Responses

The information below will apply to most 3VR REST API routes. 3VR is in the process of unifying and normalizing its API, so the 3VR REST API routes marked with an asterisk (*) are those still in need of updating. For now, their response will be in XML and they will not take the 'Accept' request header, but will do so in the future.

The default response of all routes will be formatted as JSON objects except for the channel image and video routes.; images routes will return an image, see the routes below for more details. The ‘Accept’ request header allows specifying the desired content type to be returned. For example:

Code Block
Accept: application/xml
Accept: application/json

Please note most browsers will include application/xml in the request header by default, so for debugging purposes an accept argument in the query string may be required to request a JSON formatted response. For example, when retrieving the list of appliances in JSON format using a browser, access the following URL:

Code Block
https://hostaddress:8080/appliances?accept=application/json

3VR REST API Routes

/appliances

Code Block
https://[IP address or hostname]:[port]/appliances

...

Options

Code Block
?regions=true if included, the returned list of appliances will be arranged in regions

Sample Response XML

Code Block
languagexml
<ArrayOfApplianceInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ApplianceInfo>
<Id>1</Id>
<Name>3VR Enterprise Appliance</Name>
<Address>10.100.2.22</Address>
<MachineType>EnterpriseServer</MachineType>
<TimeZoneKey>Pacific Standard Time</TimeZoneKey>
<TimeZoneOffset>480</TimeZoneOffset>
<Created>0001-01-01T00:00:00</Created>
<Updated>2012-07-26T00:42:04</Updated>
<VideoStart>0001-01-01T00:00:00</VideoStart>
<SyncDate>2012-07-02T11:00:14</SyncDate>
<ObjectType>appliance</ObjectType>
</ApplianceInfo>
<ApplianceInfo>
<Id>2</Id>
<Name>Lake Merritt Branch</Name>
<Address>10.100.2.202</Address>
<MachineType>Integrated</MachineType>
<TimeZoneKey>Pacific Standard Time</TimeZoneKey>
<TimeZoneOffset>480</TimeZoneOffset>
<Created>2011-04-26T18:37:30</Created>
<Updated>2012-07-27T08:56:51</Updated>
<VideoStart>2011-04-26T18:46:35</VideoStart>
<SyncDate>2012-07-27T08:56:51</SyncDate>
<ObjectType>appliance</ObjectType>
</ApplianceInfo>
</ArrayOfApplianceInfo>

Sample Response JSON

Code Block
languagejson
[
{
Id: 1,
Name: "3VR Enterprise Appliance",
Address: "10.100.2.22",
MachineType: "EnterpriseServer",
TimeZoneKey: "Pacific Standard Time",
TimeZoneOffset: 480,
Created: "/Date(-62135568000000)/",
Updated: "/Date(1343549702000)/",
VideoStart: "/Date(-62135568000000)/",
SyncDate: "/Date(1341252014000)/",
ObjectType: "appliance"
},
{
Id: 2,
Name: "Lake Merritt Branch",
Address: "10.100.2.202",
MachineType: "Integrated",
TimeZoneKey: "Pacific Standard Time",
TimeZoneOffset: 480,
Created: "/Date(1303868250000)/",
Updated: "/Date(1343673311000)/",
VideoStart: "/Date(1303868795000)/",
SyncDate: "/Date(1343673311000)/",
ObjectType: "appliance"
}
]

/health

Code Block
https://[IP address or hostname]:[port]/health

...

Sample Response XML

Code Block
languagexml
<?xml version="1.0" ?>
<ArrayOfHealthAlertInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<HealthAlertInfo>
<DisplayLabel>Camera or Camera Connection Failure</DisplayLabel>
<Id>3</Id>
<StartTime>2012-06-20T11:24:10</StartTime>
<EndTime>2012-07-27T04:03:55</EndTime>
<Message>Camera '1. Shipping Room' is not sending video.</Message>
</HealthAlertInfo>
</ArrayOfHealthAlertInfo>