Show: Delphi C++
Display Preferences

EMS EdgeModules Resource

From RAD Studio
Jump to: navigation, search

Go Up to EMS Administrative API‎


The EMS database stores data about the registered EMS EdgeModules in the EMS Server. You can access this information by using the registered EdgeModules Resource.

You can use the EMS EdgeModules resource to register, unregister or modify an EMS EdgeModule and its resources in your EMS Server.

Note: Use the TEMSClientAPI component to register, unregister, update, or retrieve the data info of an EMS EdgeModules from the EMS Server.

EdgeModules Resource Endpoints

EdgeModules Resource exposes the following EMS Resource Endpoints:

Endpoint Method Name Resource Suffix HTTP Request Type Use

GetModules

--

HTTP GET

To retrieve all data from the EdgeModules Resource.

GetModule

{id}

HTTP GET

To retrieve all data from an EdgeModule.
id is the unique EMS EdgeModule identifier in the EMS database.

GetModulesFields

fields

HTTP GET

To retrieve the field names of all EMS EdgeModules.

GetResources

resources

HTTP GET

To retrieve all data from the resources of all EdgeModules.

GetModuleResources

{id}/resources

HTTP GET

To retrieve all data from the resources of an EdgeModule.
id is the unique EMS EdgeModule identifier in the EMS database.

GetResourcesFields

resources/fields

HTTP GET

To retrieve the field names of all resources of the EMS EdgeModules.

GetModuleResource

{id}/resources/{resourcename}

HTTP GET

To retrieve all data from a resource of an EdgeModule.
id is the unique EMS EdgeModule identifier in the EMS database.
resourcename is the name of the resource.

RegisterModule

--

HTTP POST

To add a new EMS EdgeModule to the EMS database.

RegisterModuleResource

{id}/resources

HTTP POST

To register a new resource from an EMS EdgeModule.
id is the unique EMS EdgeModule identifier in the EMS database.

UpdateModule

{id}

HTTP PUT

To update the data of an existing EMS EdgeModule.
id is the unique EMS EdgeModule identifier in the EMS database.

UpdateModuleResource

{id}/resources/{resourcename}

HTTP PUT

To update the data of an existing resource from an EMS EdgeModule.
id is the unique EMS EdgeModule identifier in the EMS database.
resourcename is the name of the resource.

UnregisterModule

{id}

HTTP DELETE

To delete an existing EMS EdgeModule.
id is the unique EMS EdgeModule identifier in the EMS database.

UnregisterModuleResource

{id}/resources/{resourcename}

HTTP DELETE

To delete the data of an existing resource from an EMS EdgeModule.
id is the unique EMS EdgeModule identifier in the EMS database.
resourcename is the name of the resource.

GetResourceEndpoint

{modulename}/{resourcename}

HTTP GET

To get the data from the GET resource endpoint from an existing EMS EdgeModule.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.

GetResourceEndpointItem

{modulename}/{resourcename}/{item}

HTTP GET

To retrieve the data of a specific endpoint from an EMS EdgeModule resource.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.
item is the resource suffix to identify the endpoint.

PutResourceEndpoint

{modulename}/{resourcename}

HTTP PUT

To update the data from the resource endpoint from an existing EMS EdgeModule.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.

PutResourceEndpointItem

{modulename}/{resourcename}/{item}

HTTP PUT

To update the data of a specific endpoint from an EMS EdgeModule resource.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.
item is the resource suffix to identify the endpoint.

PostResourceEndpoint

{modulename}/{resourcename}

HTTP POST

To add new data to the resource endpoint from an existing EMS EdgeModule.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.

PostResourceEndpointItem

{modulename}/{resourcename}/{item}

HTTP POST

To add new data of a specific endpoint from an EMS EdgeModule resource.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.
item is the resource suffix to identify the endpoint.

PatchResourceEndpoint

{modulename}/{resourcename}

HTTP PATCH

To request a set of changes in the data of the resource endpoint from an existing EMS EdgeModule.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.

PatchResourceEndpointItem

{modulename}/{resourcename}/{item}

HTTP PATCH

To request a set of changes in the data of a specific endpoint from an EMS EdgeModule resource.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.
item is the resource suffix to identify the endpoint.

DeleteResourceEndpoint

{modulename}/{resourcename}

HTTP DELETE

To delete the data of the resource endpoint from an existing EMS EdgeModule.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.

DeleteResourceEndpointItem

{modulename}/{resourcename}/{item}

HTTP DELETE

