Compare commits
2 Commits
01ccc1ab91
...
no-cache
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e9b61d9b2 | |||
| e68e3b14cd |
@@ -11,7 +11,7 @@ namespace AS1024.GeoFeed.GeoFeedBuilder
|
|||||||
|
|
||||||
foreach (IPGeoFeed feed in geoFeeds)
|
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();
|
return csvContent.ToString();
|
||||||
|
|||||||
@@ -16,15 +16,35 @@ namespace AS1024.GeoFeed.Models
|
|||||||
|
|
||||||
public class CustomFields
|
public class CustomFields
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the city associated with the IP address. This field is optional.
|
||||||
|
/// </summary>
|
||||||
public string? GeolocCity { get; set; }
|
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; }
|
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; }
|
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; }
|
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; }
|
public string? GeolocPostalCode { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This class represents the IP GeoFeed Entry
|
||||||
|
/// </summary>
|
||||||
public class IPGeoFeed : CustomFields {
|
public class IPGeoFeed : CustomFields {
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the IP Prefix for the associated GeoFeed entry
|
||||||
|
/// </summary>
|
||||||
public string? Prefix { get; set; }
|
public string? Prefix { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user