Applications

Info

Gets details about the specified application.

Command: GET
http://localhost/api/v1/applications/<app_name>
Curl example
curl http://localhost/api/v1/applications/my-app \
    --unix-socket /var/run/edge-core/edge-core.sock
Success response example
{
    "container_app_info": {
        "application": {
            "name": "my-app",
            "service": [
                {
                    "current_state": "Running 24 hours ago",
                    "desired_state": "Running",
                    "error_message": "",
                    "id": "fuz7x5vjru8w1li11fhgcixuu",
                    "image": "eh-server",
                    "name": "my-app_app2.1"
                },
                {
                    "current_state": "Running 24 hours ago",
                    "desired_state": "Running",
                    "error_message": "",
                    "id": "aiznk23c3mfpi7ltbk54hx5yp",
                    "image": "ds-server",
                    "name": "my-app_app1.1"
                }
            ],
            "version": ""
        }
    },
    "platform_name": "Docker",
    "platform_version": "Docker version 17.05.0-ce, build 89658be"
}
Unsuccessful response example
{
    "error_message": "application not found: my-appx",
    "status_code": 400
}

Delete

Deletes a deployed application.

Command: DELETE
http://localhost/api/v1/applications/<app_name>
Table 1. Paramater
Field Type Description
app_name String Application name
Curl example
curl http://localhost/api/v1/applications/my-app \
    --unix-socket /var/run/edge-core/edge-core.sock \
    -X DELETE
Table 2. Error 4xx
Name Type Description
error_message String A description of the error encountered
status_code Number Status code for the HTTP request
Error response example
{
    "error_message": "<errorMessage>",
    "status_code": 400
}

Deploy Configuration

Deploys the configuration of an application.

Command: POST
http://localhost/api/v1/applications/<app_name>/configuration
Table 3. Parameters
Field Type Description
app_name String Application name
file String Application configuration file
Curl example
curl http://localhost/api/v1/applications/my-app/configuration \
    --unix-socket /var/run/edge-core/edge-core.sock \
    -X POST \
    -F "file=@/mnt/data/downloads/my-app-config.zip"
Success response example
{
    "app_config_deploy": "App configuration deployment successful."
}
Error response example
{
  "error_message": "Application with id my-app does not exist.
   Unable to deploy configs.",
  "status_code": 400
}

Deploy Application

Deploys an application.

Command: POST
http://localhost/api/v1/applications
Table 4. Parameters
Field Type Description
app_name String Application name
file_name String Name of the application deployment file
Curl example
curl http://localhost/api/v1/applications \
    --unix-socket /var/run/edge-core/edge-core.sock \
    -X POST \
    -F "file=@<file_name>" \
    -H "app_name: my_app"
Success response example
{
    "app_deploy": "Application deployment successful."
}
Error response example
{
  "error_message": "gzip: stdin: unexpected end of file tar:
   Child returned status 1 tar: Error is not recoverable:
   exiting now",
  "status_code": 400
}

Get List

Gets a list of applications.

Command: GET
http://localhost/api/v1/applications
Curl example
curl http://localhost/api/v1/applications \
    --unix-socket /var/run/edge-core/edge-core.sock
Success response example
{
    "applications": [
        "my-app",
        "web-server",
        "database"
    ]
}
Table 5. Error 4xx
Field Type Description
error_message String A description of the error encountered
status_code Number Status code for the HTTP request
Error response example
{
    "error_message": "<errorMessage>",
    "status_code": 400
}

Start an Application

Starts an application.

Command: POST
http://localhost/api/v1/applications/<app_name>/start
Table 6. Parameter
Field Type Description
app_name String Application name
Curl example
curl http://localhost/api/v1/applications/my-app/start \
    --unix-socket /var/run/edge-core/edge-core.sock \
    -X POST
Table 7. Error 4xx
Field Type Description
error_message String A description of the error encountered
status_code Number Status code for the HTTP request
Error response example
{
    "error_message": "<errorMessage>",
    "status_code": 400
}

Stop an Application

Stops an application.

Command: POST
http://localhost/api/v1/applications/<app_name>/stop
Table 8. Parameter
Field Type Description
app_name String Application name
Curl example
curl http://localhost/api/v1/applications/my-app/stop \
    --unix-socket /var/run/edge-core/edge-core.sock \
    -X POST
Table 9. Error 4xx
Field Type Description
error_message String A description of the error encountered
status_code Number Status code for the HTTP request
Error response example
{
    "error_message": "<errorMessage>",
    "status_code": 400
}