Created
April 19, 2017 07:20
-
-
Save daharon/f467981836fa2dc232968c07e0a12e06 to your computer and use it in GitHub Desktop.
Calling Akamai's HTTPDownloadReportService
This file contains hidden or 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
| appdirs==1.4.3 | |
| cached-property==1.3.0 | |
| defusedxml==0.5.0 | |
| isodate==0.5.4 | |
| lxml==3.7.3 | |
| packaging==16.8 | |
| pyparsing==2.2.0 | |
| pytz==2017.2 | |
| requests==2.13.0 | |
| requests-toolbelt==0.7.1 | |
| six==1.10.0 | |
| zeep==1.4.1 |
This file contains hidden or 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/env python | |
| from requests import Session | |
| from requests.auth import HTTPBasicAuth | |
| from zeep import Client | |
| from zeep.transports import Transport | |
| CPCODE = 12345 | |
| DATE = '20170416' | |
| WSDL_URL = 'https://control.akamai.com/nmrws/services/HttpDownloadsReportService?wsdl' | |
| session = Session() | |
| session.auth = HTTPBasicAuth('username', 'password') | |
| client = Client(WSDL_URL, | |
| transport=Transport(session=session)) | |
| # getTopDownloadsByCountryForCPCode(cpcode: xsd:int, date: xsd:string, columns: ns0:ArrayOfString) | |
| # -> getTopDownloadsByCountryForCPCodeReturn: xsd:string | |
| factory = client.type_factory('ns0') | |
| result = client.service.getTopDownloadsByCountryForCPCode( | |
| CPCODE, DATE, factory.ArrayOfString(['ignored'])) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: