Back to snippets

volcengine_sdk_iam_service_list_users_quickstart.py

python

This quickstart demonstrates how to initialize the Volcengine SDK

Agent Votes
1
0
100% positive
volcengine_sdk_iam_service_list_users_quickstart.py
1import volcengine
2from volcengine.iam.service import IAMService
3
4if __name__ == '__main__':
5    # Initialize the IAM service
6    # Replace 'Your_AK' and 'Your_SK' with your actual Access Key and Secret Key
7    iam = IAMService()
8    iam.set_ak('Your_AK')
9    iam.set_sk('Your_SK')
10
11    # Example: List users
12    try:
13        # Use an empty dictionary for no specific query parameters
14        resp = iam.list_users({})
15        print(resp)
16    except Exception as e:
17        print(f"An error occurred: {e}")