日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

使用ActionTrail Python SDK

發(fā)布時間:2023/11/29 python 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用ActionTrail Python SDK 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

ActionTrail提供官方的Python SDK。本文將簡單介紹一下如何使用ActionTrail的Python SDK。

安裝Aliyun Core SDK。

pip install aliyun-python-sdk-core

安裝ActionTrail Python SDK。

pip install aliyun-python-sdk-actiontrail

下面是測試的代碼。調(diào)用LookupEventsRequest獲取所有CreateRole事件。

#!/usr/bin/env python #coding=utf-8from aliyunsdkcore import client from aliyunsdkactiontrail.request.v20171204 import LookupEventsRequestclt = client.AcsClient('您的AK id', '您的AK secret', 'cn-hangzhou')request = LookupEventsRequest.LookupEventsRequest() request.set_EventName('CreateRole')response = clt.do_action_with_exception(request)print response

執(zhí)行代碼。

$ python actiontrail_test.py | python -m json.tool {"EndTime": "2018-04-09T00:47:11Z","Events": [{"acsRegion": "cn-hangzhou","apiVersion": "2015-05-01","eventId": "9554F0A2-DA47-4390-A21C-F3D56CF6CCC0","eventName": "CreateRole","eventSource": "ram-share.aliyuncs.com","eventTime": "2018-04-08T17:27:29Z","eventType": "ApiCall","eventVersion": "1","isGlobal": true,"referencedResources": {"Role": ["AliyunStreamDefaultRole"]},"requestId": "9554F0A2-DA47-4390-A21C-F3D56CF6CCC0","requestParameters": {"AssumeRolePolicyDocument": "\"{\\\\\\\"Statement\\\\\\\":[{\\\\\\\"Action\\\\\\\":\\\\\\\"sts:AssumeRole\\\\\\\",\\\\\\\"Effect\\\\\\\":\\\\\\\"Allow\\\\\\\",\\\\\\\"Principal\\\\\\\":{\\\\\\\"Service\\\\\\\":[\\\\\\\"stream.aliyuncs.com\\\\\\\"]}}],\\\\\\\"Version\\\\\\\":\\\\\\\"1\\\\\\\"}\"","Description": "\"\u6d41\u8ba1\u7b97\u670d\u52a1\u9ed8\u8ba4\u4f7f\u7528\u6b64\u89d2\u8272\u6765\u8bbf\u95ee\u60a8\u5728\u5176\u4ed6\u4e91\u4ea7\u54c1\u4e2d\u7684\u8d44\u6e90\"","HostId": "\"ram-share.aliyuncs.com\"","RequestId": "\"9554F0A2-DA47-4390-A21C-F3D56CF6CCC0\"","RoleName": "\"AliyunStreamDefaultRole\"","SecureTransport": "\"true\"","needarrayitemname": "\"true\""},"serviceName": "Ram","sourceIpAddress": "121.0.29.156","userIdentity": {"accountId": "1532770894211314","principalId": "1532770894211314","sessionContext": {"attributes": {"creationDate": "2018-04-08T17:27:29Z","mfaAuthenticated": "false"}},"type": "root-account","userName": "root"}} }

總結(jié)

以上是生活随笔為你收集整理的使用ActionTrail Python SDK的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。