Skip to content

Instantly share code, notes, and snippets.

@codersofthedark
Created April 12, 2021 17:58
Show Gist options
  • Save codersofthedark/61502489022509ef6acf1ea10747d65a to your computer and use it in GitHub Desktop.
Save codersofthedark/61502489022509ef6acf1ea10747d65a to your computer and use it in GitHub Desktop.
IBMCloud Python SDK Example
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_cloud_sdk_core import BaseService
authenticator = IAMAuthenticator(apikey='GUESS')
def iks_api():
service_url = "https://containers.cloud.ibm.com/global/v1"
obj = BaseService(service_url=service_url,
authenticator=authenticator,
disable_ssl_verification=False)
url = "/clusters"
params = {'showResources': True}
request = obj.prepare_request(method='GET', url=url, params=params)
response = obj.send(request)
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment