Returns information about the access key IDs associated with the specified IAM user. If there are none, the operation returns an empty list.
curl -X GET https://iam.amazonaws.com/ \
-d "Action=ListAccessKeys" \
-d "UserName=Alice" \
-d "Version=2010-05-08"
Dim rest As New Chilkat.Rest
Dim success As Boolean
Dim authAws As New Chilkat.AuthAws
authAws.AccessKey = "AWS_ACCESS_KEY"
authAws.SecretKey = "AWS_SECRET_KEY"
authAws.Region = "us-east-1"
authAws.ServiceName = "iam"
rest.SetAuthAws(authAws)
// URL: https://iam.amazonaws.com/
Dim bTls As Boolean
bTls = True
Dim port As Int32
port = 443
Dim bAutoReconnect As Boolean
bAutoReconnect = True
success = rest.Connect("iam.amazonaws.com",port,bTls,bAutoReconnect)
If (success <> True) Then
System.DebugLog("ConnectFailReason: " + Str(rest.ConnectFailReason))
System.DebugLog(rest.LastErrorText)
Return
End If
rest.AddQueryParam("Action","ListAccessKeys")
rest.AddQueryParam("UserName","Alice")
rest.AddQueryParam("Version","2010-05-08")
Dim sbResponseBody As New Chilkat.StringBuilder
success = rest.FullRequestNoBodySb("GET","/",sbResponseBody)
If (success <> True) Then
System.DebugLog(rest.LastErrorText)
Return
End If
Dim respStatusCode As Int32
respStatusCode = rest.ResponseStatusCode
If (respStatusCode >= 400) Then
System.DebugLog("Response Status Code = " + Str(respStatusCode))
System.DebugLog("Response Header:")
System.DebugLog(rest.ResponseHeader)
System.DebugLog("Response Body:")
System.DebugLog(sbResponseBody.GetAsString())
Return
End If
Dim xmlResponse As New Chilkat.Xml
xmlResponse.LoadSb(sbResponseBody,True)
Dim ListAccessKeysResponse_xmlns As String
Dim tagPath As String
Dim IsTruncated As String
Dim i As Int32
Dim count_i As Int32
Dim AccessKeyId As String
Dim UserName As String
Dim CreateDate As String
Dim Status As String
Dim RequestId As String
ListAccessKeysResponse_xmlns = xmlResponse.GetAttrValue("xmlns")
IsTruncated = xmlResponse.GetChildContent("ListAccessKeysResult|IsTruncated")
i = 0
count_i = xmlResponse.NumChildrenHavingTag("ListAccessKeysResult|AccessKeyMetadata|member")
While i < count_i
xmlResponse.I = i
AccessKeyId = xmlResponse.GetChildContent("ListAccessKeysResult|AccessKeyMetadata|member[i]|AccessKeyId")
UserName = xmlResponse.GetChildContent("ListAccessKeysResult|AccessKeyMetadata|member[i]|UserName")
CreateDate = xmlResponse.GetChildContent("ListAccessKeysResult|AccessKeyMetadata|member[i]|CreateDate")
Status = xmlResponse.GetChildContent("ListAccessKeysResult|AccessKeyMetadata|member[i]|Status")
i = i + 1
Wend
RequestId = xmlResponse.GetChildContent("ResponseMetadata|RequestId")
<?xml version="1.0" encoding="utf-8" ?>
<ListAccessKeysResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
<ListAccessKeysResult>
<IsTruncated>false</IsTruncated>
<AccessKeyMetadata>
<member>
<AccessKeyId>AKIAJPBXVVQ4JLJVSHHQ</AccessKeyId>
<UserName>Alice</UserName>
<CreateDate>2018-05-19T21:44:03Z</CreateDate>
<Status>Active</Status>
</member>
<member>
<AccessKeyId>AKIAJ7HF6R6JLP3XRM7A</AccessKeyId>
<UserName>Alice</UserName>
<CreateDate>2018-05-19T21:44:08Z</CreateDate>
<Status>Active</Status>
</member>
</AccessKeyMetadata>
</ListAccessKeysResult>
<ResponseMetadata>
<RequestId>f6d76095-5bad-11e8-8cbd-a7ba7e4ddf2a</RequestId>
</ResponseMetadata>
</ListAccessKeysResponse>