2
REQUESTS
22
" mac "
:
"00
:
3 a
:
83
:
10
:
24
:
DC "
23
}
24
]
,
25
" m a x L e a s e s "
:
200
,
26
" o p t i o n s "
:
[
" dhcp - a u t h o r i t a t i v e "
]
,
27
" r a n g e E n d "
:
" 1 9 2 . 1 6 8 . 2 . 2 5 4 "
,
28
" r a n g e S t a r t "
:
" 1 9 2 . 1 6 8 . 2 . 1 0 0 "
,
29
" s u b n e t A d d r e s s "
:
" 1 9 2 . 1 6 8 . 2 . 0 "
,
30
" s u b n e t M a s k "
:
" 2 5 5 . 2 5 5 . 2 5 5 . 0 "
31
}
,
32
" s t a t u s "
:
" s u c c e s s "
33
}
The API allows requests to path to specific elements or groups of embedded elements. For example, if a user
only wanted to know if DHCP was enabled, they could make the request: https://[rcell ip]/api/dhcp/enabled.
Example:
Path to an element within the DHCP collection.
1
GET https://192.168.2.1/api/dhcp/enabled
2
3
S t a t u s
:
H T T P / 1 . 1 200 OK
4
{
5
" c o d e "
:
200
,
6
" r e s u l t "
:
t r u e
,
7
" s t a t u s "
:
" s u c c e s s "
8
}
Accessing objects within an array can be done using the index of the desired object in the path. Some collections
support using an object’s unique identifier in place of the object’s index; generally, this unique identifier is a member
called
name
or
guid
. For example, suppose an rCell was configured with a GRE tunnel named
MyGreTunnel
, and
a user wanted to know the IP address of the remote end point of that tunnel. The user could make a RESTful
GET request to https://[rcell ip]/api/greTunnels/MyGreTunnel/remoteIp.
Example:
Path to an element within an object in an array using the object’s unique identifier.
1
GET https://192.168.2.1/api/greTunnels/MyGreTunnel/remoteIp
2
3
S t a t u s
:
H T T P / 1 . 1 200 OK
4
{
5
" c o d e "
:
200
,
6
" r e s u l t "
:
" 1 6 6 . 1 8 4 . 3 8 . 7 3 "
,
7
" s t a t u s "
:
" s u c c e s s "
8
}
2.2
Logging In
To use the API, a user must be authorized and have equal or greater privileges than the API call they are
invoking. A user can login with valid credentials by passing their username and password to the login URL (
https://192.168.2.1/api/login
) either as URI parameters or within a JSON object. The following call will
login the user
admin
, and return the session information including an authorized token. The API attempts to
cache the token as a cookie in the user’s web browser for authorizing future calls. As an alternative to using a
browser cookie, this token can be passed as a URI parameter using the key:
token
. Additional URI parameters
can be found in section 2.9 URI Parameters.
Example:
Login using username ’admin’ and password ’admin’.
1
GET https://192.168.2.1/api/login?username=admin&password=admin
2
3
S t a t u s
:
H T T P / 1 . 1 200 OK
6
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Содержание MultiConnect rCell MTR-C2
Страница 1: ...MultiConnect R rCell API Developer Guide ...