Interaction with OpsCode Chef HTTP REST API from vCenter Orchestrator v5.1 Update 1
I need to be able to use the HTTP REST API to initiate commands against the Chef server during provisioning and decommissioning of virtual machines.
This requires the ability to use the SHA1 algorithm and also the Base64 algorithm within vCenter Orchestrator v5.1 Update 1 to create the hashes header.
Method:HTTP_METHOD
Hashed Path:HASHED_PATH
X-Ops-Content-Hash:HASHED_BODY
X-Ops-Timestamp:TIME
X-Ops-UserId:USERID
where:
The server de-crypts this header and ensures its content matches the content of the non-encrypted headers that were in the request. The time stamp of the message is checked to ensure the request was received within a reasonable amount of time. One approach generating the signed headers is to use mixlib-authentication, which is a class-based header signing authentication object similar to the one used by the chef-client.
Any help with this would be greatly appreciated.
Perfect timing! I've just been finalizing the docs and testing of a package for the Chef Server API this week:
Let me know how it works for you! Plus if there are other endpoints or scenarios I missed they should be easy to add.
Joerg and I are reaching out to people in VMware who worked on chef integration.
...forwarded to colleagues, hopefully we get some answer soon 🙂
Cheers,
Joerg
Perfect timing! I've just been finalizing the docs and testing of a package for the Chef Server API this week:
Let me know how it works for you! Plus if there are other endpoints or scenarios I missed they should be easy to add.
Which version of Chef were you using the plugin and workflows with ?
It was developed and tested against Chef open source 11.0.8 and validated against a version of private Chef (I don't recall the version though). It's designed to work with all three variations: open source, private, hosted.
Trying this agains both an older version and 11.10, can't seem to get past this: ReferenceError: "ChefAuthUtil" is not defined. (Dynamic Script Module name : executeRequest#32)
That object is part of the associated plugin with the package (o11nplugin-chef.dar). Did you install in as a plugin through the orchestrator configuration interface and restart the orchestrator service?
Reboot of Orchestrator host did it. Seems that's bit me, yet again I didn't realize right away I had posted in someone else's thread, but perhaps this will help the next person.