Forum Discussion
Buddy_Edwards_1
Nimbostratus
Sep 09, 2016Get ClientSSL and ServerSSL profiles using the Rest API
I've written the following script so that I can document at a high level the VIPs that I have created without having to dig into them every time I need to know pools, irules, members, etc... the prob...
Kevin_Nelson
Nimbostratus
Jan 24, 2018Using James' information, this is a single-line (with a couple pre-configured conditions) that I used to verify the expected Server-side SSL profiles were assigned on a list of VIPs configured with a particular pool name pattern (where the pool names are POOL_200 or POOL_210):
Get-VirtualServer | ? Pool -match '.*/POOL_2[0,1]0' | Select Name,Pool,@{Name="ServerProfile"; Expression={ ( Invoke-RestMethod -Uri ( $_.profilesReference.link -replace "localhost", "" ) -Credential $cred ).items | ? context -eq serverside | Select -ExpandProperty Name } }
The pre-configured conditions were a stored credential (
$cred = Get-Credential ) adequate for authenticating with the LTM and the establishment of the F5 session using the stored credential (New-F5Session -LTMName -LTMCredentials $cred). The stored credential is used again in the inline Invoke-RestMethod in the command.
The result looked something like this:
name pool ServerProfile
---- ---- -------------
VIP_A /Common/POOL_200 serverssl-custom
VIP_B /Common/POOL_210 serverssl-custom
VIP_C /Common/POOL_210 serverssl-custom
VIP_D /Common/POOL_200 serverssl-custom
VIP_E /Common/POOL_210 serverssl-custom
You could change
context -eq serverside to context -eq clientside to see that profile or otherwise change the selection to suit.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
