Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(REST API)!: Complete rework of REST API & WebUI 'info' page #85

Merged
merged 76 commits into from
Mar 12, 2024

Conversation

Slider0007
Copy link
Owner

@Slider0007 Slider0007 commented Oct 24, 2023

⚠️ Resulting REST API endpoints: /docs/API/REST/_OVERVIEW.md


feat(REST API): Add more content to '/info' (JSON and HTML)

--> Add new content
--> Merge content from existing handler -> reduce APIs to reduce RAM (see chapter breaking changes)

  • JSON: http://{IP}/info
  • HTML: http://{IP}/info?type=xxx
Content JSON + HTML query Replacement for
API Name + Version api_name
Process Status process_status
Processing Interval process_interval
Processing Time process_time
Cycle Counter cycle_counter
MQTT Connection Status mqtt_status
InfluxDBv1 Status influxdbv1_status
InfluxDBv1 Status influxdbv2_status
DataLogging (SD Card) datalogging_sdcard_status
NTP Sync Status ntp_syncstatus
Device Starttime device_starttime /starttime
Device Uptime device_uptime /uptime
WLAN Connection Status wlan_status
WLAN SSID wlan_ssid
WLAN RSSI wlan_rssi /rssi
MAC Address mac_address
Network Configuration network_config
IPv4 Address ipv4_address /sysinfo
Netmask netmask_address
Gateway gateway_address
DNS dns_address
Hostname hostname /sysinfo
Chip Model chip_model
Chip Cores chip_cores
Chip Revision chip_revision
Chip Frequency chip_frequency
Chip Temperature chip_temp /cpu_temperature, /sysinfo
Camera Type camera_type
Camera Frequency camera_frequency
SD Card Name sd_name
SD Card Manufacturer sd_manufacturer
SD Card Capacity sd_capacity
SD Card Sector Size sd_sector_size
SD Card Partition Allocation Size sd_partition_alloc_size
SD Card Partition Size sd_partition_size
SD Card Free Partition Space sd_partition_free
Heap Total Free heap_total_free /heap, /sysinfo
Heap Internal Free heap_internal_free /heap
Heap Internal Largest Free heap_internal_largest_free /heap
Heap Internal Min Free heap_internal_min_free /heap
Heap SPIRAM Free heap_spiram_free /heap
Heap SPIRAM Largest Free heap_spiram_largest_free /heap
Heap SPIRAM Min Free heap_spiram_min_free /heap
Task Info task_info (if compiled only HTML query) /heap
Git Branch git_branch /sysinfo
Git Tag git_tag /sysinfo
Git Revision git_revision /sysinfo
Firmware Version firmware_version /sysinfo
HTML Version html_version /sysinfo
Build Time build_time /sysinfo
ESP-IDF Version idf_version

refactor(REST API): Provide content of '/process_data' as JSON and HTML

--> HTML added to be aligned with other APIs
--> Merge content from existing handler -> reduce APIs to reduce RAM (see chapter breaking changes)

  • JSON: http://{IP}/process_data
  • HTML: http://{IP}/process_data?type=xxx -> Inline
  • HTML: http://{IP}/process_data?type=xxx&sequencename=xxx -> Separated Per Sequence
Content JSON + HTML query Replacement for
API Name + Version api_name
Number of processed seqeunces number_sequences
Timestamp Processed (Inline + Separated Per Sequence) timestamp_processed /json, /value
Timestamp Fallback Value (Inline + Separated Per Sequence) timestamp_fallbackvalue
Actual Value (Inline + Separated Per Sequence) actual_value /json, /value
Fallback Value (Inline + Separated Per Sequence) fallback_value /json, /value
Raw Value (Inline + Separated Per Sequence) raw_value /json, /value
Value Status (Inline + Separated Per Sequence) value_status /json, /value
Rate Per Minute (Inline + Separated Per Sequence) rate_per_minute /json, /value
Rate Per Interval (Inline + Separated Per Sequence) rate_per_interval /json, /value
Process Status process_status
Process Interval process_interval
Process Time process_time
Process State process_state
Process Error process_error
Device Uptime device_uptime
Cycle Counter cycle_counter
WLAN RSSI wlan_rssi

refactor(REST API): Merge existing camera / flashlight APIs to '/camera' (same funtionality)

--> Reduce APIs to reduce RAM

  • HTML: http://{IP}/camera?task=set_parameter&...
  • HTML: http://{IP}/data?task=xxx
  • ...
Content HTML query Replacement for
API Name + Version api_name
Set Camera Parameter set_parameter /editflow?task=test_take
Capture Without Flashlight capture /capture
Capture With Flashlight capture_with_flashlight /capture_with_flashlight
Capture To File capture_to_file /save
Flashlight On flashlight_on /lighton
Flashlight Off flashlight_off /lightoff
Stream Without Flashlight stream /stream
Stream With Flashlight stream_flashlight /stream?flashlight=true

refactor(REST API): Merge logfile and datafile APIs to '/log' + '/data' (same funtionality)

--> Reduce APIs to reduce RAM

  • HTML: http://{IP}/log
  • HTML: http://{IP}/log?type=xxx
Content HTML query Replacement for
API Name + Version api_name
Log File (Tail, 80KB) -N/A- /log
Log File (Complete) full /logfileact
  • HTML: http://{IP}/data
  • HTML: http://{IP}/data?type=xxx
Content HTML query Replacement for
API Name + Version api_name
Data File (Tail, 80KB) -N/A- /data
Data File (Complete) full /datafileact

feat(webui): Add more content to WebUI system 'info' page

--> Visualize complete content of extended '/info' API

refactor(REST API): Date/Time format output according ISO

--> Align date / time output to consistent and international


