Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteOtter committed Apr 25, 2024
1 parent 0f89b21 commit 29600fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/publisher/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ extern crate thanix_client;

use reqwest::{blocking::Client, Error as ReqwestError};
use thanix_client::{
paths::{dcim_devices_create, dcim_interfaces_create, DcimDevicesCreateResponse},
paths::{
dcim_devices_create, dcim_interfaces_create, DcimDevicesCreateResponse,
DcimInterfacesCreateResponse,
},
types::{WritableDeviceWithConfigContextRequest, WritableInterfaceRequest},
util::ThanixClient,
};
Expand Down
11 changes: 10 additions & 1 deletion src/publisher/translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ pub fn information_to_interface(
/// # Returns
///
/// Returns `Some(i64)` if the specified platform exists, else returns `None`.
///
/// # Aborts
///
/// If the netBox connection fails, this may terimnate the process.
fn get_platform_id(state: &ThanixClient, platform_name: String) -> Option<i64> {
println!("Searching for id of platform '{}' ... ", platform_name);
let platform_list: Vec<Platform>;
Expand Down Expand Up @@ -260,13 +264,18 @@ fn get_platform_id(state: &ThanixClient, platform_name: String) -> Option<i64> {
/// The function will retrieve a list of IPv4 Adresses from NetBox,
/// then search this list for the IP Adress Nazara collected.
///
/// The "primary_network_interface" paramter specified in the `nazara_config.toml`
/// The `primary_network_interface` paramter specified in the `nazara_config.toml`
/// will be used to specify which adress to search for.
///
/// # Parameters
///
/// * state: `&ThanixClient` - The client required for making API requests.
/// * machine: `&Machine` - The collected machine information.
///
/// # Returns
///
/// Returns the ID of the IP address object `i64` if a match has been found.
/// Else returns `None`.
fn get_primary_addresses(
state: &ThanixClient,
machine: &Machine,
Expand Down

0 comments on commit 29600fa

Please sign in to comment.