VMware Cloud Foundation

 View Only
  • 1.  VCF API and postman

    Posted Jun 12, 2022 06:57 PM

    Hi,

    I am trying to automate password rotation using the SDDC manager.  This is probably more my ineptness at curl and postman, but I can't seem to get a token from the SDDC manager in postman.  I can curl it from a linux command line, get the token and then use it in postman - but ultimately I want to take the postman code into a python script that I can run as part of the automation that will get the token, then use the token to get all the passwords after a password rotation and store them in CyberArk.

    So I curl

    curl -X POST -H "Content-Type: application/json" -d '{"username": "administrator@vsphere.local","password": "VMware123!"}' --insecure https://10.0.0.4/v1/tokens

    and this returns me a token - I can then use that in postman.  But when I try to put the above command into postman or translate it into a request in python, I just get

    "errorCode""VCF_RUNTIME_ERROR",
        "arguments": [],
        "message""Something went wrong. Please retry or contact the service provider and provide the reference token.",
        "referenceToken""773RKU"
    }
     
    I am using basic auth and this is what the curl command from postman looks like when I look at the curl code.
     
    curl --location --request POST 'https://10.0.9.4/v1/tokens' \
    --header 'Accept: application/json' \
    --header 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
     
    i have x'd out the user/password hash here....  but as far as I can tell this is basically the same as the first curl command above...  I have also tried putting the user and pass into the data - but no matter what I try I get the same error message.  Hoping someone could help with this here, but maybe I need to post something on a postman forum somewhere.   I have also imported the swagger file from the SDDC manager, but I can't get the tokens api to work from that either, same error message.
     
    Thanks for any ideas at all, I am stuck.
     
    Bill
     
     


  • 2.  RE: VCF API and postman
    Best Answer

    Posted Jun 13, 2022 07:11 AM

    VMware Cloud Foundation has a number of Public APIs, the documentation around this can easily be found by logging into the SDDC Manager UI and selecting the Developer Center. From here you can even execute an API on the running system.

    myhtspace



  • 3.  RE: VCF API and postman

    Posted Jun 13, 2022 12:52 PM

    thanks, I hadn't noticed the explorer... it had the snippet of code I needed to put into the body.



  • 4.  RE: VCF API and postman

    Posted Jun 29, 2022 11:49 AM

    This is handy to if you want to pull all the SDDC Manager APIs into Postman: Create VMware Cloud Foundation API Collection in Postman – My Cloudy World (my-cloudy-world.com)