To delete the data of a specific endpoint from an EMS EdgeModule resource.
modulename is the EMS EdgeModule name in the EMS database.
resourcename is the name of a resource from an EMS EdgeModule in the EMS database.
item is the resource suffix to identify the endpoint.

GetModules Endpoint

Returns a list of EMS EdgeModules data.

Use the QueryModules method, or the TBackendQuery components and the EdgeModule resource to retrieve the list of EMS EdgeModules.

If successful, the response from the EMS server provides a list of all EMS EdgeModules with details about each one of them.

  • modulename
  • _id
  • protocol
  • protocolprops (port and host)
  • _meta (creator, created date and updated date fields)
  • Custom fields (optional)

Example Response

This is an example response:

[
    {
        "modulename": "WinEdge1",
        "_id": "34C977F1-4DCE-4412-ACE8-35339CEE7282",
        "protocol": "http",
        "protocolprops": "{\"port\":8082,\"host\":\"localhost\"}",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000000",
            "created": "2015-08-12T14:57:19.000Z"
        }
    },
    {
        "modulename": "WinEdge2",
        "_id": "5B2A78B8-2599-433F-956D-720A12FFCD0B",
        "protocol": "http",
        "protocolprops": "{\"port\":8081,\"host\":\"localhost\"}",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000000",
            "created": "2015-08-13T13:54:18.000Z"
        }
    }
]

GetModule Endpoint

It returns the data of a specified EMS EdgeModule.

Your request must provide the following field:

  • _id

Use the RetrieveModule method, or the TBackendQuery component and the EdgeModule Resource to retrieve its data.

If successful, the response from the EMS server provides an EMS EdgeModule with the following details:

  • modulename
  • _id
  • protocol
  • protocolprops (port and host)
  • _meta (creator, created date and updated date fields)
  • Custom fields (optional)

Example Response

This is an example response for the module "5B2A78B8-2599-433F-956D-720A12FFCD0B":

{
    "modulename": "WinEdge2",
    "_id": "5B2A78B8-2599-433F-956D-720A12FFCD0B",
    "protocol": "http",
    "protocolprops": "{\"port\":8081,\"host\":\"localhost\"}",
    "_meta": {
        "creator": "00000000-0000-0000-0000-000000000000",
        "created": "2015-08-13T13:54:18.000Z"
    }
}

GetModulesFields Endpoint

Retrieves the field names of all EMS EdgeModules from the EMS database.

Use the RetrieveModulesFields method to retrieve the fields of an EMS EdgeModule.

If successful, the response from the EMS server provides all the field names of the EMS EdgeModules.

  • modulename
  • _id
  • protocol
  • protocolprops
  • _meta (creator, created and updated fields)

Example Response

This is an example response:

[
    {
        "name": "modulename"
    },
    {
        "name": "_id"
    },
    {
        "name": "protocol"
    },
    {
        "name": "protocolprops"
    },
    {
        "name": "_meta",
        "fields": [
            {
                "name": "creator"
            },
            {
                "name": "created"
            },
            {
                "name": "updated"
            }
        ]
    }
]

GetResources Endpoint

Returns a list of resources of all EMS EdgeModules.

Use the QueryModuleResources method, or the TBackendQuery component and the EdgeModule resource to retrieve the list of resources from the EMS EdgeModules.

If successful, the response from the EMS server provides a list of resources of all EMS EdgeModules with details about each one of them.

  • resourcename
  • modulename
  • moduleid
  • _meta (creator, created date and updated date fields)
  • Custom fields (optional)

Example Response

This is an example response:

[
    {
        "resourcename": "version",
        "modulename": "WinEdge1",
        "moduleid": "34C977F1-4DCE-4412-ACE8-35339CEE7282",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000000",
            "created": "2015-08-12T14:57:19.000Z"
        }
    },
    {
        "resourcename": "Measurements",
        "modulename": "WinEdge1",
        "moduleid": "34C977F1-4DCE-4412-ACE8-35339CEE7282",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000000",
            "created": "2015-08-12T14:57:19.000Z"
        }
    },
    {
        "resourcename": "version",
        "modulename": "WinEdge2",
        "moduleid": "5B2A78B8-2599-433F-956D-720A12FFCD0B",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000000",
            "created": "2015-08-13T13:54:18.000Z"
        }
    },
    {
        "resourcename": "Measurements",
        "modulename": "WinEdge2",
        "moduleid": "5B2A78B8-2599-433F-956D-720A12FFCD0B",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000000",
            "created": "2015-08-13T13:54:18.000Z"
        }
    }
]

