0% found this document useful (0 votes)
8 views

FleetManager API REFERENCE

N3uron FleetManager REST API reference
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

FleetManager API REFERENCE

N3uron FleetManager REST API reference
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

FleetManager v1.0 www.n3uron.

com Page | 1
Rest API Reference Manual
Index
Index ........................................................................................................................................................ 2
Introduction .............................................................................................................................................. 3
Endpoints ..................................................................................................................................................... 3
Request types .............................................................................................................................................. 3
GET ................................................................................................................................................................. 3
POST ............................................................................................................................................................... 3
Authentication .......................................................................................................................................... 4
Obtaining API key ......................................................................................................................................... 4
Using api key ................................................................................................................................................ 4
GET ................................................................................................................................................................. 4
POST ............................................................................................................................................................... 4
HTTP status codes .................................................................................................................................. 5
Error handling .......................................................................................................................................... 5
Operations ............................................................................................................................................... 5
Node ............................................................................................................................................................ 6
Get nodes by group ........................................................................................................................................ 6
Get nodes by token ........................................................................................................................................ 6
Get nodes by uid ............................................................................................................................................ 7
Move node ..................................................................................................................................................... 7
Delete node .................................................................................................................................................... 7
Deactivate node ............................................................................................................................................. 7
Activate node ................................................................................................................................................. 8
Group ........................................................................................................................................................... 8
Get children .................................................................................................................................................... 8
Get groups by workspace ............................................................................................................................... 8
Workspace ................................................................................................................................................... 8
Get workspaces .............................................................................................................................................. 9
Get tokens ...................................................................................................................................................... 9
Appendix A: internal errors .................................................................................................................... 10
401 – Unauthorized .................................................................................................................................... 10
403 – Forbidden ......................................................................................................................................... 10
500 – Internal Server Error ......................................................................................................................... 10
400 – Bad Request ..................................................................................................................................... 10
Introduction
Fleet Manager API is organized around REST. All endpoints return JSON-encoded responses and
use standard HTTP response codes.
The examples of this manual will be made using postman, also a postman collection will be provided
containing all API endpoints (operations).

Endpoints
All API operations endpoints have a common URL: <FM-SERVER-URL>/api followed by the specific
operation endpoint, for example:
https://myfleet.n3uron.com/api/workspace/getWorkspaces

Request types
There are two request types (or methods) GET and POST. Both of them always return a JSON-formatted
document.

GET
GET methods are those that do not modify data, only retrieve it. The parameters on these requests are
passed as query parameters, for example:
https://myfleet.n3uron.com/api/workspace/getWorkspaces?apiKey=abcdedfefs

POST
POST methods are those that modify data (create, update or delete). The data is a JSON document on
the request body; the response follows the same pattern as GET methods.

FleetManager v1.0 www.n3uron.com Page | 3


Rest API Reference Manual
Authentication
API authentication is based on an “apiKey”, in GET requests it is included as a query parameter in the
request and in POST request as part of request body.

Obtaining API key


API key can be obtained on Fleet Manager web under user security settings:

The "apiKey" can be found in the security section of the user settings.

Using api key


GET
For GET method the API key must be included in the request as "apiKey" parameter:

POST
For POST method the API key must be included in the JSON-formatted body as "apiKey" parameter:
HTTP status codes
The API returns the following http codes depending on the result of the request:
• 200 – OK: The operation was executed correctly.
• 400 – Bad Request: The operation requested returned an error.
• 401 – Unauthorized: Authentication error.
• 403 – Forbidden: The API key permissions are not enough to perform the request.
• 404 – Not Found: The requested operation doesn’t exist.
• 500 – Internal Server Error: Error in Fleet Manager side.

Error handling
Errors on Fleet Manager API returns an http code different from 200 – OK. Additionally, the error
responses include a description and a code of the error. Error codes description can be found on
Appendix A.

Authorization error returning a 401 – Unauthorized http status code and an internal error with code 114

Operations
Operations are divided in different services, for example, “node” is related to the operations related to
the remote nodes.
Autodiscover request (api/autodiscover) returns all the operations available through the API and
the following information for each request:
• Method: Shows operation method GET/POST.
• Accepted parameters: JSON-formatted accepted parameters showing the type of every

FleetManager v1.0 www.n3uron.com Page | 5


Rest API Reference Manual
parameter if they are base types (“Number”, “Boolean”, etc.) or its children structure if it’s an
object. If it is a base type a “type” entry will exists showing the type. If it is an object, a “children”
entry will exists showing the element children structure. Also, an “array” entry will exists showing
if the element is an array or not.
• Required parameters: JSON-formatted array that shows required parameters, not sending
those parameters with the request returns an error.
• Response parameters: JSON-formatted structure of the response, the structure is the same
as accepted parameters.

Autodiscover operation example

