Forum Discussion

donfouts_363600's avatar
donfouts_363600
Icon for Nimbostratus rankNimbostratus
Mar 07, 2019

Icontrol REST new virtual server 2019

i have looked at all the documentation i can find (most of it is pretty old) this one looks good and is only 6 months old... https://devcentral.f5.com/articles/icontrol-rest-cookbook-24575

and i also found this that seams like it would help: https://devcentral.f5.com/wiki/iControlREST.APIRef_tm_ltm_virtual.ashx

I am trying to create a new virtual server (i have already made a pool)

according to the cookbook - using this uri: /mgmt/tm/ltm/virtual i was getting: "code":403,"message":"Operation is not supported on component /ltm/virtual." so i added /mgmt/tm/ltm/virtual/~Common and now i am getting: "code":400,"message":"one or more configuration identifiers must be provided"

how do i find what the configuration identifiers are?

I am using powershell and below is the snippet:

 

$URI = "https://$f5ip/mgmt/tm/ltm/virtual/~Common"
$rules = @("_sys_https_redirect")
$body = @{"Name"="$rd";"destination"="$($VIP):80";"mask"="255.255.255.0";"rules"= $rules}
$JSONBody = $body | ConvertTo-Json
$newvirtualserver = invoke-webrequest -Method POST -URI "$URI" -Insecure -Body $JSONBody -Headers $headers -Credential $credentials

 

1 Reply

  • Have you checked out this post about how to use the powershell snap in? I think it would be helpful in your case. Also, in this post is an example of how to use the snap in to create a virtual server