Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- odxvchsauth = <src_authcode> # source authcode (parsed as header)
- session_ID = <dest_authcode> # destination authcode (parsed as header)
- srcurl = "https://us-texas-1-14.vchs.vmware.com/api/compute/transfer/75b72a35-e0c1-4f50-a728-bd01fc311c09/file"
- desturl = "https://66.70.145.232:443/cls/data/19dcf53b-d98d-41f7-be78-853f2f85e145/test.iso"
- def upload():
- srcget = requests.get(srcurl, stream = True, headers = = {'Accept': 'application/*+xml;version=5.7', 'x-vcloud-authorization': odxvchsauth})
- for chunk in srcget.iter_content(chunksize = 1048576):
- uploadput = requests.put(desturl, data = chunk, stream = True, {'vmware-api-session-id': session_ID, 'Accept': 'application/json', 'Content-Type': 'application/octet-stream'}
- upload()
Add Comment
Please, Sign In to add comment