Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor branch #1

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bc7c758
test
eleonora-sc Sep 5, 2023
9a6f475
get probeseses in alaska (there are 7 connected ones)
eleonora-sc Oct 9, 2023
3976840
getting measurements using sagan
eleonora-sc Oct 13, 2023
34e8256
parsing traceroute measurements works, I also created 5 traceroute me…
eleonora-sc Oct 15, 2023
3c6c508
update the requirements.txt file
jaren-ramirez Oct 15, 2023
6660548
hello eleonora
jaren-ramirez Oct 15, 2023
2bd4f95
made updates to csv handling
jaren-ramirez Oct 15, 2023
eb9c63b
updated the get_trace_route_results to take in measurement ids
jaren-ramirez Oct 15, 2023
e64351f
removed the if name == main
jaren-ramirez Oct 15, 2023
5416c79
Using GeoLite2 to figure out latlongs of ip addresses
eleonora-sc Oct 16, 2023
0ec74c0
under plans there is the structure for the traceroute json object tha…
eleonora-sc Oct 16, 2023
f95e8df
reformatted the code structure
jaren-ramirez Oct 20, 2023
a480c35
fixed imports
eleonora-sc Oct 20, 2023
35f035a
geoip2 account stuff and api key are no longer exposed
eleonora-sc Oct 20, 2023
07face8
database work
jaren-ramirez Oct 22, 2023
92144fa
database work
jaren-ramirez Oct 22, 2023
8973945
few more changes
jaren-ramirez Oct 22, 2023
5ced261
few more changes
jaren-ramirez Oct 22, 2023
03ebb38
made a lot of stuff
jaren-ramirez Oct 22, 2023
438d4b3
first commit
jaren-ramirez Nov 1, 2023
cb9276e
some base templates for jekyll
jaren-ramirez Nov 1, 2023
393d9b7
added a favicon goldfish
jaren-ramirez Nov 1, 2023
1cebbc2
hello
jaren-ramirez Nov 1, 2023
6867995
more class structures
jaren-ramirez Nov 1, 2023
8e7bc85
added some basic stuff
jaren-ramirez Nov 2, 2023
c1d1664
finished the get_probes function
jaren-ramirez Nov 2, 2023
174c392
got a lot of country data and added some helpers to make my life faster
jaren-ramirez Nov 3, 2023
459a67d
_get, _post, create_traceroute_measurement, get_traceroute_measurement
eleonora-sc Nov 4, 2023
0c93fa9
lots of new additions
jaren-ramirez Nov 4, 2023
77ffe87
added a payload class and temporarily removed the logger until it can…
jaren-ramirez Nov 4, 2023
b05c189
fixed vscode being in the repository
jaren-ramirez Nov 4, 2023
bda6934
changes made to the payload can be easily extended to support any typ…
jaren-ramirez Nov 4, 2023
290edb3
more changes
jaren-ramirez Nov 5, 2023
ffcfe60
remote alaska ip's under data -> alaska-probes
eleonora-sc Nov 8, 2023
3fc96a6
changed
jaren-ramirez Nov 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ __pycache__/
# C extensions
*.so

#vscode
.vscode
.vscode/
vscode
vscode/
# Distribution / packaging
.Python
build/
Expand Down Expand Up @@ -158,3 +163,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.vscode/settings.json
Empty file added GMeasurements/__init__.py
Empty file.
152 changes: 152 additions & 0 deletions GMeasurements/measurement_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
from typing import Any, Dict, List, Optional, Unpack, Required, Optional, TypedDict, Union, NotRequired,overload
from datetime import datetime

