Skip to content

Commit

Permalink
Added documentation for download status of ddi feedback (#985)
Browse files Browse the repository at this point in the history
* Added documentation for download status of ddi feedback

Signed-off-by: Alexander Dobler <[email protected]>

* Added download status to cancelAction docs

Signed-off-by: Alexander Dobler <[email protected]>

* Fixed some typos in documentation

Signed-off-by: Alexander Dobler <[email protected]>

* Added download status to ddi_api.md and added missing quotation marks

Signed-off-by: Alexander Dobler <[email protected]>

* Added mising of in documentation

Signed-off-by: Alexander Dobler <[email protected]>
  • Loading branch information
dobleralex authored Aug 3, 2020
1 parent f04ca12 commit 5e6d8a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docs/content/apis/ddi_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ DDI `status.execution` type | handling by update server
CANCELED | This is send by the target as confirmation of a cancellation request by the update server. | CANCELED
REJECTED | This is send by the target in case an update of a cancellation is rejected, i.e. cannot be fulfilled at this point in time. Note: the target should send a CLOSED->ERROR if it believes it will not be able to proceed the action at all. | WARNING
CLOSED | Target completes the action either with `status.result.finished` SUCCESS or FAILURE as result. Note: DDI defines also a status NONE which will not be interpreted by the update server and handled like SUCCESS. | ERROR (DDI FAILURE) or FINISHED (DDI SUCCESS or NONE)
DOWNLOAD | This can be used by the target to inform that it is downloading artifacts of the action. | DOWNLOAD
DOWNLOADED | This can be used by the target to inform that it has downloaded artifacts of the action. | DOWNLOADED
PROCEEDING | This can be used by the target to inform that it is working on the action. | RUNNING
SCHEDULED | This can be used by the target to inform that it scheduled on the action. | RUNNING
RESUMED | This can be used by the target to inform that it continued to work on the action. | RUNNING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void setUp() {
}

@Test
@Description("This base resource can be regularly polled by the controller on the provisiong target or device "
@Description("This base resource can be regularly polled by the controller on the provisioning target or device "
+ "in order to retrieve actions that need to be executed. In this case including a config pull request and a deployment. The resource supports Etag based modification "
+ "checks in order to save traffic.")
@WithUser(tenantId = "TENANT_ID", authorities = "ROLE_CONTROLLER", allSpPermissions = true)
Expand All @@ -91,7 +91,7 @@ public void getControllerBaseWithOpenDeplyoment() throws Exception {
}

@Test
@Description("This base resource can be regularly polled by the controller on the provisiong target or device "
@Description("This base resource can be regularly polled by the controller on the provisioning target or device "
+ "in order to retrieve actions that need to be executed. In this case including a config pull request and a cancellation. "
+ "Note: as with deployments the cancel action has to be confirmed or rejected in order to move on to the next action.")
@WithUser(tenantId = "TENANT_ID", authorities = "ROLE_CONTROLLER", allSpPermissions = true)
Expand Down Expand Up @@ -120,8 +120,8 @@ public void getControllerBaseWithOpenDeploymentCancellation() throws Exception {
}

@Test
@Description("The SP server might cancel an operation, e.g. an unfinished update has a sucessor. "
+ "It is up to the provisiong target to decide either to accept the cancelation or reject it.")
@Description("The SP server might cancel an operation, e.g. an unfinished update has a successor. "
+ "It is up to the provisioning target to decide either to accept the cancellation or reject it.")
@WithUser(tenantId = "TENANT_ID", authorities = "ROLE_CONTROLLER", allSpPermissions = true)
public void getControllerCancelAction() throws Exception {
final DistributionSet set = testdataFactory.createDistributionSet("one");
Expand Down Expand Up @@ -187,7 +187,7 @@ public void postCancelActionFeedback() throws Exception {
requestFieldWithPath("status.execution")
.description(DdiApiModelProperties.TARGET_EXEC_STATUS).type("enum")
.attributes(key("value").value(
"['closed', 'proceeding', 'canceled','scheduled', 'rejected', 'resumed']")),
"['closed', 'proceeding', 'download', 'downloaded', 'canceled','scheduled', 'rejected', 'resumed']")),
requestFieldWithPath("status.result")
.description(DdiApiModelProperties.TARGET_RESULT_VALUE),
requestFieldWithPath("status.result.finished")
Expand Down Expand Up @@ -390,7 +390,7 @@ public void postBasedeploymentActionFeedback() throws Exception {
+ DdiRestConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/feedback", tenantAware.getCurrentTenant(),
target.getControllerId(), actionId)
.content(
JsonBuilder.deploymentActionFeedback(actionId.toString(), "closed", "Feddback message"))
JsonBuilder.deploymentActionFeedback(actionId.toString(), "closed", "Feedback message"))
.contentType(MediaType.APPLICATION_JSON_UTF8).accept(MediaTypes.HAL_JSON_VALUE))
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
.andDo(this.document.document(
Expand All @@ -404,7 +404,7 @@ public void postBasedeploymentActionFeedback() throws Exception {
requestFieldWithPath("status.execution")
.description(DdiApiModelProperties.TARGET_EXEC_STATUS).type("enum")
.attributes(key("value").value(
"['closed', 'proceeding', 'canceled','scheduled', 'rejected', 'resumed']")),
"['closed', 'proceeding', 'download', 'downloaded', 'canceled','scheduled', 'rejected', 'resumed']")),
requestFieldWithPath("status.result")
.description(DdiApiModelProperties.TARGET_RESULT_VALUE),
requestFieldWithPath("status.result.finished")
Expand Down

0 comments on commit 5e6d8a0

Please sign in to comment.