mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-05-05 09:16:34 -04:00
include ids in api responses for debugging
This commit is contained in:
parent
3de605be6c
commit
30d5807dd3
@ -87,6 +87,9 @@ The `application/json` response will have a dict as follows:
|
|||||||
to divide recordings into days as described further below.
|
to divide recordings into days as described further below.
|
||||||
* `cameras`: a list of cameras. Each is a dict as follows:
|
* `cameras`: a list of cameras. Each is a dict as follows:
|
||||||
* `uuid`: in text format
|
* `uuid`: in text format
|
||||||
|
* `id`: an integer. The client doesn't ever need to send the id
|
||||||
|
back in API requests, but camera ids are helpful to know when debugging
|
||||||
|
by reading logs or directly examining the filesystem/database.
|
||||||
* `shortName`: a short name (typically one or two words)
|
* `shortName`: a short name (typically one or two words)
|
||||||
* `description`: a longer description (typically a phrase or paragraph)
|
* `description`: a longer description (typically a phrase or paragraph)
|
||||||
* `config`: (only included if request parameter `cameraConfigs` is true)
|
* `config`: (only included if request parameter `cameraConfigs` is true)
|
||||||
@ -96,6 +99,10 @@ The `application/json` response will have a dict as follows:
|
|||||||
* `onvif_host`
|
* `onvif_host`
|
||||||
* `streams`: a dict of stream type ("main" or "sub") to a dictionary
|
* `streams`: a dict of stream type ("main" or "sub") to a dictionary
|
||||||
describing the stream:
|
describing the stream:
|
||||||
|
* `id`: an integer. The client doesn't ever need to send the id
|
||||||
|
back in API requests, but stream ids are helpful to know when
|
||||||
|
debugging by reading logs or directly examining the
|
||||||
|
filesystem/database.
|
||||||
* `retainBytes`: the configured total number of bytes of completed
|
* `retainBytes`: the configured total number of bytes of completed
|
||||||
recordings to retain.
|
recordings to retain.
|
||||||
* `minStartTime90k`: the start time of the earliest recording for
|
* `minStartTime90k`: the start time of the earliest recording for
|
||||||
|
@ -56,6 +56,7 @@ impl Session {
|
|||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Camera<'a> {
|
pub struct Camera<'a> {
|
||||||
pub uuid: Uuid,
|
pub uuid: Uuid,
|
||||||
|
pub id: i32,
|
||||||
pub short_name: &'a str,
|
pub short_name: &'a str,
|
||||||
pub description: &'a str,
|
pub description: &'a str,
|
||||||
|
|
||||||
@ -77,6 +78,7 @@ pub struct CameraConfig<'a> {
|
|||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct Stream<'a> {
|
pub struct Stream<'a> {
|
||||||
|
pub id: i32,
|
||||||
pub retain_bytes: i64,
|
pub retain_bytes: i64,
|
||||||
pub min_start_time_90k: Option<Time>,
|
pub min_start_time_90k: Option<Time>,
|
||||||
pub max_end_time_90k: Option<Time>,
|
pub max_end_time_90k: Option<Time>,
|
||||||
@ -186,6 +188,7 @@ impl<'a> Camera<'a> {
|
|||||||
) -> Result<Self, Error> {
|
) -> Result<Self, Error> {
|
||||||
Ok(Camera {
|
Ok(Camera {
|
||||||
uuid: c.uuid,
|
uuid: c.uuid,
|
||||||
|
id: c.id,
|
||||||
short_name: &c.short_name,
|
short_name: &c.short_name,
|
||||||
description: &c.description,
|
description: &c.description,
|
||||||
config: match include_config {
|
config: match include_config {
|
||||||
@ -238,6 +241,7 @@ impl<'a> Stream<'a> {
|
|||||||
.get(&id)
|
.get(&id)
|
||||||
.ok_or_else(|| format_err!("missing stream {}", id))?;
|
.ok_or_else(|| format_err!("missing stream {}", id))?;
|
||||||
Ok(Some(Stream {
|
Ok(Some(Stream {
|
||||||
|
id: s.id,
|
||||||
retain_bytes: s.retain_bytes,
|
retain_bytes: s.retain_bytes,
|
||||||
min_start_time_90k: s.range.as_ref().map(|r| r.start),
|
min_start_time_90k: s.range.as_ref().map(|r| r.start),
|
||||||
max_end_time_90k: s.range.as_ref().map(|r| r.end),
|
max_end_time_90k: s.range.as_ref().map(|r| r.end),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user