Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/src/content/docs/concepts/api-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ snapshot = vm.getSnapshot().snapshot("before-update", null, true);
```

- Names are those of the API. A `-` in a name becomes `_`: `force-cpu` is `force_cpu`.
- Booleans are `Boolean` and are sent as `1` or `0`.
- Required parameters have primitive types (`int`, `boolean`), the optional ones the wrapper types
(`Integer`, `Boolean`), so that they can be `null`. Booleans are sent as `1` or `0`.
- Parameters that exist with an index (`net0`, `net1`, `scsi0`) are one `Map<Integer, String>`
argument, `netN`, `scsiN`: see [Indexed parameters](/cv4pve-api-java/concepts/indexed-parameters/).
- Type, format and allowed values of each parameter are in the API viewer; the client sends what you
Expand Down
5 changes: 3 additions & 2 deletions docs/src/content/docs/concepts/results.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ var upid = client.getNodes().get("pve01").getQemu().get(100).getStatus().getStar
<Aside type="caution">
`get("name")` returns `null` for a member that Proxmox VE leaves out, and many are optional: for
example `name`, `cores` and `description` in the configuration of a VM, which are not returned when
they have no value or the default one. On a failed call `getData()` itself is `null`. Check
`isSuccessStatusCode()` first, and read optional members with `path`.
they have no value or the default one. On a failed call there is no data: `getData()` is `null` when
the request got no JSON answer, and an empty node, whose `get("name")` returns `null`, when Proxmox VE
answered with an error. Check `isSuccessStatusCode()` first, and read optional members with `path`.
</Aside>

### Optional members
Expand Down
6 changes: 4 additions & 2 deletions docs/src/content/docs/concepts/tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ var finished = client.waitForTaskToFinish(upid, 2000, 600000);

It reads the status of the task at each interval until the task stops, and returns `true` if it
stopped, `false` if it is still running when the time runs out. Set the time to the longest the task
may take: seconds for a start or a snapshot, minutes for a clone, a migration or a backup.
may take: seconds for a start or a snapshot, minutes for a clone, a migration or a backup. An interval
of 0 or less becomes 500 milliseconds, and a time shorter than the interval becomes the interval plus
5 seconds.

<Aside type="caution">
Check `isSuccessStatusCode()` of the call before reading the UPID, as above: a call that failed has
no task, and `getData()` is `null`.
no task, and no data to read the UPID from.
</Aside>

To check without waiting, `taskIsRunning(upid)` returns `true` while the task runs.
Expand Down
Loading