Closed littleccguy closed 1 year ago
I believe I was able to solve my issue. Here is what I did in case someone else needs this as well.
usrPass = "{}:{}".format(args.username, args.password.value)
base64String = base64.b64encode(bytes(usrPass, 'ascii')).decode('ascii')
print(base64String)
api_response = session.post(url="https://{}/api/session".format(args.server),
headers={"Authorization": "Basic {}".format(base64String), "Connection": "keep-alive", "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br"})
api_key = api_response.text.strip("\"")
vsphere_client = create_vsphere_client(server=args.server, username=args.username, password=args.password.value, session=session)
vsphere_client.session.headers.update({"vmware-api-session-id": api_key})
At this poini, I can do things like get, and patch
vsphere_client.session.get(url="https://{}/api/vcenter/vm/{}/hardware/cpu".format(args.server, vm_id) )
Is your feature request related to a problem? Please describe.
I love this python SDK. I am able to teardown and recreate vms using clone_task, and it makes my life so much easier. However, that is only part of what I need. I need to modify the new vms after they are created.
Describe the solution you'd like
Describe alternatives you've considered
No response
Additional context
No response