-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add IP Location APIs #3107
Add IP Location APIs #3107
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I think we'll still need to make a change to |
Thanks for creating this PR! I was looking at how to ensure the work from elastic/elasticsearch#116611 got carried over to the new API docs site and this PR already does a lot of the heavy lifting (we can port the examples over in a subsequent PR). |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
7fe4822
to
9f1d783
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
/** The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading. | ||
* At present, the only supported provider is maxmind, and the maxmind provider requires that an account_id (string) is configured. | ||
*/ | ||
maxmind: Maxmind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do need the maxmind
key which is gone with this approach.
Also it's OK to have some duplication, eg I'm happy to keep the previous approach but simply add an ipinfo
field and type, with one less field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, yeah, I'll take a swing at fixing that -- it wasn't an intentional change in this second version of things, I just wasn't thoughtful enough about how I did it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about 31fd86a?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks! Can you please confirm that the GeoIP APIs also accept ipinfo
databases? I'm asking as DatabaseConfiguration
is currently shared between the two APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they do.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@pquentin I've got two more things on this one, one that's hopefully minor, and then one that might be more-than-minor: 1.) Can you help me diagnose and understand the failure on 2.) The |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry for the delay! So 1. and 2. are the same actually! The failure is the one I mentioned in https://github.com/elastic/elasticsearch-specification/pull/3107/files#r1850637399. I can help you offline to get That said, I tried to fix those in my latest commit, please take a look. Something else we need to do (possibly in a follow-up PR) is to apply the same changes to the existing GeoIP APIs. |
specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts
Outdated
Show resolved
Hide resolved
specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts
Outdated
Show resolved
Hide resolved
…abaseResponse.ts Co-authored-by: Laura Trotta <[email protected]>
…abaseResponse.ts Co-authored-by: Quentin Pradet <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
and then make generate, etc
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it!
* Add IP Location APIs * Rename these files * Reword this description * Handle ipinfo in addition to maxmind * A slightly more faithful alternative approach * Remove accidentally-added line * A more-correct implementation of the second approach * Another approach using @Variants container * Fix IP location APIs * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Laura Trotta <[email protected]> * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Quentin Pradet <[email protected]> * Fix an import and then make generate, etc * Remove unused import --------- Co-authored-by: Joe Gallo <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit dae081f)
* Add IP Location APIs * Rename these files * Reword this description * Handle ipinfo in addition to maxmind * A slightly more faithful alternative approach * Remove accidentally-added line * A more-correct implementation of the second approach * Another approach using @Variants container * Fix IP location APIs * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Laura Trotta <[email protected]> * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Quentin Pradet <[email protected]> * Fix an import and then make generate, etc * Remove unused import --------- Co-authored-by: Joe Gallo <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit dae081f)
* Add IP Location APIs * Rename these files * Reword this description * Handle ipinfo in addition to maxmind * A slightly more faithful alternative approach * Remove accidentally-added line * A more-correct implementation of the second approach * Another approach using @Variants container * Fix IP location APIs * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Laura Trotta <[email protected]> * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Quentin Pradet <[email protected]> * Fix an import and then make generate, etc * Remove unused import --------- Co-authored-by: Joe Gallo <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit dae081f)
* Add IP Location APIs * Rename these files * Reword this description * Handle ipinfo in addition to maxmind * A slightly more faithful alternative approach * Remove accidentally-added line * A more-correct implementation of the second approach * Another approach using @Variants container * Fix IP location APIs * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Laura Trotta <[email protected]> * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Quentin Pradet <[email protected]> * Fix an import and then make generate, etc * Remove unused import --------- Co-authored-by: Joe Gallo <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit dae081f) Co-authored-by: Quentin Pradet <[email protected]>
* Add IP Location APIs * Rename these files * Reword this description * Handle ipinfo in addition to maxmind * A slightly more faithful alternative approach * Remove accidentally-added line * A more-correct implementation of the second approach * Another approach using @Variants container * Fix IP location APIs * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Laura Trotta <[email protected]> * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Quentin Pradet <[email protected]> * Fix an import and then make generate, etc * Remove unused import --------- Co-authored-by: Joe Gallo <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit dae081f) Co-authored-by: Quentin Pradet <[email protected]>
* Add IP Location APIs * Rename these files * Reword this description * Handle ipinfo in addition to maxmind * A slightly more faithful alternative approach * Remove accidentally-added line * A more-correct implementation of the second approach * Another approach using @Variants container * Fix IP location APIs * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Laura Trotta <[email protected]> * Update specification/ingest/get_ip_location_database/GetIpLocationDatabaseResponse.ts Co-authored-by: Quentin Pradet <[email protected]> * Fix an import and then make generate, etc * Remove unused import --------- Co-authored-by: Joe Gallo <[email protected]> Co-authored-by: Laura Trotta <[email protected]> (cherry picked from commit dae081f) Co-authored-by: Quentin Pradet <[email protected]>
I extracted the rest-api-spec JSON files from #3019. We'll need a review from the Data Management team before merging.