Posh-IBWAPI 3.0.0
File upload/download wrappers, named configs, and auto session management
Just shipped a new Posh-IBWAPI release, version 3.0.0. It has only been two days since 2.0.0, but I goofed and shipped 2.0.0 with some breaking changes that I ended up reverting. The biggest feature of the release is the new file upload/download wrappers, Send-IBFile
and Recieve-IBFile
. They allow you to more easily do things like upload a certificate or download a grid backup and fill a functionality gap that has been bugging me since 1.0.
For example, in 1.x this is how you’d download a grid backup:
# request a download token and URL
$dl = Invoke-IBFunction -ref fileop -name getgriddata -args @{type='BACKUP'}
# download the file
Invoke-IBWAPI -Uri $dl.url -ContentType 'application/force-download' `
-Credential (Get-IBWAPIConfig).Credential `
-OutFile .\backup.tar.gz
# inform Infoblox that the download is complete
Invoke-IBFunction -ref fileop -name downloadcomplete -args @{token=$dl.token}
But in 3.x, you can now do this:
Receive-IBFile getgriddata -args @{type='BACKUP'} -OutFile .\backup.tar.gz
Also in the release are named configs which enable saving different credentials for the same grid. The module takes care of session management now as well. So you don’t need to manually deal with WebSession objects to prevent extraneous authentication requests.
Updated versions can be found in the PowerShell Gallery or GitHub. Installation instructions are in the Readme.
Changelog
- Breaking Changes
- The change to
ObjectType
parameter inInvoke-IBFunction
has been reverted toObjectRef
like in 1.x. I totally confused myself during 2.x development of the *-IBFile functions and thought it had been wrong the whole time. It seems silly to do another major version change after two days. But breaking changes demand it according to semver. - The
ObjectType
parameter inSend-IBFile
andReceive-IBFile
have been changed toObjectRef
to matchInvoke-IBFunction
. Both still default to ‘fileop’ and have parameter aliases for ‘type’ and ‘ObjectType’ to maintain compatibility with the short lived 2.x codebase.
- The change to
- Fixed example in
Invoke-IBFunction
help.
And here’s the changelog for 2.0.0 which gives a better idea of what has changed since 1.x:
- Breaking Changes
- .NET 4.5+ is now required on PowerShell Desktop edition for full functionality. A warning will be thrown when loading the module if it is not found.
- The
WebSession
parameter has been removed from all functions exceptInvoke-IBWAPI
. Session handling is now automatic. New-IBSession
has been removed.Get-IBWAPIConfig
,Set-IBWAPIConfig
, andRemove-IBWAPIConfig
have been renamed toGet-IBConfig
,Set-IBConfig
, andRemove-IBConfig
respectively.Save-IBWAPIConfig
has been removed. Configs are now saved by default viaSet-IBConfig
.- Configs are now referenced by a
ProfileName
. Old 1.x configs will be automatically backed up, converted, and the new profiles will have their WAPIHost value set as the initial profile name. Set-IBConfig
now hasProfileName
as its first parameter.Get-IBConfig
andRemove-IBConfig
now haveProfileName
instead ofWAPIHost
as their selection parameter.- The
IgnoreCertificateValidation
switch has been renamed toSkipCertificateCheck
in all functions and configs to be more in line with PowerShell Core. - The
ObjectRef
parameter inInvoke-IBFunction
has been changed toObjectType
which is functionally how it always worked and was inappropriately named. Functions get called against object types not references.
- New Feature: Automatic session handling. The module will now automatically save and use WebSession objects to increase authentication efficiency over multiple requests and function calls.
- New Feature: Named configuration profiles. This will allow you to save multiple profiles for the same WAPI host with different credentials, WAPI versions, etc.
- New functions
Send-IBFile
andRecieve-IBFile
which are convenient wrappers around the fileop functions. See the cmdlet help or the guide in the wiki for more details. - Config profiles are now automatically saved to disk when using
Set-IBConfig
. Set-IBConfig
now has aNewName
parameter to rename the profile.Get-IBConfig
now returns a typed object with a automatically styled display.Remove-IBConfig
now has pipeline support both by value and property name so you can pipe the output ofGet-IBConfig
to it.Get-IBConfig
,Set-IBConfig
, andRemove-IBConfig
now have tab completion on PowerShell 5.0 or later.