Running an edge service

Prev Next

To run an edge service, make the following POST request with the request body parameters:

NameTypeRequired or optionalDescription

name

string

Required

Name of your service.

services

object

Required

Podspec for your service.

networks

array

Required

Network to which this service will connect.

If the network for this service is configured to use dynamic service addressing (default), then the node allocates an IP address dynamically for the service. If the network is configured to use static service addressing, also specify the static IP address for the service.

node_id

string

Required

ID of your Edge Node where this service will run.


curl -X POST \
  -H 'X-API-KEY:<your_api_key>' \
  -H "Content-type:application/json" \
  -d '{"name":"<your_service_name>", \
       "services":[<your_service_podspec>], \
       "networks":[{"network_id":"<your_edge_inode_network_id>","ip_address":""}], \
       "node_id":"<your_edge_inode_id>"}' \
  'https://<your_company>.manage.iotium.io/api/v1/service' \
  | jq '{pod_id:.id, name:.name}'

The response includes the name and ID of the service:

{
  "pod_id": "<your_service_id>",
  "name": "<your_service_name>"
}

To run an edge service attached to multiple networks, make the following request:

curl -X POST \
  -H 'X-API-KEY:<your_api_key>' \
  -H "Content-type:application/json" \
  -d '{"name":"<your_service_name>", \
       "services":[<your_service_podspec>], \
       "networks":[{"network_id":"<your_edge_inode_network_id_1>","ip_address":""}, {"network_id":"<your_edge_inode_network_id_2>","ip_address":""},
{"network_id":"<your_edge_inode_network_id_3>","ip_address":""}], \
       "node_id":"<your_edge_inode_id>"}' \
  'https://<your_company>.manage.iotium.io/api/v1/service' \
  | jq '{pod_id:.id, name:.name}'

The response includes the name and ID of the service:

{
  "pod_id": "<your_service_id>",
  "name": "<your_service_name>"
}