GetModuleResources Endpoint

Returns a list of resources data for a given EMS EdgeModule.

Use the QueryModuleResource method, or the TBackendQuery component and the EdgeModule resource to retrieve the list of resources from an EMS EdgeModule.

If successful, the response from the EMS server provides a list of all resources of an EMS EdgeModule with details about each one of them.

  • resourcename
  • modulename
  • moduleid
  • _meta (creator, created date and updated date fields)
  • Custom fields (optional)

Example Response

This is an example response for the module "5B2A78B8-2599-433F-956D-720A12FFCD0B":

[
    {
        "resourcename": "version",
        "modulename": "WinEdge2",
        "moduleid": "5B2A78B8-2599-433F-956D-720A12FFCD0B",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000000",
            "created": "2015-08-13T13:54:18.000Z"
        }
    },
    {
        "resourcename": "Measurements",
        "modulename": "WinEdge2",
        "moduleid": "5B2A78B8-2599-433F-956D-720A12FFCD0B",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000000",
            "created": "2015-08-13T13:54:18.000Z"
        }
    }
]

GetResourcesFields Endpoint

Retrieves the field names of all resources of all EMS EdgeModules from the EMS database.

Use the RetrieveModuleResourcesFields method to retrieve the fields of the resources from the EMS EdgeModules.

If successful, the response from the EMS server provides all the field names of resources from the EMS EdgeModules.

  • resourcename
  • modulename
  • moduleid
  • _meta (creator, created and updated fields)
  • users

Example Response

This is an example response:

[
    {
        "name": "resourcename"
    },
    {
        "name": "modulename"
    },
    {
        "name": "moduleid"
    },
    {
        "name": "_meta",
        "fields": [
            {
                "name": "creator"
            },
            {
                "name": "created"
            },
            {
                "name": "updated"
            }
        ]
    }
]

GetModuleResource Endpoint

Returns the data of a given resource for an EMS EdgeModule.

Use the RetrieveModuleResource method, or the TBackendQuery component and the EdgeModule resource to retrieve the data of a resource from an EMS EdgeModule.

If successful, the response from the EMS server provides with all the data from resources of an EMS EdgeModule with details about each one of them.

  • resourcename
  • modulename
  • moduleid
  • _meta (creator, created date and updated date fields)
  • Custom fields (optional)

Example Response

This is an example response for the module "5B2A78B8-2599-433F-956D-720A12FFCD0B" and the "version" resource:

{
    "resourcename": "version",
    "modulename": "WinEdge2",
    "moduleid": "5B2A78B8-2599-433F-956D-720A12FFCD0B",
    "_meta": {
        "creator": "00000000-0000-0000-0000-000000000000",
        "created": "2015-08-13T13:54:18.000Z"
    }
}


RegisterModule Endpoint

Registers the given EMS EdgeModule in the EMS Server.

Your request must provide the following fields:

  • modulename
  • protocol
  • protocolprops (port and host)

Use the RegisterModule method, or the TBackendQuery component and the EdgeModule resource to register a new EMS EdgeModule in the EMS Server.

RegisterModuleResource Endpoint

Registers a new resource in the EMS EdgeModule of the EMS Server.

UpdateModule Endpoint

Updates an existing EMS EdgeModule in the EMS Server.

Your request must provide the following field:

  • modulename

Use the UpdateModule method to update the data from an existing EMS EdgeModule in the EMS Server.

UpdateModuleResource Endpoint

Registers an existing resource from an EMS EdgeModule in the EMS Server. Your request must provide the following fields:

  • moduleid
  • resourcename

Use the UpdateModuleResource method to update the resource data from an existing EdgeModule in the EMS Server.

UnregisterModule Endpoint

Deletes and unregisters an existing EMS EdgeModule in the EMS Server.

Your request must provide the following fields:

  • moduleid

Use the UnregisterModule method to delete the data from an existing EMS EdgeModule in the EMS Server.

UnregisterModuleResource Endpoint

Deletes and unregisters the existing resource from an EMS EdgeModule in the EMS Server. Your request must provide the following fields:

  • moduleid
  • resourcename

Use the UnregisterModuleResource method to delete the resource data from an existing EdgeModule in the EMS Server.

GetResourceEndpoint Endpoint

Returns the data from the GET endpoint from an EMS EdgeModule resource.

Example Response

This is an example response for the WinEdge1 module and the Measurements resource:

[
    {
        "device": "heartrate",
        "time": "2015-08-17T15:53:07.075Z",
        "data": {
            "bpm": 68
        }
    },
    {
        "device": "bloodpressure",
        "time": "2015-08-17T15:54:59.015Z",
        "data": {
            "systolic": 115,
            "diastolic": 77
        }
    }
]

GetResourceEndpointItem Endpoint

Returns the data from a specific GET endpoint (specified by the {item} resource suffix) from an EMS EdgeModule resource.

Example Response

This is an example response for the WinEdge1 module, the Measurements resource, and the detailed resource suffix:

[
    {
        "device": "heartrate",
        "time": "2015-08-17T15:53:07.075Z",
        "data": {
            "bpm": {
                "last": 68,
                "mean": 69.9354838709677,
                "stddev": 1.38889605732917
            }
        }
    },
    {
        "device": "bloodpressure",
        "time": "2015-08-17T15:54:59.015Z",
        "data": {
            "diastolic": {
                "last": 77,
                "mean": 76.875,
                "stddev": 1.64208056179609
            },
            "systolic": {
                "last": 115,
                "mean": 117.125,
                "stddev": 1.64208056179609
            }
        }
    }
]

PutResourceEndpoint Endpoint

Updates the data from the resource endpoint from an existing EMS EdgeModule.

Your request must provide the following fields:

  • modulename
  • resourcename

PutResourceEndpointItem Endpoint

Updates the data of a specific endpoint (specified by the {item} resource suffix) from an EMS EdgeModule resource.

Your request must provide the following fields:

  • modulename
  • resourcename
  • Resource Suffix

PostResourceEndpoint Endpoint

Adds new data to the resource endpoint from an existing EMS EdgeModule.

Your request must provide the following fields:

  • modulename
  • resourcename

PostResourceEndpointItem Endpoint

Adds new data to a specific endpoint (specified by the {item} resource suffix) from an EMS EdgeModule resource.

Your request must provide the following fields:

  • modulename
  • resourcename
  • Resource Suffix

PatchResourceEndpoint Endpoint

Requests a set of changes in the data of the resource endpoint from an existing EMS EdgeModule.

Your request must provide the following fields:

  • modulename
  • resourcename

PatchResourceEndpointItem Endpoint

Requests a set of changes in the data of a specific endpoint (specified by the {item} resource suffix) from an EMS EdgeModule resource.

Your request must provide the following fields:

  • modulename
  • resourcename
  • Resource Suffix

DeleteResourceEndpoint Endpoint

Deletes the data of the resource endpoint from an existing EMS EdgeModule.

Your request must provide the following fields:

  • modulename
  • resourcename

DeleteResourceEndpointItem Endpoint

Deletes the data of a specific endpoint (specified by the {item} resource suffix) from an EMS EdgeModule resource

Your request must provide the following fields:

  • modulename
  • resourcename
  • Resource Suffix

EMS EdgeModules Fields

EdgeModules resource in EMS request and responses may include any combination of the following fields:

Item Example Description
"modulename"
"WinEdge1"

EMS EdgeModule name in the EMS database.

"_id"
"34C977F1-4DCE-4412-ACE8-35339CEE7282"

Unique EMS EdgeModule identifier in the EMS database.

"protocol"
"http"

Protocol name that is used for communication between the EMS EdgeModule and the EMS Server.

"protocolprops"
"{
\"port\":8082,
\"host\":\"localhost\"}"
  • Port: Connection port in which the EMS EdgeModule service is listening for request from the EMS Server.
  • Host: Host info where the EMS EdgeModule is running.
"resourcename"
"version"

Name of the resources that extend the EMS EdgeModule functionality.

"moduleid"
"34C977F1-4DCE-4412-ACE8-35339CEE7282"

Unique EMS EdgeModule identifier (_id) that registers the resource.

"_meta"
{
    "creator": "00000000-0000-0000-0000-000000000001",
    "created": "2014-08-20T11:08:56.000Z",
    "updated": "2014-08-20T11:09:56.000Z"
}
  • creator: EMS EdgeModule or EMS EdgeModule resource creator in the EMS database.
  • created: Registration time of the EMS EdgeModule or the EMS EdgeModule resource.
  • updated: Time when the EMS EdgeModule or the EMS EdgeModule resource has been updated.

Custom fields

"myCustomField": "My Custom Field description"

Additional stored information for the EMS EdgeModule.

See Also

Personal tools
In other languages
Previous Versions
Assistance