Getting Information About Your API Logs
You can get information about your API logs with Cockpit v2 or the ReadApiLogs method. For more information, see About OMS.
Getting Information About Your API Logs Using Cockpit v2
-
In the top right corner, click the icon.
A drop-down menu appears. -
Click API Logs.
The list of your API logs appears.Past logs are accessible for up to 32 days.
Getting Information About Your API Logs Using OSC CLI
The ReadApiLogs command lists the logs of the API calls you have performed with this account.
Past logs are accessible for up to 32 days. For more information, see About OMS. |
$ osc-cli api ReadApiLogs --profile "default" \
--Filters '{
"QueryIpAddresses": ["192.0.2.0", "198.51.100.0"],
"QueryDateAfter": "2017-05-10",
"QueryDateBefore": "2017-05-10",
}'
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
Filters
: (optional) One or more filters. -
NextPageToken
: (optional) The token to request the next page of results. Each token refers to a specific page. -
ResultsPerPage
: (optional) The maximum number of logs returned in a single response (between1`and `1000
, both included). By default,100
. -
With
: (optional) The information to display in each returned log.
The ReadApiLogs command returns the following elements:
-
Logs
: Information about one or more logs. -
NextPageToken
: The token to request the next page of results. Each token refers to a specific page. -
ResponseContext
: Information about the context of the response.
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Logs": [
{
"ResponseStatusCode": 200,
"ResponseSize": 1887,
"QueryPayloadRaw": "{}",
"QueryApiName": "oapi",
"QueryIpAddress": "192.0.2.0",
"QueryUserAgent": "oAPI CLI v0.1 - 2018-09-28",
"CallDuration": 47,
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157",
"QueryApiVersion": "1.27",
"AccountId": "123456789012",
"QueryPayloadSize": 2,
"QueryCallName": "ReadAccessKeys",
"QueryAccessKey": "ABCDEFGHIJ0123456789",
"QueryHeaderSize": 287,
"QueryDate": "2017-05-10T12:34:56.789Z",
"QueryHeaderRaw": "Host: api.eu-west-2.outscale.com\\nAccept: */*\\nConnection: close\\nUser-Agent: oAPI CLI v0.1 - 2018-09-28\\nX-Osc-Date: 20170510T000000Z\\nContent-Type: application/json; charset=utf-8\\nAuthorization: *****\\nContent-Length: 2\\nAccept-Encoding: gzip, deflate\\nX-Forwarded-For: 192.0.2.0"
}
]
}
Related Pages
Corresponding API Method