Newer
Older
smart-home-server / server / SHServ / Routes / FirmwareRESTAPI_v1.php
<?php

namespace SHServ\Routes;

trait FirmwareRESTAPI_v1 {
	protected function firmware_restapi_uri_routes() {
		$this->router->uri("/api/v1/firmwares",                     "{$this->cn}\\FirmwareRESTAPIController@firmwares_list");
		$this->router->uri('/api/v1/firmwares/id/$firmware_id',      "{$this->cn}\\FirmwareRESTAPIController@firmware_detail");
		$this->router->uri('/api/v1/firmwares/id/$firmware_id/download', "{$this->cn}\\FirmwareRESTAPIController@firmware_download");
		$this->router->uri('/api/v1/devices/id/$device_id/firmware-compatibility', "{$this->cn}\\FirmwareRESTAPIController@device_firmware_compatibility");
	}

	protected function firmware_restapi_post_routes() {
		$this->router->post(
			[],
			"{$this->cn}\\FirmwareRESTAPIController@firmware_refresh",
			"/api/v1/firmwares/refresh"
		);

		$this->router->post(
			["device_id", "firmware_id"],
			"{$this->cn}\\FirmwareRESTAPIController@device_update_firmware",
			"/api/v1/devices/update-firmware"
		);
	}

	protected function firmware_restapi_get_routes() {
	}
}