Created
May 31, 2023 09:30
-
-
Save h0hmj/18f3916f4bafb4ad7468ef56ead78eca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import requests | |
def _make_http_request_retard(url, payload: dict, method='GET'): | |
payload_str = "&".join("%s=%s" % (k, v) for k, v in payload.items()) | |
response = requests.request(method, url, params=payload_str) | |
return response.content | |
snapclone_api_url = "http://127.0.0.1:5555/SnapshotCloneService" | |
snapclone_api_version = "2018-01-01" | |
create_payload = dict(Action="CreateSnapshot", | |
Version=napclone_api_version, | |
User="username", | |
File="/image", | |
Name="image@snap0") | |
create_resp = _make_http_request_retard( | |
snapclone_api_url, | |
create_payload, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment