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

Feature: (API) Retrieve BGP sessions by ID #7825

Merged
merged 5 commits into from Nov 30, 2017

Conversation

Projects
None yet
5 participants
@Lee303
Contributor

Lee303 commented Nov 30, 2017

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

This PR adds an API endpoint for retrieving BGP sessions by ID.

@CLAassistant

This comment has been minimized.

Show comment
Hide comment
@CLAassistant

CLAassistant Nov 30, 2017

CLA assistant check
All committers have signed the CLA.

CLAassistant commented Nov 30, 2017

CLA assistant check
All committers have signed the CLA.

$app = \Slim\Slim::getInstance();
$router = $app->router()->getCurrentRoute()->getParams();
$bgpPeerId = $router['id'];

This comment has been minimized.

@murrant

murrant Nov 30, 2017

Member

How do you figure out the bgpPeer_id via the API?

What if I want to look up by bgpPeerIdentifier ?

@murrant

murrant Nov 30, 2017

Member

How do you figure out the bgpPeer_id via the API?

What if I want to look up by bgpPeerIdentifier ?

This comment has been minimized.

@Lee303

Lee303 Nov 30, 2017

Contributor

This is returned from GET /api/v0/bgp (list_bgp()), and I chose this for get_bgp() as this is the primary key and uniquely identifies the BGP session. I believe bgpPeerIdentifier would be best suited to to an additional filter for list_bgp()? Apologies if I've missed the mark here, this is my first venturing into librenms :)

@Lee303

Lee303 Nov 30, 2017

Contributor

This is returned from GET /api/v0/bgp (list_bgp()), and I chose this for get_bgp() as this is the primary key and uniquely identifies the BGP session. I believe bgpPeerIdentifier would be best suited to to an additional filter for list_bgp()? Apologies if I've missed the mark here, this is my first venturing into librenms :)

This comment has been minimized.

@laf

laf Nov 30, 2017

Member

What if I want to look up by bgpPeerIdentifier ?

That's not a unique reference within the DB.

@laf

laf Nov 30, 2017

Member

What if I want to look up by bgpPeerIdentifier ?

That's not a unique reference within the DB.

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Nov 30, 2017

Member

Thanks for doing this spotts, I'll give this a quick test later :)

Member

laf commented Nov 30, 2017

Thanks for doing this spotts, I'll give this a quick test later :)

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Nov 30, 2017

The inspection completed: 1 updated code elements

scrutinizer-notifier commented Nov 30, 2017

The inspection completed: 1 updated code elements

@laf laf merged commit e308287 into librenms:master Nov 30, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@laf laf added the API label Dec 2, 2017

@Lee303 Lee303 deleted the Lee303:api-bgp-by-id branch Dec 12, 2017

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot May 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

lock bot commented May 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 16, 2018

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