⚠️ BREKAING CHANGES:

  • refactor(REST API): Remove handler '/starttime' (use /info?type=DeviceStartTime)
  • refactor(REST API): Remove handler '/uptime' (use /info?type=DeviceUptime)
  • refactor(REST API): Remove handler '/rssi' (use '/info?type=WlanRSSI')
  • refactor(REST API): Remove handler '/cputemp' (use '/info?type=ChipTemp')
  • refactor(REST API): Remove handler '/sysinfo' (use elements of '/info' -> column 'Replacement for')
  • refactor(REST API): Remove handler '/heap' (use elements of '/info' -> column 'Replacement for')
  • refactor(REST API): Remove handler '/statusflow' (use /process_data?type=ProcessState)
  • refactor(REST API): Remove handler '/process_error' (use /process_data?type=ProcessError)
  • refactor(REST API): Remove handler '/json' (use elements of '/process_data' -> see column 'Replacement for')
  • refactor(REST API): Remove parts of handler '/value' (use elements of '/process_data' -> see column 'Replacement for') and rename handler to '/recognition_details' (content equal to WebUI page 'Recognition Details'
  • refactor(REST API): Remove handler '/lighton' (use '/camera?type=flashlight_on')
  • refactor(REST API): Remove handler '/lightoff' (use '/camera?type=flashlight_off')
  • refactor(REST API): Remove handler '/capture' (use '/camera?task=capture')
  • refactor(REST API): Remove handler '/capture_with_flashlight' (use '/camera?task=capture_with_flashlight')
  • refactor(REST API): Remove handler '/save' (use '/camera?task=capture_to_file')
  • refactor(REST API): Remove handler '/stream' (use '/camera?task=stream')
  • refactor(REST API): Remove handler '/logfileact' (use '/log?type=full')
  • refactor(REST API): Remove handler '/datafileact' (use '/data?type=full')
  • refactor(REST API): Rename handler '/flow_start' to '/cycle_start'
  • refactor(REST API): Handler '/set_fallbackvalue': Rename query parameter 'numbers' to 'sequence' to be aligned with new wording
    • HTML: http://{IP}/set_fallbackvalue?sequence=xxx --> Retrieve actual fallback value
    • HTML: http://{IP}/set_fallbackvalue?sequence=xxx&value=xxx.xx --> Set new fallback value

feat(webui): Add more content to system info page
refactor(REST API): Provide content of '/heap' as JSON + HTML
refactor(REST API)!: Remove handler starttime (use /info?type=DeviceStartTime)
refactor(REST API)!: Remove handler uptime  (use /info?type=Uptime)
refactor(REST API)!: Remove handler rssi (use /info?type=Uptime)
refactor(REST API)!: Remove handler rssi (use '/info?type=WlanRSSI')
refactor(REST API)!: Remove handler cputemp (use '/info?type=ChipTemp')
refactor(REST API)!: Remove handler sysinfo (use '/info' + '/heap')
refactor(REST API): Align time format (ISO)
Add 'datalogging sdcard' to '/info'
@Slider0007 Slider0007 changed the title feat(REST API): Add more content to '/info' (JSON & HTML) & remove merged REST APIs feat(REST API)!: Add more content to '/info' (JSON & HTML) & remove merged REST APIs Oct 25, 2023
@Slider0007 Slider0007 changed the title feat(REST API)!: Add more content to '/info' (JSON & HTML) & remove merged REST APIs feat(REST API)!: Add more content to '/info' (JSON & HTML) + '/heap' as JSON & HTML Oct 25, 2023
@Slider0007 Slider0007 marked this pull request as draft October 26, 2023 11:50
feat(REST API): Add legacy API by query parameter 'type'
refactor(REST API): Remove chip temp from 'overview' page. It's accessable from 'system' -> 'info' page
@Slider0007 Slider0007 changed the title feat(REST API)!: Add more content to '/info' (JSON & HTML) + '/heap' as JSON & HTML feat(REST API)!: Add more content to '/info' (JSON & HTML) + '/heap' as JSON & HTML + /process_data -> add HTML Nov 3, 2023
@Slider0007 Slider0007 changed the title feat(REST API)!: Add more content to '/info' (JSON & HTML) + '/heap' as JSON & HTML + /process_data -> add HTML feat(REST API)!: Add content to '/info' -> JSON + HTML, refactor '/heap' -> JSON + HTML, refactor '/process_data' -> JSON + HTML Nov 3, 2023
@Slider0007 Slider0007 changed the title feat(REST API)!: Add content to '/info' -> JSON + HTML, refactor '/heap' -> JSON + HTML, refactor '/process_data' -> JSON + HTML feat(REST API)!: Add content to '/info': JSON + HTML, refactor '/heap': JSON + HTML, refactor '/process_data': JSON + HTML Nov 3, 2023
@Slider0007 Slider0007 changed the title feat(REST API)!: Add content to '/info': JSON + HTML, refactor '/heap': JSON + HTML, refactor '/process_data': JSON + HTML feat(REST API)!: Add content to '/info': JSON + HTML | refactor '/heap': JSON + HTML | refactor '/process_data': JSON + HTML Nov 3, 2023
@Slider0007 Slider0007 changed the title feat(REST API)!: Add content to '/info': JSON + HTML | refactor '/heap': JSON + HTML | refactor '/process_data': JSON + HTML feat(REST API)!: Add content to '/info': JSON+HTML | refactor '/heap': JSON+HTML | refactor '/process_data': JSON+HTML Nov 3, 2023
@Slider0007 Slider0007 changed the title feat(REST API)!: Add content to '/info': JSON+HTML | refactor '/heap': JSON+HTML | refactor '/process_data': JSON+HTML feat(REST API)!: Add content to '/info': JSON+HTML | refactor '/heap' and 'process_data': JSON+HTML Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant