Created
April 12, 2021 17:58
-
-
Save codersofthedark/61502489022509ef6acf1ea10747d65a to your computer and use it in GitHub Desktop.
IBMCloud Python SDK Example
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
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