-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Create and/or edit NotificationActions #78
Comments
Hi @paulkva, Supporting the creation of additional object types (including Notification Actions) is something I've considered previously, however for most of these types (such as Schedules and Notification Actions) these aren't really objects that you have to create a lot of. Are you able to advise what your use case is for creating Notification Actions? Why do you need to create so many that you need to automate it? In regards to modifying properties, Notification Actions can be modified using the existing Regards, |
Thanks for the quick reply! Admittedly, our use of PRTG might be a bit unusual. We're building a "democratized DevOps" system that allows individual engineering teams to own their entire application, including deployment and monitoring, and we'd like to give them the ability to receive PRTG notifications on an email address or Slack channel of their choice. The total number we'd have to create won't be huge right now, but we're biased toward automating as much as possible in our efforts. Since |
Are you able to advise what you mean by expose a generic I was successfully able to clone a Notification Action using the following code var newId = client.CloneObject(300, "test", -3);
var newAction = client.GetNotificationAction(newId);
You can identify the raw names of all Notification Action properties by modifying a Notification Action in the PRTG UI while monitoring with Fiddler. The Email property is called |
I ... can't believe I missed I'll leave it up to you whether you'd like to close this or keep it as an open (lower priority) enhancement request. |
I just circled back to this and hit what looks like a known Paessler issue -- the one listed at the end of your 0.9.6 "Bugfixes" section. When I try code similar to your example above, I get back a It does seem to be creating the new |
I'm not sure how you're getting a newID of PrtgAPI extracts the ID of the cloned object from the response URL using the regular expression (.+?id=)(\\d+)(&.*)? I am a bit concerned that if you are getting a completely incorrect ID, that this expression is perhaps not working properly in all scenarios. Are you potentially able to run Fiddler and advise what the returned URL of the clone request is? Alternatively, you can compile PrtgAPI from source and set a breakpoint and advise what the value of the |
Ah, my code was still using PrtgAPI 0.9.3 when I posted my last comment; I've since updated to 0.9.6 and it's now returning the correct id. I think I might have misinterpreted your comment in the 0.9.6 release notes. My 2nd mistake on this issue in a week -- maybe I need a vacation? 😃 I captured traffic from Fiddler and saw this at the end of the response: |
EDIT: nevermind, I see you noted that the issue was resolved in PrtgAPI 0.9.6. Yes, this would be related to the
item in the release notes then. Previously the regex was too greedy (
|
I discovered a couple interesting side effects yesterday. First, the cloned object has the same permissions and ownership as the original object; the user who executes Second and perhaps more importantly, I realize I'm diving somewhat deeply into unsupported territory here, but would you like me to file either of these as separate issues? If nothing else, perhaps some caveats in the |
That is correct. As noted on the wiki:
The officially documented APIs for retrieving object properties only let you retrieve them one at a time, which is completely unacceptable. PrtgAPI does its best to workaround this to provide a coherent object model, however unfortunately there is only so much I can do with the facilities PRTG provides. The user may not have write permissions to the object they are cloning, however they may have write permissions on the object they are cloning to. How the |
Ah but it didn't throw an |
Ah of course; It has also occurred to me that technically speaking there is no need to call |
Enhancement request: It would be helpful to have the ability to create (or at least clone and then edit) NotificationAction objects. I believe most of the necessary classes already exist, considering how GetNotificationAction() works.
The text was updated successfully, but these errors were encountered: