We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BearerAuthentication
IAMClient might also want to throw an exception for that too.
I'd rather not set the URL specifically incase someone is using a non-standard api endpoint or something
The text was updated successfully, but these errors were encountered:
Also, add docs on how to use IAMClient
rough example
import requests import SoftLayer hdrs = { 'Accept' : 'application/json', 'Content-Type' : 'application/x-www-form-urlencoded' } params = { 'grant_type' : 'urn:ibm:params:oauth:grant-type:apikey', 'apikey' : '32characterLongAPIKEYhere' } resp = requests.post('https://iam.cloud.ibm.com/identity/token', data = params, headers = hdrs) assert resp.status_code in (200, 202) json = resp.json() auth = SoftLayer.auth.BearerAuthentication('', json['access_token']) client = SoftLayer.API.IAMClient(auth = auth) debugger = SoftLayer.DebugTransport(client.transport) client.transport = debugger try: result = client['SoftLayer_Account'].getObject() print(result['id']) print("======== RESULT ========") except Exception as e: print(e) for call in client.transport.get_last_calls(): print(client.transport.print_reproduceable(call)) """ $> python test.py Calling: SoftLayer_Account::getObject(id=None, mask='', filter='None', args=(), limit=None, offset=None)) 307608 ======== RESULT ======== curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" -H "Authorization: Bearer aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaTHIS IS THE WHERE THE TOKEN WOULD BE....aaaaaaaaaaaaaaaaaaaa" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getObject.json' """"
Sorry, something went wrong.
allmightyspiff
No branches or pull requests
BearerAuthentication
IAMClient might also want to throw an exception for that too.
I'd rather not set the URL specifically incase someone is using a non-standard api endpoint or something
The text was updated successfully, but these errors were encountered: