The Audit Manager web service allows services to create, and users to read PASTA audit records (also known as "audit log entries").
An auditRecord
XML element will always consist of these required sub-elements:
Other optional elements are of the following:
Note that 'oid' and 'entryTime' values are automatically generated by the Audit Manager when new audit entries are created. Thus, although they are technically optional elements, they will always be present in audit records that are read from PASTA.
Request Summary |
|
---|---|
HTTP Verb : Relative URL | Brief description |
POST | Create Audit Record operation, creates a new logged entry in the Audit Manager's logging database. |
GET : report/{oid} | Get Audit Record operation, retrieves a single audit record based on the audit identifier value specified in the path. |
GET : report | Get Audit Report operation, gets a list of zero or more audit records matching the query parameters as specified in the request. |
GET : csvreport | Get Audit CSVReport operation, gets a list of zero or more audit records matching the query parameters as specified in the request and streams back a comma separated values result set. |
GET : count | Get Audit Count operation, returns the count of audit log records from the audit table (named "eventlog") matching the provided criteria. |
GET : recent-uploads | Get Recent Uploads operation, gets a list of zero or more audit records of either recently inserted or recently updated data packages, as specified in the request. |
GET : reads/{scope}/{identifier} | Get DocId Reads operation, returns an XML-formatted list that summarizes all the successful reads (total reads and non-robot reads) for all the resources of a given PASTA document ID, where a document ID is of the format "scope. |
GET : reads/{scope}/{identifier}/{revision} | Get PackageId Reads operation, returns an XML-formatted list that summarizes all the successful reads (total reads and non-robot reads) for all the resources of a given PASTA package ID, where a package ID is of the format "scope. |
Request Detail |
---|
POST | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Create Audit Record operation, creates a new logged entry in the Audit Manager's logging database. Request entity:
The request entity should be an XML document (MIME type
<auditRecord> <category> The <auditRecord> <category>warn</category> <service>DataPackageManager-1.0</service> <serviceMethod>listDataEntities</serviceMethod> <responseStatus>404</responseStatus> <resourceId></resourceId> <user>uid=ucarroll,o=LTER,dc=ecoinformatics,dc=org</user> <userAgent>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36</userAgent> <groups>authenticated</groups> <authSystem>https://pasta.edirepository.org/authentication</authSystem> <entryText>No entity resources found for scope abc</entryText> </auditRecord> Responses:
|
GET : report/{oid} | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get Audit Record operation, retrieves a single audit record based on the audit identifier value specified in the path. Requests:
Responses:If the request is successful, the response will contain xml.
|
GET : report | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get Audit Report operation, gets a list of zero or more audit records matching the query parameters as specified in the request. Query Parameters:
The query parameters fromTime and optionally
toTime should be used to indicate a time span. When
toTime is absent, the report will consist of all matching
records up to the current time. Either of these parameters may only be
used once.
The query parameter limit sets an upper limit on the number
of audit records returned. For example, "limit=1000".
The query parameter resourceId will match any audit log entry whose resourceId
value contains the specified string value. Thus, a query parameter of "resourceId=knb-lter-and"
will match any audit log entry whose resourceId value contains the substring "knb-lter-and",
while a query parameter of "resourceId=knb-lter-and/2719/6" will match any audit log entry
whose resourceId value contains the substring "knb-lter-and/2719/6".
Responses:If the request is successful, the response will contain XML text.
|
GET : csvreport | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get Audit CSVReport operation, gets a list of zero or more audit records matching the query parameters as specified in the request and streams back a comma separated values result set. Query Parameters:
The query parameters fromTime and optionally
toTime should be used to indicate a time span. When
toTime is absent, the report will consist of all matching
records up to the current time. Either of these parameters may only be
used once.
The query parameter limit sets an upper limit on the number
of audit records returned. For example, "limit=1000".
The query parameter resourceId will match any audit log entry whose resourceId
value contains the specified string value. Thus, a query parameter of "resourceId=knb-lter-and"
will match any audit log entry whose resourceId value contains the substring "knb-lter-and",
while a query parameter of "resourceId=knb-lter-and/2719/6" will match any audit log entry
whose resourceId value contains the substring "knb-lter-and/2719/6".
Responses:If the request is successful, the response will contain applications/csv text.
|
GET : count | |||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get Audit Count operation, returns the count of audit log records from the audit table (named "eventlog") matching the provided criteria. Query Parameters:
The query parameters fromTime and optionally
toTime should be used to indicate a time span. When
toTime is absent, the count will include of all matching
records up to the current time. Either of these parameters may only be
used once.
The query parameter limit sets an upper limit on the number
of audit records returned. For example, "limit=1000".
The query parameter resourceId will match any audit log entry whose resourceId
value contains the specified string value. Thus, a query parameter of "resourceId=knb-lter-and"
will match any audit log entry whose resourceId value contains the substring "knb-lter-and",
while a query parameter of "resourceId=knb-lter-and/2719/6" will match any audit log entry
whose resourceId value contains the substring "knb-lter-and/2719/6".
Requests:
Responses:If the request is successful, the response will contain text.
|
GET : recent-uploads | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get Recent Uploads operation, gets a list of zero or more audit records of either recently inserted or recently updated data packages, as specified in the request. Query Parameters:
The query parameter serviceMethod should have the value
"createDataPackage" (to retrieve recent inserts) or "updateDataPackage"
(to retrieve recent updates)
The query parameter fromTime is used to specify the
date/time in the past that represents the oldest audit records that should be
returned. Data packages uploaded prior to that time are not considered
recent uploads and are thus filtered from the query results.
The query parameter limit sets an upper limit on the number
of audit records returned. For example, "limit=3".
Responses:If the request is successful, the response will contain XML text.
|
GET : reads/{scope}/{identifier} | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get DocId Reads operation, returns an XML-formatted list that summarizes all the successful reads (total reads and non-robot reads) for all the resources of a given PASTA document ID, where a document ID is of the format "scope.identifier" (excludes revision). Note: as of 23 November 2022, robot-based events are no longer recorded. For this reason, total reads and non-robot reads will increase at the same rate. Responses:
If the request is successful, the response will contain XML text. For example, when scope is "edi" and identifier is "0", the XML returned might look as follows: <?xml version="1.0" encoding="UTF-8"?> <resourceReads> <resource> <resourceId>https://pasta-d.lternet.edu/package/eml/edi/0/0</resourceId> <resourceType>dataPackage</resourceType> <scope>edi</scope> <identifier>0</identifier> <revision>0</revision> <totalReads>29</totalReads> <nonRobotReads>22</nonRobotReads> </resource> <resource> <resourceId>https://pasta-d.lternet.edu/package/metadata/eml/edi/0/0</resourceId> <resourceType>metadata</resourceType> <scope>edi</scope> <identifier>0</identifier> <revision>0</revision> <totalReads>41</totalReads> <nonRobotReads>34</nonRobotReads> </resource> <resource> <resourceId>https://pasta-d.lternet.edu/package/report/eml/edi/0/0</resourceId> <resourceType>report</resourceType> <scope>edi</scope> <identifier>0</identifier> <revision>0</revision> <totalReads>1</totalReads> <nonRobotReads>1</nonRobotReads> </resource> <resource> <resourceId>https://pasta-d.lternet.edu/package/report/eml/edi/0/1</resourceId> <resourceType>report</resourceType> <scope>edi</scope> <identifier>0</identifier> <revision>1</revision> <totalReads>1</totalReads> <nonRobotReads>1</nonRobotReads> </resource> <resource> <resourceId>https://pasta-d.lternet.edu/package/eml/edi/0/1</resourceId> <resourceType>dataPackage</resourceType> <scope>edi</scope> <identifier>0</identifier> <revision>1</revision> <totalReads>7</totalReads> <nonRobotReads>7</nonRobotReads> </resource> </resourceReads> |
GET : reads/{scope}/{identifier}/{revision} | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get PackageId Reads operation, returns an XML-formatted list that summarizes all the successful reads (total reads and non-robot reads) for all the resources of a given PASTA package ID, where a package ID is of the format "scope.identifier.revision". Note: as of 23 November 2022, robot-based events are no longer recorded. For this reason, total reads and non-robot reads will increase at the same rate. Responses:
If the request is successful, the response will contain XML text. For example, when scope is "edi" and identifier is "0" and revision is "0", the XML returned might look as follows: <?xml version="1.0" encoding="UTF-8"?> <resourceReads> <resource> <resourceId>https://pasta-d.lternet.edu/package/eml/edi/0/0</resourceId> <resourceType>dataPackage</resourceType> <scope>edi</scope> <identifier>0</identifier> <revision>0</revision> <totalReads>29</totalReads> <nonRobotReads>22</nonRobotReads> </resource> <resource> <resourceId>https://pasta-d.lternet.edu/package/metadata/eml/edi/0/0</resourceId> <resourceType>metadata</resourceType> <scope>edi</scope> <identifier>0</identifier> <revision>0</revision> <totalReads>41</totalReads> <nonRobotReads>34</nonRobotReads> </resource> <resource> <resourceId>https://pasta-d.lternet.edu/package/report/eml/edi/0/0</resourceId> <resourceType>report</resourceType> <scope>edi</scope> <identifier>0</identifier> <revision>0</revision> <totalReads>1</totalReads> <nonRobotReads>1</nonRobotReads> </resource> </resourceReads> |