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 API method to rename devices #7895

Merged
merged 1 commit into from Dec 19, 2017

Conversation

Projects
None yet
4 participants
@thomseddon
Contributor

thomseddon commented Dec 11, 2017

Not sure on how you'd like this method to be presented? Let me know if you'd prefer the new hostname to be in the body (I just wanted some kind of differentiation).

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

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Dec 11, 2017

Member

Thanks @thomseddon.

The API code went through a little refactor the other week so you'll need to update the code a bit to match (I can do that if you haven't got time?)

Member

laf commented Dec 11, 2017

Thanks @thomseddon.

The API code went through a little refactor the other week so you'll need to update the code a bit to match (I can do that if you haven't got time?)

@thomseddon

This comment has been minimized.

Show comment
Hide comment
@thomseddon

thomseddon Dec 12, 2017

Contributor

Fixed the typo, thanks for spotting that.

I've also added check_is_admin(); to match update_device?

@laf what branch should I rebase from? I've just checked and it seems up to date with master on here, just let me know what I'm missing, can get it fixed today :)

Contributor

thomseddon commented Dec 12, 2017

Fixed the typo, thanks for spotting that.

I've also added check_is_admin(); to match update_device?

@laf what branch should I rebase from? I've just checked and it seems up to date with master on here, just let me know what I'm missing, can get it fixed today :)

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Dec 15, 2017

Member

@laf what branch should I rebase from? I've just checked and it seems up to date with master on here, just let me know what I'm missing, can get it fixed today :)

@thomseddon sorry for the delay, busy week as you know.

So sending an error back can be done like: https://github.com/librenms/librenms/blob/master/html/includes/api_functions.inc.php#L255

Sending the end response can be done like: https://github.com/librenms/librenms/blob/master/html/includes/api_functions.inc.php#L263

Happy to update if you don't have time.

Member

laf commented Dec 15, 2017

@laf what branch should I rebase from? I've just checked and it seems up to date with master on here, just let me know what I'm missing, can get it fixed today :)

@thomseddon sorry for the delay, busy week as you know.

So sending an error back can be done like: https://github.com/librenms/librenms/blob/master/html/includes/api_functions.inc.php#L255

Sending the end response can be done like: https://github.com/librenms/librenms/blob/master/html/includes/api_functions.inc.php#L263

Happy to update if you don't have time.

@thomseddon

This comment has been minimized.

Show comment
Hide comment
@thomseddon

thomseddon Dec 18, 2017

Contributor

@laf ah sorry, I see it now - my mistake!

I've switched to the new functions to form the responses (much nicer 👍) and tided up a couple of other things (erroneous new line, unnecessary full stop in response)

Happy to make any more amends :)

Contributor

thomseddon commented Dec 18, 2017

@laf ah sorry, I see it now - my mistake!

I've switched to the new functions to form the responses (much nicer 👍) and tided up a couple of other things (erroneous new line, unnecessary full stop in response)

Happy to make any more amends :)

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Dec 18, 2017

The inspection completed: 1 updated code elements

scrutinizer-notifier commented Dec 18, 2017

The inspection completed: 1 updated code elements

@laf laf added the API label Dec 19, 2017

@laf laf merged commit d6d4a3a into librenms:master Dec 19, 2017

2 checks passed

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

This comment has been minimized.

Show comment
Hide comment
@laf

laf Dec 19, 2017

Member

Thanks for doing this @thomseddon :)

Member

laf commented Dec 19, 2017

Thanks for doing this @thomseddon :)

@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.