Node
Remote node related operations.

Get nodes by group


Using a group id this operation retrieves the nodes contained within this node.
• Endpoint: node/getByGroup
• Method: GET
• Accepted parameters
o groupId: Id of target group.
o recursive: If true, then all nodes placed in the subgroups will be returned too.
• Required parameters: groupId.
• Response parameters: Array of nodes
o uid: node UID.
o comment: Comment added on Fleet Manager web.
o token: Security token used on Fleet Manager client module.
o status: Node status

Get nodes by token


This operation retrieves all nodes associated to a token.
• Endpoint: node/getByToken
• Method: GET
• Accepted parameters
o token: Security token configured on Fleet Manager client.
• Required parameters: token.
• Response parameters: Array of nodes
o uid: node UID.
o comment: Comment added on Fleet Manager web.
o token: Security token used on Fleet Manager client module.
o status: Node status

Get nodes by uid


This operation retrieves the node with the UID provided.
• Endpoint: node/getByUid
• Method: GET
• Accepted parameters
o uid: Node UID.
• Required parameters: uid.
• Response parameters: Node data.
o comment: Comment added on Fleet Manager web.
o token: Security token used on Fleet Manager client module.
o status: Node status

Move node
Moves a node to a new group inside the same workspace.
• Endpoint: node/move
• Method: POST
• Accepted parameters
o groupId: destination group id.
o Id: node to move id(uid).
• Required parameters: id, groupId.
• Response parameters: empty or error.

Delete node
Deletes a node from Fleet Manager server. In order to add it again, just restart Fleet Manager Client
module on the remote node.
• Endpoint: node/delete
• Method: POST
• Accepted parameters
o Id: node to delete id(uid).
• Required parameters: id.
• Response parameters: empty or error.

Deactivate node
Deactivates a node. While a node is deactivated in the Fleet Manager server it is not possible to monitor
its status or launch the remote access:
• Endpoint: node/deactivate
• Method: POST
• Accepted parameters
o Id: node to deactivate id(uid).
• Required parameters: id.

FleetManager v1.0 www.n3uron.com Page | 7


Rest API Reference Manual
• Response parameters: empty or error.

Activate node
Activates a node, the node will return to the active status in the Fleet Manager server. When a remote
node is active it is possible to monitor its status and launch remote connections from the Fleet Manager
server. Please note activating/deactivating a node is just related to Fleet Manager server, it doesn't have
any influence in the functionality of the remote node.
• Endpoint: node/activate
• Method: POST
• Accepted parameters
o Id: node to deactivate id(uid).
• Required parameters: id.
• Response parameters: empty or error.

Group
Operations related to Groups.

Get children
Provides the subgroups contained in a group.
• Endpoint: group/getChildren
• Method: GET
• Accepted parameters
o Id: group id.
• Required parameters: id.
• Response parameters: Array of groups.
o id: Child group id.
o name: group name.
o flags: reserved system flags for root group and Unassigned group.
o children: Boolean that tells if the group has subgroups.

Get groups by workspace


Provides workspace groups.
• Endpoint: group/getByWorkspace
• Method: GET
• Accepted parameters
o workspaceId: Workspace id.
• Required parameters: workspaceId.
• Response parameters: Array of groups.
o id: Child group id.
o name: group name.
o flags: reserved system flags for root group and Unassigned group.
o children: Boolean that tells if the group has children.

Workspace
Workspace related operations
Get workspaces
Provides the workspaces related to the user:
• Endpoint: workspace/getWorkspaces
• Method: GET
• Accepted parameters: None.
• Required parameters: None.
• Response parameters: Array of workspaces.
o id: Workspace id.
o name: Workspace name.
o creator: Indicates if the user is the creator of the workspace.
o accepted: Indicates if the user has accepted the invitation to the workspace.

Get tokens
Provides the tokens generated in the workspace:
• Endpoint: workspace/getWorkspaces
• Method: GET
• Accepted parameters:
o workspaceId: Workspace id.
• Required parameters: workspaceId.
• Response parameters: Array of tokens.
o name: Token name.
o token: Token.
o created: Creation date.
o active: True if token is active.

FleetManager v1.0 www.n3uron.com Page | 9


Rest API Reference Manual
Appendix A: internal errors

401 – Unauthorized
• 114: Api key is missing or incorrect.

403 – Forbidden
• 108: Invalid permissions to execute the operation.
• 110: Group not available in the selected workspace.
• 109: Group not editable in the selected workspace.

500 – Internal Server Error


• 700, 701: Internal error.
• 30: Encoding error.
• 31: Compression error.

400 – Bad Request


• 0: Missing parameter.
• 13: Invalid parameter.
• 29: Invalid parameter type.
• 500: Node not found.
v

FleetManager v1.0 www.n3uron.com Page | 11


Rest API Reference Manual

You might also like