Compare commits

2 Commits

Author SHA1 Message Date
8e9b61d9b2 Comment in the geofeed 2024-01-07 14:58:40 -08:00
e68e3b14cd Include the postal code 2024-01-07 14:58:33 -08:00
3 changed files with 26 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ namespace AS1024.GeoFeed.GeoFeedBuilder
foreach (IPGeoFeed feed in geoFeeds)
{
csvContent.AppendLine($"{feed.Prefix},{feed.GeolocCountry},{feed.GeolocRegion},{feed.GeolocCity},");
csvContent.AppendLine($"{feed.Prefix},{feed.GeolocCountry},{feed.GeolocRegion},{feed.GeolocCity},{feed.GeolocPostalCode}");
}
return csvContent.ToString();

View File

@@ -16,15 +16,35 @@ namespace AS1024.GeoFeed.Models
public class CustomFields
{
/// <summary>
/// Represents the city associated with the IP address. This field is optional.
/// </summary>
public string? GeolocCity { get; set; }
/// <summary>
/// Represents the country associated with the IP address. This field is optional and expected to be a selection field in NetBox.
/// </summary>
public string? GeolocCountry { get; set; }
/// <summary>
/// Indicates whether geolocation data is available for the IP address. This field is required.
/// </summary>
public bool? GeolocHasLocation { get; set; }
/// <summary>
/// Represents the region or state associated with the IP address. This field is optional and expected to be a selection field in NetBox.
/// </summary>
public string? GeolocRegion { get; set; }
/// <summary>
/// Represents the postal code associated with the IP address. This field is optional.
/// </summary>
public string? GeolocPostalCode { get; set; }
}
/// <summary>
/// This class represents the IP GeoFeed Entry
/// </summary>
public class IPGeoFeed : CustomFields {
/// <summary>
/// Represents the IP Prefix for the associated GeoFeed entry
/// </summary>
public string? Prefix { get; set; }
}
}

View File

@@ -21,18 +21,6 @@ The application requires the following configuration variables to be set:
These variables can be set in your application's configuration file or through environment variables, depending on your deployment strategy.
## NetBox Custom Fields
Ensure that your NetBox instance is configured with the following custom fields:
- `geoloc_city`: (Text) Represents the city and is not required to be filled in.
- `geoloc_country`: (Selection) Represents the country and is not required to be filled in.
- `geoloc_has_location`: (Boolean) Indicates if there is geolocation data available and is required.
- `geoloc_postal_code`: (Text) Represents the postal code and is not required to be filled in.
- `geoloc_region`: (Selection) Represents the region and is not required to be filled in.
These fields are critical for the application to accurately retrieve and format geolocation data.
## Getting Started
To build and run the application, follow these steps:
@@ -44,6 +32,10 @@ To build and run the application, follow these steps:
5. After a successful build, you can start the application by running `dotnet run`.
6. The application will start, and you can access the endpoints as specified.
## Docker Build
A Dockerfile is provided for your convienence. This has not been tested as of yet.
## Endpoints
The application provides the following key endpoints: