SpecificationMargo management interface

Deployment Status

While applying a new desired state, the device's management client MUST provide the Workload Fleet Manager service with an indication of the current workload deployment status. This is done by calling the Device API's deployment status endpoint.

  • Requests to this endpoint MUST be authenticated using the HTTP Message Signature method as defined in the Payload Security section.

Note: This assumes consistent connection to the WFM, we will address intermittent or extended disconnection scenarios in the future.

Route and HTTP Methods

POST /api/v1/clients/{clientId}/deployments/{deploymentId}/status

Route Parameters

ParameterTypeRequired?Description
{clientId}stringYThe unique identifier of the (device) client registered with the WFM during onboarding.
{deploymentId}stringYThe UUID of the ApplicationDeployment YAML being reported.

Response Codes

CodeDescription
200 OKThe deployment status was added, or updated, successfully.
400 Bad RequestMissing or invalid content-digest header. Ensure the SHA256 hash of the base64-encoded payload is included.
401 UnauthorizedSignature verification failed. Ensure you are signing with the correct X.509 private key.
403 ForbiddenClient certificate is not trusted or has been revoked.
422 Unprocessable ContentRequest body includes a semantic error.

Request Body Attributes

FieldsTypeRequired?Description
apiVersionstringYIdentifier of the version the API resource follows.
kindstringYMust be DeploymentStatusManifest.
deploymentIdstringYThe unique identifier UUID of the deployment specification. Needs to be assigned by the Workload Fleet Management Software.
deviceIdstringN*Id of the device hosting the deployment. Includes the full device hierarchy if applicable. * This attribute is required when reporting on behalf of a child-device.
status[]statusYElement that defines overall deployment status. See the Status Attributes section below.
components[]componentsYElement that defines the individual component's deployment status. See the Component Attributes section below.

Status Attributes

FieldsTypeRequired?Description
statestringYCurrent state of the overall deployment. The state value MUST be one the following options: pending, installing, installed, removing, removed, failed. The overall deployment status MUST reflect the most severe of the components states, following this precedence: failed > removing > installing > pending > removing > installed.
errorErrorNElement that defines the overall installation error if one occured. See the Error Attributes section below.

Component Attributes

AttributeTypeRequired?Description
namestringYName of the deployment component, inherited via the deployment specification
statestringYThe component's current deployment state of the component. MUST be one of the following options: pending, installing, installed, removing, removed, failed
errorErrorNElement that defines the components installation error if one occured. See the Error Attributes section below.

Note: The components array MUST contain one entry for each "component" defined in the referenced ApplicationDeployment manifest.

Error Attributes

FieldsTypeRequired?Description
codestringYAssociated error code following a component failure during installation.
sourcestringYIdentifies the source of the error. It is set to the device id, with its full hierarchy if applicable, of the device generating the error, or to the component name of the component generating the error.
messagestringYAssociated error message that provides further details to the WFM about the error that was encountered.

When the error is generated by a see-thru gateway, the source attribute of the error structure MUST be set to the gateway device id, with its full hierachy if applicable.

When the error is not generated by a see-thru gateway, the source of the status.error attribute MUST be set to the name of the deployment as defined in the metadata.name attribute of the application deployment manifest.

When the error is not generated by a see-thru gateway, the source of the components.error attribute MUST be set to the name of the component as defined in the components[].name for that component.

Note: Most error codes and messages are implementation-specific. The purpose of the source attribute is to avoid collision between reserved error codes and implementation-specific error codes.

Reserved codes for gateway-generated errors:
Error CodeMessageSourceDescription
101Unknown child device IDId of the gatewayThe gateway cannot identify the child device with the given ID.
102Child device unreachableId of the gatewayThe gateway cannot establish a connection with the child device.
103Autonomous placement not supportedId of the gatewayThe gateway is not capable of autonomously selecting the child-device for the deployment.

When the error used is a reserved code for a gateway-generated error, the source attribute MUST be set to the id of the gateway, with its full hierachy if applicable.

Example Deployment Status Manifest Request

{
    "apiVersion": "deployment.margo.org/v1alpha1",
    "kind": "DeploymentStatusManifest",
    "deploymentId": "a3e2f5dc-912e-494f-8395-52cf3769bc06",
    "deviceId": "plant-alfa-zone1-edge01",
    "status": {
        "state": "pending",
        "error": {
            "code": "",
            "source": "",
            "message": ""
        }
    },
    "components": [
        {
            "name": "digitron-orchestrator",
            "state": "pending",
            "error": {
                "code":"",
                "source": "",
                "message":""
            }
        },
        {
            "name": "database-services",
            "state": "pending",
            "error": {
                "code": "",
                "source": "",
                "message": ""
            }
        }
    ]
}