Forum Discussion

Prabhat_Karki_3's avatar
Prabhat_Karki_3
Historic F5 Account
Jun 15, 2017

iControl REST for module provisioning

Hello, I'm trying to use iControl REST to provision the moduleon BigIP 12.1.2 According to iControl API doc /tm/sys/provision accepts PUT method. Below is my REST call, and I'm getting 403 forbidden error

 

curl -ksi -u "admin:" https://:/mgmt/tm/sys/provision \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X PUT -d ' {"name":"afm", "level":"nominal"}'

 

 

HTTP/1.1 403 Forbidden Date: 15 Jun 2017 16:07:40 UTC Server: X-Frame-Options: SAMEORIGIN Strict-Transport-Security: max-age=16070400; includeSubDomains Pragma: no-cache Cache-Control: no-store, no-cache, must-revalidate Expires: -1 Content-Length: 109 Content-Type: application/json Allow: REMOTEROLE: 0 Local-Ip-From-Httpd: 11.0.0.166 Session-Invalid: true X-Forwarded-Server: localhost.localdomain X-Forwarded-Proto: http REMOTECONSOLE: /sbin/nologin X-Forwarded-Host: 11.0.0.166 X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' http://127.4.1.1 http://127.4.2.1

 

Am I missing anything?

 

  • Resolved Instead of PUT, method PATCH needs to be used and needs to add the module name in the URL Here is the working command

     

    curl -ksi -u "admin:admin" https:///mgmt/tm/sys/provision/afm -H "Content-Type: application/json" -H "Accept: application/json" -X PATCH -d ' {"name":"afm", "level":"nominal"}'

    HTTP/1.1 200 OK Date: 15 Jun 2017 19:52:14 UTC Server: X-Frame-Options: SAMEORIGIN Strict-Transport-Security: max-age=16070400; includeSubDomains Pragma: no-cache Cache-Control: no-store, no-cache, must-revalidate Expires: -1 Content-Length: 218 Content-Type: application/json Allow: REMOTEROLE: 0 Local-Ip-From-Httpd: Session-Invalid: true X-Forwarded-Server: localhost.localdomain X-Forwarded-Proto: http REMOTECONSOLE: /sbin/nologin X-Forwarded-Host: X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' http://127.4.1.1 http://127.4.2.1

     

    {"kind":"tm:sys:provision:provisionstate","name":"afm","fullPath":"afm","generation":549,"selfLink":";:

     

  • Prabhat_Karki_3's avatar
    Prabhat_Karki_3
    Historic F5 Account

    Resolved Instead of PUT, method PATCH needs to be used and needs to add the module name in the URL Here is the working command

     

    curl -ksi -u "admin:admin" https:///mgmt/tm/sys/provision/afm -H "Content-Type: application/json" -H "Accept: application/json" -X PATCH -d ' {"name":"afm", "level":"nominal"}'

    HTTP/1.1 200 OK Date: 15 Jun 2017 19:52:14 UTC Server: X-Frame-Options: SAMEORIGIN Strict-Transport-Security: max-age=16070400; includeSubDomains Pragma: no-cache Cache-Control: no-store, no-cache, must-revalidate Expires: -1 Content-Length: 218 Content-Type: application/json Allow: REMOTEROLE: 0 Local-Ip-From-Httpd: Session-Invalid: true X-Forwarded-Server: localhost.localdomain X-Forwarded-Proto: http REMOTECONSOLE: /sbin/nologin X-Forwarded-Host: X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' http://127.4.1.1 http://127.4.2.1

     

    {"kind":"tm:sys:provision:provisionstate","name":"afm","fullPath":"afm","generation":549,"selfLink":";: