Skip to content

[rest] add mleid ip address API#2758

Open
OmegaRelay wants to merge 2 commits intoopenthread:mainfrom
OmegaRelay:rest-mleid-ip-address
Open

[rest] add mleid ip address API#2758
OmegaRelay wants to merge 2 commits intoopenthread:mainfrom
OmegaRelay:rest-mleid-ip-address

Conversation

@OmegaRelay
Copy link
Copy Markdown
Contributor

We'd like to add a small PR to add functionality to retrieve the current mleid IP address of the border router over rest API. This PR adds a new endpoint /node/ip-address/mleid which only accepts GET requests and responds with the mleid ip address string.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 11, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@OmegaRelay OmegaRelay force-pushed the rest-mleid-ip-address branch from 9fea662 to 1a202a4 Compare March 11, 2025 13:36
@wgtdkp
Copy link
Copy Markdown
Member

wgtdkp commented Mar 11, 2025

Hi @OmegaRelay Thanks for contribution! What's the specific use case for ML-EID? Why not returning the OMR address which is externally routable or all the addresses?

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2025

Codecov Report

Attention: Patch coverage is 7.14286% with 13 lines in your changes missing coverage. Please review.

Project coverage is 43.38%. Comparing base (2b41187) to head (1a202a4).
Report is 975 commits behind head on main.

Files with missing lines Patch % Lines
src/rest/resource.cpp 7.14% 13 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2758       +/-   ##
===========================================
- Coverage   55.77%   43.38%   -12.39%     
===========================================
  Files          87      110       +23     
  Lines        6890    13405     +6515     
  Branches        0      956      +956     
===========================================
+ Hits         3843     5816     +1973     
- Misses       3047     7279     +4232     
- Partials        0      310      +310     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@OmegaRelay
Copy link
Copy Markdown
Contributor Author

OmegaRelay commented Mar 11, 2025

Hi @OmegaRelay Thanks for contribution! What's the specific use case for ML-EID? Why not returning the OMR address which is externally routable or all the addresses?

Hi @wgtdkp, I only added support for MLEID as that's what we need in our application for network service discovery. I would be happy to expand it to support all ip addresses if that's preferred?

@jwhui jwhui requested a review from wgtdkp March 14, 2025 20:10
@OmegaRelay OmegaRelay force-pushed the rest-mleid-ip-address branch from 1a202a4 to 6fac496 Compare June 6, 2025 13:39
@OmegaRelay OmegaRelay force-pushed the rest-mleid-ip-address branch from 6fac496 to 0b274df Compare June 6, 2025 13:44
@OmegaRelay
Copy link
Copy Markdown
Contributor Author

Hi @wgtdkp I have now extended the functionality to support more ip address types. A get request on the /node/ip-address endpoint will respond with an object such as

{
  "Rloc": "fde5:8dba:82e1:1::ff:fe00:1001",
  "Mleid": "fde5:8dba:82e1:1:416:993c:8399:35ab",
  "LinkLocal": "fe80::54db:881c:3845:57f4",
  "Omr": [
    "2000::54db:881c:3845:57f4"
  ],
  "Aloc": [
    "fde5:8dba:82e1:1::ff:fe00:fc01"
  ]
}

And I've added /node/ip-address/rloc for the rloc ip address and /node/ip-address/omr for the preferred omr address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants