Get all records

get

/api/v1/reports/all

This API will retrieve all the ingested records. Filters can be applied using the query parameters.

Request

Supported Media Types
Query Parameters
Header Parameters
Back to Top

Response

Supported Media Types

200 Response

Successfully fetched records.
Body ()
Root Schema : Report
Type: object
Show Source
Nested Schema : rows
Type: array
Show Source
Nested Schema : ReportRow
Type: object
Show Source

400 Response

Bad request format. Check the response for more information on which fields are inaccurate. Ensure that you have a request which follows the format.
Body ()
Root Schema : Error
Type: object
Show Source

401 Response

Unauthorized get API call. See response for more details.
Body ()
Root Schema : Error
Type: object
Show Source

403 Response

Retrieving all records is forbidden. It is likely that the CASB APIs aren't enabled for the tenant.
Body ()
Root Schema : Error
Type: object
Show Source

404 Response

Requested Resource(instance ID) is not present.
Body ()
Root Schema : Error
Type: object
Show Source

500 Response

Internal Server error occured. See response for more details.
Body ()
Root Schema : Error
Type: object
Show Source

503 Response

Service is unavailable.
Body ()
Root Schema : Error
Type: object
Show Source

504 Response

Gateway timed out. Please retry.
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

The following example shows how to export data that is available through Report Builder in Oracle CASB Cloud Service.

Example Request Body

import requests
import json

def getAllData():
  auth_t = ''  ### add token id
  tenantId = ''  ### add tenantId

  headers = {
    'content-type': "application/json",
    'cache-control': "no-cache",
    'X-Apprity-Tenant-Id': tenantId,
    'Authorization': 'Bearer ' + auth_t
  }
  riskEventUrlTest = "https://api-<stackname>.palerra.net/api/v1/reports/all"

  startDate = "" ### startdate example - 2018-10-15T00:00:00.000Z
  endDate = "" ### Enddate example - 2018-10-15T00:00:00.000Z
  ### Please make sure the difference of start date and date should be only one day.
  nextMarkerPosition = ''
  polling = 'no'
  totalRecords = 0
  noOfCallsToCasb = 1
  parameterss = None

  while True:
    if (polling == "no"):
      parameterss = {
        'applicationInstanceName': "No_Del_AWS_Loric",
        'startDate': startDate,
        'endDate': endDate
      }
    elif (polling == "yes"):
      parameterss = {
        'markerPosition': nextMarkerPosition
      }
    print("noOfCallsToCasb:" + str(noOfCallsToCasb))
    print("totalRecords:" + str(totalRecords))
    noOfCallsToCasb += 1
    response = requests.get(riskEventUrlTest, params=parameterss, headers=headers)
    print("response.status_code " + str(response.status_code))
    rawJsonFromCASBResp = json.loads(response.content.decode('utf-8'))
    print(" ============ =========Response======== =======================>")
    print
    rawJsonFromCASBResp
    print("rawJsonFromCASBResp:" + str(rawJsonFromCASBResp))
    print("rawJsonFromCASBResp.content:" + str(rawJsonFromCASBResp['rows']))
    pageSize = rawJsonFromCASBResp['size']
    print("pageSize:" + str(pageSize))
    totalRecords += pageSize
    print("totalRecords:" + str(totalRecords))

    if (totalRecords > 0):
      if pageSize >= 100:
        polling = "yes"
        nextMarkerPosition = rawJsonFromCASBResp['nextMarkerPosition']
        print("nextMarkerPosition:" + str(nextMarkerPosition))
        print(" ===== ================= ==============================>")
      else:
        print("retrieved all records from casb /no records available")
        polling = "no"
        return


getAllData()

Example Response Body

The following example shows the contents of the response body in JSON format:

{
  "rows": [
    {
      "applicationType": "AWS",
      "applicationInstanceName": "No_Del_AWS_Trial",
      "applicationInstanceId": "8f5d028e-d7e8-4ad9-9a96-72f57ca9c8c1",
      "actor": "loric-thirdparty-session-1539733528152",
      "action": "Get account summary",
      "actionNormalized": "GETACCOUNTSUMMARY",
      "subType": "IAM",
      "ipAddress": "52.2.194.62",
      "ipAddressClassification": "Regular",
      "resource": "{}",
      "resourceType": "IAM Account",
      "deviceType": "API Call",
      "userAgent": "aws-sdk-java/1.11.290",
      "platform": "Linux",
      "city": "Ashburn",
      "state": "Virginia",
      "country": "US",
      "latitude": "39.0329",
      "longitude": "-77.4866",
      "eventTime": "2018-10-16T23:58:07Z",
      "rowId": "8a5e1fe8-d406-462f-95ef-5414e3e4a773"
    },
    {
      "applicationType": "AWS",
      "applicationInstanceName": "No_Del_AWS_Trial",
      "applicationInstanceId": "8f5d028e-d7e8-4ad9-9a96-72f57ca9c8c1",
      "actor": "loric-thirdparty-session-1539733528152",
      "action": "REST.GET.ACL",
      "actionNormalized": "REST_GET_ACL",
      "subType": "S3",
      "ipAddress": "52.2.194.62",
      "ipAddressClassification": "Regular",
      "resource": "/trail.auto.bucket.no.delete",
      "resourceType": "S3 Bucket",
      "deviceType": "API Call",
      "userAgent": "aws-sdk-java/1.11.290",
      "platform": "Other",
      "city": "Ashburn",
      "state": "Virginia",
      "country": "US",
      "latitude": "39.0329",
      "longitude": "-77.4866",
      "eventTime": "2018-10-16T23:58:07Z",
      "rowId": "f50f62b3-8a85-353b-953f-cb2f59633aea"
    }
  ],
  "nextMarkerPosition": "eyJhcHBpbnN0bmFtZSI6Ik5vX0RlbF9BV1NfVHJpYWwiLCJlbmREYXRlIjoiMTUzOTY0ODAwMDAwMCIsInBhZ2VTaXplIjoiMTAwIiwicGFnZSI6IjIiLCJzdGFydERhdGUiOiIxNTM5NTYxNjAwMDAwIn0=",
  "totalCount": 144748,
  "size": 100
}
Back to Top