diff --git a/src/configuration/config_template.toml b/src/configuration/config_template.toml index 6b8de63..4ebfea4 100644 --- a/src/configuration/config_template.toml +++ b/src/configuration/config_template.toml @@ -29,7 +29,6 @@ airflow = "Front to rear" # Direction of airflow # rack = 0 # ID of the rack the device is mounted in if any # position = 0 # Position of the device within the rack if any - # TODO # Custom parameters about the system, which fall under the "custom_fields" section. diff --git a/src/publisher/translator.rs b/src/publisher/translator.rs index 0891ed7..2e04cf3 100644 --- a/src/publisher/translator.rs +++ b/src/publisher/translator.rs @@ -12,11 +12,32 @@ use crate::{configuration::config_parser::ConfigData, Machine}; /// Translate the machine information to a `WritableDeviceWithConfigContextRequest` required by /// NetBox's API. +/// +/// # Parameters +/// +/// - `machine: &Machine` - Collected information about the device +/// - `config_data: ConfigData` - Additional information about the device provided by config file +/// or CLI +/// +/// # Returns +/// +/// - `device: WritableDeviceWithConfigContextRequest` - Payload for machine creation request pub fn information_to_device( machine: &Machine, config_data: ConfigData, ) -> WritableDeviceWithConfigContextRequest { - todo!() +// let device: WritableDeviceWithConfigContextRequest = WritableDeviceWithConfigContextRequest { +// name: Some(config_data.system.name), +// device_type: config_data.system.device_type, +// role: config_data.system.device_role, +// tenant: config_data.system.tenant, +// }; +// device +todo!() +} + +fn get_platform_id(machine: &Machine) -> Option { + todo!("Get platform by name an return platform id!") } pub fn information_to_vm(machine: &Machine) -> WritableVirtualMachineWithConfigContextRequest {