# ApiParcel Data Model

A Parcel encapsulate a specific product and version. For example, (CDH 4.1). A parcel is downloaded, distributed to all the machines of a cluster and then allowed to be activated.

> The available parcels are determined by which cluster they will be running on. For example, a SLES parcel won't show up for a RHEL cluster.

Properties
name | data type | description
--- | --- | ---
product | string | The name of the product, e.g. CDH, Impala
version | string | The version of the product, e.g. 1.1.0, 2.3.0.

stage

string

Returns the current stage of the parcel.

There are a number of stages a parcel can be in. There are two types of stages - stable and transient. A parcel is in a transient stage when it is transitioning between two stable stages. The stages are listed below with some additional information.

- AVAILABLE_REMOTELY: Stable stage - the parcel can be downloaded to the server.
- DOWNLOADING: Transient stage - the parcel is in the process of being downloaded to the server.
- DOWNLOADED: Stable stage - the parcel is downloaded and ready to be distributed or removed from the server.
- DISTRIBUTING: Transient stage - the parcel is being sent to all the hosts in the cluster.
- DISTRIBUTED: Stable stage - the parcel is on all the hosts in the cluster. The parcel can now be activated, or removed from all the hosts.
- UNDISTRIBUTING: Transient stage - the parcel is being removed from all the hosts in the cluster>
- ACTIVATING: Transient stage - the parcel is being activated on the hosts in the cluster. New in API v7
- ACTIVATED: Steady stage - the parcel is set to active on every host in the cluster. If desired, a parcel can be deactivated from this stage.

state | ApiParcelState | The state of the parcel. This shows the progress of state transitions and if there were any errors.
clusterRef | ApiClusterRef | Readonly. A reference to the enclosing cluster.
displayName | string | Read-only. Display name of the parcel. If set, available since v40.
description | string | Read-only. Description of the parcel. If set, available since v40.

Example

    {
      "product" : "...",
      "version" : "...",
      "stage" : "...",
      "state" : {
        "progress" : 12345,
        "totalProgress" : 12345,
        "count" : 12345,
        "totalCount" : 12345,
        "errors" : [ "...", "..." ],
        "warnings" : [ "...", "..." ]
      },
      "clusterRef" : {
        "clusterName" : "...",
        "displayName" : "..."
      },
      "displayName" : "...",
      "description" : "..."
    }