stormc b69bedd8f9 DDI API: Extend API response to report previous update execution status. (#506)
* DDI API: Limit number of feedback messages for an action status.

Even though the number of ActionStatus entries are limited to 1000 per
action using QuotaManagement, there is no limit on the number of
messages that can be sent as part of a single ActionStatus. This allows
a controller to potentially send large number of messages for a single
action.

Limiting the number of allowed messages to 50 using the
javax.validation.constraints.Size within DdiStatus.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
Signed-off-by: Himanshu Kumar Singh <himanshu.singh@siemens.com>
Signed-off-by: Raju HS <raju.hs@siemens.com>

* DDI API: Extend API response to retrieve controller feedback. (#381)

Resolves #381

The mechanism is useful for example, when the client software running on
the device loses this information prior to reporting a final execution
status such as 'closed' to hawkBit. This may happen, e.g., due to a
power cycle or simply a crash. Upon the client software restarting, it
installs the same payload again as advertised by hawkBit (as the device
has not sent a final update execution status). Instead, if the last
feedback sent to hawkBit would be reported back to the device, the
client may resume installation.

Feedback messages sent as part of POST
    /{tenant}/controller/v1/{targetid}/deploymentBase/{actionId}/feedback,
are sent back to controller as part of response to GET
    /{tenant}/controller/v1/{targetid}/deploymentBase/{actionId}.

Following example illustrates the API changes:

1. After retrieving the action from server, controller starts download
and sends a feedback.
curl
'http://127.0.0.1:8080/default/controller/v1/1/deploymentBase/1/feedback'
-i -X POST -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept:
application/hal+json' -d '{
  "id" : "1",
  "time" : "20170406T121500",
  "status" : {
    "result" : {
      "progress" : {
        "of" : 1,
        "cnt" : 0
      },
      "finished" : "none"
    },
    "execution" : "proceeding",
    "details" : [ "proceeding with download" ]
  }
}'

2. Once artifact download has finished, controller sends another
feedback.
curl
'http://127.0.0.1:8080/default/controller/v1/1/deploymentBase/1/feedback'
-i -X POST -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept:
application/hal+json' -d '{
{
  "id" : "1",
  "time" : "20170406T123000",
  "status" : {
    "result" : {
      "progress" : {
        "of" : 1,
        "cnt" : 0
      },
      "finished" : "none"
    },
    "execution" : "proceeding",
    "details" : [ "downloaded artifacts for update" ]
  }
}'

3. If there is a power outage now, the controller can retrieve the
messages posted earlier from the action history when it restarts again.
curl
'http://127.0.0.1:8080/default/controller/v1/1/deploymentBase/1?c=411599879&actionHistory=-1'
-i -H 'Accept: application/hal+json'

Response will be like below
{
  "id": "1",
  "deployment": {
    "download": "forced",
    "update": "forced",
    "chunks": [
      {
      "part": "os",
      "version": "1",
      "name": "1",
      "artifacts": [....],
      }
    ],
  },
  "actionHistory": {
    "status": "RETRIEVED",
    "messages": [
      "downloaded artifacts for update",
      "proceeding with download"
    ]
  }
}

4. Based on the feedback messages, controller may be able to skip the
download and resume with installation and send additional feedback.
curl
'http://127.0.0.1:8080/default/controller/v1/1/deploymentBase/1/feedback'
-i -X POST -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept:
application/hal+json' -d '{
  "id" : "1",
  "time" : "20170406T121314",
  "status" : {
    "result" : {
      "progress" : {
        "of" : 1,
        "cnt" : 0
      },
      "finished" : "none"
    },
    "execution" : "resumed",
    "details" : [ "resuming installation based on previous feedback,
download skipped" ]
  }
}'

Note: The maximum number of messages to be retrieved from the database
by a controller is limited to 100. The actionHistory parameter's value
has the following meaning:

Input Value         | Output
-----------------------------
  <0                | Retrieve maximum allowed number of messages from
                    | action history.
  unspecified or =0 | Do not retrieve any message (default).
  >0                | Retrieve specified number of messages, limited by
                    | maximum allowed number.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
Signed-off-by: Himanshu Kumar Singh <himanshu.singh@siemens.com>
Signed-off-by: Raju HS <raju.hs@siemens.com>
2017-06-06 08:26:01 +02:00
2017-02-07 09:57:57 +01:00
2016-07-20 16:51:01 +02:00
2015-11-09 14:19:06 -05:00
2016-05-18 15:24:28 +02:00
2017-05-13 16:55:50 +02:00
2017-03-18 17:47:59 +01:00

Eclipse hawkBit™ - Update Server

Eclipse hawkBit is an domain independent back end solution for rolling out software updates to constrained edge devices as well as more powerful controllers and gateways connected to IP based networking infrastructure.

Build: Circle CI Codacy Badge SonarQuality Maven Central

Documentation

see hawkBit Documentation

Contact us

  • Want to chat with the team behind hawkBit? Join the chat at https://gitter.im/eclipse/hawkbit
  • Having issues with hawkBit? Open a GitHub issue.
  • You can also check out our Project Homepage for further contact options.

hawkBit sandbox

We offer a sandbox installation that is free for everyone to try out hawkBit. However, keep in mind that the sandbox database will be reset from time to time. It is also not possible to upload any artifacts into the sandbox. But you can use it to try out the Management UI, Management API and DDI API.

https://hawkbit.eu-gb.mybluemix.net/UI/

Device Integration

hawkBit does not provide off the shelf clients for devices as part of the project. The long term goal is to provide an Eclipse hono integration which will provide connectivity through various IoT protocols and as a result allows a wide range of clients to connect to hawkBit. However, the hawkBit Direct Device Integration (API) API is HTTP/JSon based which should allow any update client to integrate quite easily.

There are clients outside of the Eclipse IoT eco system as well, e.g.:

  • SWupdate which is a Linux Update agent with focus on a efficient and safe way to update embedded systems.

Getting Started

We are providing a Spring Boot based reference Update Server including embedded H2 DB for test and evaluation purposes. Run with docker:

$  docker run -d -p 8080:8080 hawkbit/hawkbit-update-server

Open the update server in your browser:

localhost:8080

See below for how to build and run the update server on your own. In addition we have a guide for setting up a complete landscape.

hawkBit (Spring boot) starters

Next to the Update Server we are also providing a set of Spring Boot Starters to quick start your own Spring Boot based application.

Clone, build and run hawkBit

Build

$ git clone https://github.com/eclipse/hawkbit.git
$ cd hawkbit
$ mvn clean install

Start hawkBit Update Server

$ java -jar ./hawkbit-runtime/hawkbit-update-server/target/hawkbit-update-server-#version#.jar

Start hawkBit Device Simulator (optional)

$ java -jar ./examples/hawkbit-device-simulator/target/hawkbit-device-simulator-#version#.jar

Generate getting started data with the Management API example (optional)

$ java -jar ./examples/hawkbit-example-mgmt-simulator/target/hawkbit-example-mgmt-simulator-#version#.jar

Releases and Roadmap

  • In the upcoming release 0.2:
    • Rollout management for large scale update campaigns.
    • Clustering capabilities for the update server.
    • Upgrade of Spring Boot and Vaadin dependencies (Boot 1.4, Vaadin 7.7).
    • Improvements on modularization and customizability based on Spring's auto-configuration mechanism.
    • Provide Spring Boot Starters for custom apps based on hawkBit.
    • Provide standard runtime by means of Spring Boot based hawkBit update server (and hopefully a docker image).
    • And of course tons of usability improvements and bug fixes.
  • Future releases
    • Complete repository refactoring.
    • Integrate with Eclipse hono as DMF provider.
    • Flexible DMF messaging infrastructure (e.g. with Spring Cloud Stream).
    • Migrate to Spring Framework 5, Spring Boot 2 and Vaadin 8
    • Re-evaluate JPA as persistence provider (e.g. look into jOOQ)

Status and API stability

hawkBit is currently in '0.X' semantic version. That is due to the need that there is still content in hawkBit that is in need for refactoring. That includes the maven module structure, Spring Boot Properties, Spring Boot auto configuration as well as internal Java APIs (e.g. the repository API ).

However, the device facing DDI API is on major version 'v1' and will be kept stable.

Server facing and DMF API are Management API are on v1 as well. However, we cannot fully guarantee the same stability during hawkBit's 0.X development but we will try as best we can.

Description
No description provided
Readme EPL-2.0 47 MiB
Languages
Java 98.4%
Python 1.2%
Shell 0.3%