Forum Discussion
Richard_Milner-
Nimbostratus
Aug 14, 2012Creating Profiles / available methods list on iControl?
Hi Folks, I suspect I've just missed a large chunk of the documentation, so any pointers would be handy... I've already used iControl briefly in a couple of other tools, mainly...
Richard_Milner-
Nimbostratus
Aug 15, 2012I'll post the rest of the functions I end up creating in case they will be of use to anyone. This one was a little more interesting as I had to learn what a struct was. It may be worth beefing up the documentation around New-Object -TypeName iControl.LocalLBProfileString; to a non-programmer this stuff isn't very obvious, translating the one example I found from Java to Powershell wasn't simple for me.
I'm also still not clear why I need to insert the LocalLBProfileString into an Array before I can use it?
-------------------------------------------------------------------------
function Create-ClientSSLProfile()
Check whether a ClientSSL Profile exists, create it if required
-------------------------------------------------------------------------
{
Param([string] $profileName);
$ClientSSLArray = @()
$ClientSSLArray = (Get-F5.iControl).LocalLBProfileClientSSL.get_list()
If ($ClientSSLArray -contains $profileName) {
Write-Host "ClientSSL Profile: $profileName already exists" -ForegroundColor Cyan
} Else {
try {
Create LocalLBProfileString Structs for certificate and keys
$defaultCert = New-Object -TypeName iControl.LocalLBProfileString;
$defaultCert.value = "default";
$defaultCert.default_flag = "true";
$defaultCerts = (, $defaultCert);
$defaultKey = New-Object -TypeName iControl.LocalLBProfileString;
$defaultKey.value = "default";
$defaultKey.default_flag = "true";
$defaultKeys = (, $defaultKey);
Create ClientSSL profile
(Get-F5.iControl).LocalLBProfileClientSSL.create( $profileName, $defaultCerts, $defaultKeys )
Write-Host "Created ClientSSL Profile: $profileName" -ForegroundColor Green
} catch {
Write-Host "There was an exception thrown creating ClientSSL Profile: $profileName" -ForegroundColor Red
$Error[0]
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects