# ApiParcelState Data Model

The ApiParcelState encapsulates the state of a parcel while it is in transition and reports any errors that may have occurred..

The complete progress of a parcel is broken up into two different reporting indicators - progress and count. Progress is the primary indicator that reports the global state of transitions. For example, when downloading, progress and totalProgress will show the current number of bytes downloaded and the total number of bytes needed to be downloaded respectively.

The count and totalCount indicator is used when a state transition affects multiple hosts. The count and totalCount show the current number of hosts completed and the total number of hosts respectively. For example, during distribution, the progress and totalProgress will show how many bytes have been transferred to each host and the count will indicate how many hosts of of totalCount have had parcels unpacked.

Along with the two progress indicators, the ApiParcelState shows both errors and warnings that may have turned up during a state transition.

Properties
name | data type | description
--- | --- | ---
progress | number | The progress of the state transition.
totalProgress | number | The total amount that getProgress needs to get to.
count | number | The current hosts that have completed.
totalCount | number | The total amount that getCount needs to get to.
errors | array of string | The errors that exist for this parcel.
warnings | array of string | The warnings that exist for this parcel.

Example

    {
      "progress" : 12345,
      "totalProgress" : 12345,
      "count" : 12345,
      "totalCount" : 12345,
      "errors" : [ "...", "..." ],
      "warnings" : [ "...", "..." ]
    }