Obtenir des informations sur vos logs d’API

Vous pouvez obtenir des informations sur vos logs d’API avec Cockpit v2 ou la méthode ReadApiLogs. Pour en savoir plus, voir À propos d’OMS.

Obtenir des informations sur vos logs d’API avec Cockpit v2

  1. Dans le coin supérieur droit, cliquez sur l’icône IconProfil.
    Un menu déroulant apparaît.

  2. Cliquez sur IconAPILogs Logs d’API.
    La liste de vos logs d’API apparaît.

    Les logs sont consultables pendant 32 jours maximum.

Obtenir des informations sur vos logs d’API avec OSC CLI

À ce jour, cette section est disponible en anglais uniquement.

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.
By default, the retrieved interval is 48 hours. If neither of the QueryDateBefore nor QueryDateAfter parameters are specified, logs from the past 48 hours are retrieved. If you only specify one of two, logs are retrieved from a 2-day interval based on the date you provided. To retrieve logs beyond a 2-day interval, specify both parameters.

For more information, see About OMS.

Request sample
$ 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 (between 1`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.

Result sample
{
  "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"
    }
  ]
}

Pages connexes

Méthode API correspondante