class GetMeasurementParams(TypedDict):
sort: NotRequired[str]
id__lt: NotRequired[str]
id__lte: NotRequired[str]
id__gt: NotRequired[str]
id__gte: NotRequired[str]
id__in: NotRequired[str]
id: NotRequired[str]
start_time: NotRequired[datetime]
start_time__lt: NotRequired[datetime]
start_time__lte: NotRequired[datetime]
start_time__gt: NotRequired[datetime]
start_time__gte: NotRequired[datetime]
stop_time: NotRequired[datetime]
stop_time__lt: NotRequired[datetime]
stop_time__lte: NotRequired[datetime]
stop_time__gt: NotRequired[datetime]
stop_time__gte: NotRequired[datetime]
is_public: NotRequired[bool]
is_oneoff: NotRequired[bool]
interval: NotRequired[str]
interval__lt: NotRequired[str]
interval__lte: NotRequired[str]
interval__gt: NotRequired[str]
interval__gte: NotRequired[str]
status: NotRequired[str]
status__in: NotRequired[str]
tags: NotRequired[str]
type: NotRequired[str]
target_ip: NotRequired[str]
current_probes: NotRequired[str]
participant_logs_probes: NotRequired[str]
target_asn: NotRequired[str]
target: NotRequired[str]
target__contains: NotRequired[str]
target__startswith: NotRequired[str]
target__endswith: NotRequired[str]
description: NotRequired[str]
description__contains: NotRequired[str]
description__startswith: NotRequired[str]
description__endswith: NotRequired[str]
af: NotRequired[str]
search: NotRequired[str]
protocol: NotRequired[str]
group_id: NotRequired[str]
group: NotRequired[str]
favourite: NotRequired[bool]
hidden: NotRequired[bool]
page: NotRequired[int]
page_size: NotRequired[int]
after: NotRequired[str]
format: NotRequired[str]
callback: NotRequired[str]
optional_fields: NotRequired[str]
fields: NotRequired[str]
format_datetime: NotRequired[str]
key: NotRequired[str]
mine: NotRequired[bool]

class MeasurementParams(TypedDict):
description: Required[str]
af: Required[int]
type: Required[str]
resolve_on_probe: NotRequired[bool]
is_oneoff: NotRequired[bool]
start_time: NotRequired[datetime]
stop_time: NotRequired[datetime]
interval: NotRequired[int]
spread: NotRequired[int]
is_public: NotRequired[bool]

class TracerouteParams(MeasurementParams):
target: Required[str]
response_timeout: NotRequired[int]
packets: NotRequired[int]
paris: NotRequired[int]
size: NotRequired[int]
first_hop: NotRequired[int]
max_hops: NotRequired[int]
protocol: NotRequired[str]

class SSLCertParams(MeasurementParams):
target: Required[str]

class HTTPParams(MeasurementParams):
target: Required[str]

class NTPParams(MeasurementParams):
target: Required[str]

class PingParams(MeasurementParams):
target: Required[str]
packets: NotRequired[int]
size: NotRequired[int]
packet_interval: NotRequired[int]
include_probe_id: NotRequired[bool]

class DNSParams(MeasurementParams):
query_class: Required[str]
query_type: Required[str]
query_argument: Required[str]
target_server: NotRequired[str]
timeout: NotRequired[int]
udp_payload_size: NotRequired[int]
retry_times: NotRequired[int]
protocol: NotRequired[str]
use_probes_resolver: NotRequired[bool]

class GetProbesParams(TypedDict):
country_code: NotRequired[str]
id__lt: NotRequired[int]
id__lte: NotRequired[int]
id__gte: NotRequired[int]
id__gt: NotRequired[int]
id__in: NotRequired[str]
latitude: NotRequired[str]
latitude__lt: NotRequired[str]
latitude__lte: NotRequired[str]
latitude__gte: NotRequired[str]
latitude__gt: NotRequired[str]
longitude: NotRequired[str]
longitude__lt: NotRequired[str]
longitude__lte: NotRequired[str]
longitude__gte: NotRequired[str]
longitude__gt: NotRequired[str]
asn: NotRequired[str]
asn_v4: NotRequired[str]
asn_v4__in: NotRequired[str]
asn_v6: NotRequired[str]
asn_v6__in: NotRequired[str]
prefix_v4: NotRequired[str]
prefix_v6: NotRequired[str]
status: NotRequired[str]
status_name: NotRequired[str]
is_anchor: NotRequired[bool]
is_public: NotRequired[bool]
tags: NotRequired[str]
radius: NotRequired[str]
country_code__in: NotRequired[str]
include: NotRequired[str]
optional_fields: NotRequired[str]
format: NotRequired[str]
sort: NotRequired[str]

class ProbeParams(TypedDict):
requested: Required[int]
type: Required[str]
value: Required[Union[str,int]]

Loading