Added documentation for download status of ddi feedback (#985)

* Added documentation for download status of ddi feedback

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Added download status to cancelAction docs

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Fixed some typos in documentation

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

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

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Added mising of in documentation

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>
This commit is contained in:
Alexander Dobler
2020-08-03 13:14:41 +02:00
committed by GitHub
parent f04ca12566
commit 5e6d8a03fc
2 changed files with 9 additions and 7 deletions

View File

@@ -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 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 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) 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 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 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 RESUMED | This can be used by the target to inform that it continued to work on the action. | RUNNING

View File

@@ -64,7 +64,7 @@ public class RootControllerDocumentationTest extends AbstractApiRestDocumentatio
} }
@Test @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 " + "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.") + "checks in order to save traffic.")
@WithUser(tenantId = "TENANT_ID", authorities = "ROLE_CONTROLLER", allSpPermissions = true) @WithUser(tenantId = "TENANT_ID", authorities = "ROLE_CONTROLLER", allSpPermissions = true)
@@ -91,7 +91,7 @@ public class RootControllerDocumentationTest extends AbstractApiRestDocumentatio
} }
@Test @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. " + "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.") + "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) @WithUser(tenantId = "TENANT_ID", authorities = "ROLE_CONTROLLER", allSpPermissions = true)
@@ -120,8 +120,8 @@ public class RootControllerDocumentationTest extends AbstractApiRestDocumentatio
} }
@Test @Test
@Description("The SP server might cancel an operation, e.g. an unfinished update has a sucessor. " @Description("The SP server might cancel an operation, e.g. an unfinished update has a successor. "
+ "It is up to the provisiong target to decide either to accept the cancelation or reject it.") + "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) @WithUser(tenantId = "TENANT_ID", authorities = "ROLE_CONTROLLER", allSpPermissions = true)
public void getControllerCancelAction() throws Exception { public void getControllerCancelAction() throws Exception {
final DistributionSet set = testdataFactory.createDistributionSet("one"); final DistributionSet set = testdataFactory.createDistributionSet("one");
@@ -187,7 +187,7 @@ public class RootControllerDocumentationTest extends AbstractApiRestDocumentatio
requestFieldWithPath("status.execution") requestFieldWithPath("status.execution")
.description(DdiApiModelProperties.TARGET_EXEC_STATUS).type("enum") .description(DdiApiModelProperties.TARGET_EXEC_STATUS).type("enum")
.attributes(key("value").value( .attributes(key("value").value(
"['closed', 'proceeding', 'canceled','scheduled', 'rejected', 'resumed']")), "['closed', 'proceeding', 'download', 'downloaded', 'canceled','scheduled', 'rejected', 'resumed']")),
requestFieldWithPath("status.result") requestFieldWithPath("status.result")
.description(DdiApiModelProperties.TARGET_RESULT_VALUE), .description(DdiApiModelProperties.TARGET_RESULT_VALUE),
requestFieldWithPath("status.result.finished") requestFieldWithPath("status.result.finished")
@@ -390,7 +390,7 @@ public class RootControllerDocumentationTest extends AbstractApiRestDocumentatio
+ DdiRestConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/feedback", tenantAware.getCurrentTenant(), + DdiRestConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/feedback", tenantAware.getCurrentTenant(),
target.getControllerId(), actionId) target.getControllerId(), actionId)
.content( .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)) .contentType(MediaType.APPLICATION_JSON_UTF8).accept(MediaTypes.HAL_JSON_VALUE))
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
.andDo(this.document.document( .andDo(this.document.document(
@@ -404,7 +404,7 @@ public class RootControllerDocumentationTest extends AbstractApiRestDocumentatio
requestFieldWithPath("status.execution") requestFieldWithPath("status.execution")
.description(DdiApiModelProperties.TARGET_EXEC_STATUS).type("enum") .description(DdiApiModelProperties.TARGET_EXEC_STATUS).type("enum")
.attributes(key("value").value( .attributes(key("value").value(
"['closed', 'proceeding', 'canceled','scheduled', 'rejected', 'resumed']")), "['closed', 'proceeding', 'download', 'downloaded', 'canceled','scheduled', 'rejected', 'resumed']")),
requestFieldWithPath("status.result") requestFieldWithPath("status.result")
.description(DdiApiModelProperties.TARGET_RESULT_VALUE), .description(DdiApiModelProperties.TARGET_RESULT_VALUE),
requestFieldWithPath("status.result.finished") requestFieldWithPath("status.result.finished")