Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: BPA 10.5 API - New PowerShell Module
Topic Summary:
Created On: 09/15/2016 12:41 PM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 09/15/2016 12:41 PM
User is offline View Users Profile Print this message

Author Icon
DavidSeibel
Apprentice (20-49)

Posts: 42
Joined: 11/14/2014

I created a PowerShell module for BPA that uses the new REST API.  It's available here: https://github.com/davidseibel/PoshBPA

I've implemented most capabilities of the API in the module.  But am missing a few things.  Most things related to permissions/calendar/metrics aren't there.  But most everything else is.  Additionally, the module does support connecting to multiple BPA servers, allowing you to manage multiple environments.

Hope this is useful!

 

Here are a few comments I have on the API:

1) Awesome first release! Really happy with the features introduced in this API.  I've wanted this for a long time now.  Thank you!

2) The 'create' action doesn't work, or the documentation is unclear on how to use it.

3) What is the 'update' action for?  The documentation doesn't indicate any parameters to send to it.

4) I had issues when combining 2 filter sets for instance/list.  Whenever I would supply a ConstructID and a status, it would ignore the status filter.  If I removed the ConstructID, the status filter would work.

5) I noticed that condition objects in the middle of a workflow (not a trigger) would show up under the Triggers property of a workflow.  I thought maybe these would show up under Items, or their own property.

6) It would be nice to have documentation of types of constructs and types of instances.  Although I was able to figure out everything I needed, it would be nice to simply be able to lookup those IDs in documentation, rather than reverse engineer.

Thank you again!

 

EDIT: I've added support for getting/removing system permissions.

Also, it would be nice to have a REST function for getting an object type given a ConstructID.

 

EDIT 2: I'm noticing that if I move a condition from one agent to another, the TriggersMonitored property of the agent it is being removed from does not update.  It does, however, update the TriggersMonitored property of the agent it is moving to.  /agents/{id}/conditions/list also does not update. Restarting management/execution/agent services seems to correct this.  Not sure if this is an issue with the API, or something underlying within BPA.



 Category Survey


Edited: 09/19/2016 at 08:57 AM by DavidSeibel
 09/18/2016 07:32 AM
User is offline View Users Profile Print this message

Author Icon
EricJones
Expert (100-199)

Posts: 105
Joined: 11/11/2007

That is some *excellent* work :-)

Thanks for sharing!

-Eric
JCMR Technology

 Category Survey
AutoMate BPA Server 10 version: 10.7.0
Windows version: Windows Server 2012 R2


-------------------------


Thanks,

-Eric
 09/19/2016 07:31 AM
User is offline View Users Profile Print this message

Author Icon
BenjaminKorper
Artisan (200-499)

Posts: 231
Joined: 06/18/2009

Hi David,

This is the coolest thing i've seen on the forum in quite some time!!! We will surely be using this and posting things back to github if we can.
Thank you very, very much!!!

Regards,

Benjamin



 Category Survey


-------------------------

 07/24/2017 09:55 AM
User is offline View Users Profile Print this message

Author Icon
DavidSeibel
Apprentice (20-49)

Posts: 42
Joined: 11/14/2014

Update:

I'm continuing to work on this as I am able.  I finally figured out a problem I was having with updating workflows/conditions, so I am working on a series of new functions to support that.  I've already created a few:

Add-BPAWorkflowVariable / Remove-BPAWorkflowVariable

Copy-BPAWorkflow

New-BPAScheduleCondition / Set-BPAScheduleCondition (There will eventually be a set of these for each trigger type)

and some others.  Check out the Github page for more details.

This also allowed me to lift the restriction on Workflows/Conditions for Moving/Renaming/Locking/etc.

I've also introduced a new Find-BPAObject function to search all of AutoMate for any search string (similar to the search functionality in the SMC).  It even tells you which property returned a hit.

I don't plan on building many more "edit" type functions for workflows at this point.  I think the designer is the best way to position objects/arrows within a workflow.  But I might add simple functions to replace an existing object, or something similar.  Any suggestions/requests are welcome.

I just tested upgrading to v11 last week, and was able to use the module to query objects.  I did not do much testing beyond that, however, due to a bug I discovered which required me to restore back to v10 (unrelated to the API or this module).  A note if you're using v11: the default port has changed to 9708.  So make sure to specify the -Port parameter when connection to a v11 environment.

I hope others have found this module as useful as I have!  Suggestions/feedback is appreciated!



 Category Survey
 10/03/2017 06:46 AM
User is offline View Users Profile Print this message

Author Icon
DavidSeibel
Apprentice (20-49)

Posts: 42
Joined: 11/14/2014

10/3/17 update:

The module is now available on the PSGallery!  You no longer need to go to the Github page to download the module.  Instead, you can simply run the following command from any PowerShell v5 prompt:

Install-Module PoshBPA



 Category Survey
 03/27/2018 12:23 PM
User is offline View Users Profile Print this message

Author Icon
DavidSeibel
Apprentice (20-49)

Posts: 42
Joined: 11/14/2014

3/27/18 update:
Version 2.0.0 is now available. Support for creating/modifying all condition types was added (except the new Email Condition in v11). There are also a few more functions for modifying workflow items/links. At this point, there should be little that can't be done with the module. If you already have PoshBPA installed, you can run "Update-Module PoshBPA" to update it. Or use "Install-Module PoshBPA".

 Category Survey
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 295 guests browsing this forum, which makes a total of 295 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2019 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog