JsonProject.loadProfile#
Reads per-bucket load and capacity of resources on the solved baseline of a JsonProject. The project isn't modified. Needs a solved project with no edits applied since the last solve or level. For the load of hypothetical dates, use preview with a profile query instead.
Signature#
options_json: string: string
Synchronous and read-only. Bad input comes back as an error envelope. The call doesn't throw.
Request#
| Argument | Payload | Required | Description |
|---|---|---|---|
options_json |
LoadProfileOptions |
yes | Range, resources, bucket size, task lists and an optional baseline check |
LoadProfileOptions#
The options object for loadProfile. All fields sit at the top level. from and to are required, every other field can be omitted. Unknown fields are rejected with a parse error.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
from |
DateValue |
yes | - | Start of the range. A bucket is included when its start is at or after from |
to |
DateValue |
yes | - | End of the range, exclusive. Must be after from |
resources |
Id[] |
no | all resources, in input order | Resource ids to measure, in the order given |
basis |
"hour" | "day" |
no | derived from config.duration_unit |
Bucket size: "hour" or "day" |
tasks |
string | no | "none" |
Task ids per bucket: "none" (no tasks field), "overallocated" (ids only in buckets with load > capacity, [] elsewhere) or "all" (every booked task) |
baselineId |
string | no | absent (not checked) | Must name the current baseline, or the call fails with stale-baseline |
null on any optional field reads as its default. Dates follow the wire format.
preview takes the same fields as its profile query, a ProfileQuery, except baselineId.
Response#
The success envelope carries a LoadProfile: the basis used and one entry per resource with its buckets. Envelope shape: Wire format.
Errors#
| Kind | Code | When |
|---|---|---|
project |
no-baseline |
The project has never been solved, or apply ran since the last solve |
project |
stale-baseline |
baselineId doesn't name the current baseline |
validation |
null |
to isn't after from, or the range has more than 100 000 buckets per resource (path to); an unknown resource id (path resources); a tasks or basis value outside its list, or an invalid date (path null) |
parse |
null |
Malformed JSON, a missing from or to, or an unknown field |
Example#
Print the overloaded days of a resource that works on two tasks at once, with the tasks that fill them.
const = ;
const = ;
const = new;
options_json (the token comes from the solve result):
Response:
Related#
LoadProfile- the result payloadProfileQuery- the same query as theprofileoption ofpreviewJsonProject.preview- the load of hypothetical datesOverallocation- overload windows in scheduling results- Resource Load - capacity modes and how load is counted