Filesystems/{filesystemName}/audit: PUT

Enable or disable file audit logging for a file system.

Availability

Available on all IBM Storage Scale editions.

Description

The PUT /filesystems/{filesystemName}/audit request enables or disables file audit logging for a specific file system. For more information about the fields in the data structures that are returned, see mmaudit command.

Request URL

https://<IP address or host name of API server>:<port>/scalemgmt/v2/filesystems/filesystemName/audit
where
filesystems/filesystemName/audit
Specifies that file audit logging is going to be enabled or disabled for the specific file system. Required.

Request headers

Content-Type: application/json
Accept: application/json

Request parameters

The following parameters can be used in the request URL to customize the request:
Table 1. List of request parameters
Parameter name Description and applicable keywords Required/optional
filesystemName The file system name. You can also use keywords such as :all:, :all_local:, or :all_remote: Required.

Request data


{        
         "action": "enable | disable"
         "fileAuditLogConfig": 
          {
          
         "auditFilesetName": ".audit_log",     
         "auditRetention": "Retention Period", 
         "eventTypes": "ACLCHANGE, CLOSE, CREATE, GPFSATTRCHANGE, OPEN, RENAME, RMDIR, UNLINK, XATTRCHANGE", 
          }
}
"action": "enable | disable"
Enable or disable file audit logging for the specified file system.
"FileAuditLogConfig"
"auditFilesetName": ".audit_log"
The name of the fileset in which the file audit log records must reside.
"auditRetention": "RetentionPeriod "
The number of days for which the file audit logs are retained.
"eventTypes": "ACLCHANGE,CLOSE,CREATE,GPFSATTRCHANGE,OPEN,RENAME,RMDIR,UNLINK,XATTRCHANGE"
The event types that are included in the file audit logs.

Response data

{
    "status": {
      "code":ReturnCode",
      "message":"ReturnMessage"
   },
   jobs: [
      {
         "result":"", 
           { 
             "commands":"String",
             "progress":"String,
             "exitCode":"Exit code",
             "stderr":"Error",
             "stdout":"String",
           },
         "request":" ",
           {
             "type":"{GET | POST | PUT | DELETE}",
             "url":"URL",
             "data":""",
           }
         "jobId":"ID",
         "submitted":"Time",
         "completed":Time",
         "status":"Job status",
         }   
        ],
   }
For more information about the fields in the following data structures, see the links at the end of this topic.
"status":
Return status.
"message": "ReturnMessage",
The return message.
"code": ReturnCode
The return code.
"paging"
The URL to retrieve the next page. Paging is enabled when more than 1000 objects are returned by the query.
"status":
Return status.
"message": "ReturnMessage",
The return message.
"code": ReturnCode
The return code.
"jobs":
An array of elements that describe jobs. Each element describes one job.
"result"
"commands":"String'
Array of commands that are run in this job.
"progress":"String'
Progress information for the request.
"exitCode":"Exit code"
Exit code of command. Zero is success, nonzero denotes failure.
"stderr":"Error"
CLI messages from stderr.
"stdout":"String"
CLI messages from stdout.
"request"
"type":"{GET | POST | PUT | DELETE}"
HTTP request type.
"url":"URL"
The URL through which the job is submitted.
"data":" "
Optional.
"jobId":"ID",
The unique ID of the job.
"submitted":"Time"
The time at which the job was submitted.
"completed":Time"
The time at which the job was completed.
"status":"RUNNING | COMPLETED | FAILED"
Status of the job.

Examples

The following example enables file audit logging for the file system fs1.

Request URL:
curl -k -u admin:admin001 -X PUT --header 'content-type:application/json' --header 'accept:application/json' '{ \ 
   "action": "enable", \ 
   "fileAuditLogConfig": { \ 
   "auditFilesetName": ".audit_log", \ 
     "auditRetention": 365, \ 
     "eventTypes": "ACLCHANGE,CLOSE,CREATE,GPFSATTRCHANGE,OPEN,RENAME,RMDIR,UNLINK,XATTRCHANGE" \ 
   } \ 
 }'
'https://198.51.100.1:443/scalemgmt/v2/filesystems/fs1/audit'
The request URL with no field or filter parameter returns only the details that uniquely identify the object.
Response data:
Note: In the JSON data that is returned, the return code indicates whether the command is successful. The response code 200 indicates that the command successfully retrieved the information. Error code 400 represents an invalid request and 500 represents internal server error.
{
  "jobs": [
    {
      "jobId": 1000000000018,
      "status": "COMPLETED",
      "submitted": "2022-05-26 06:02:34,761",
      "completed": "2022-05-26 06:02:46,806",
      "runtime": 12045,
      "request": {
        "type": "PUT",
        "url": "/scalemgmt/v2/filesystems/fs1/audit"
      },
      "result": {
        "progress": [],
        "commands": [
          "mmaudit 'fs1' enable --log-fileset '.audit_log' --retention 365 --events 'ACLCHANGE,CLOSE,CREATE,GPFSATTRCHANGE,OPEN,RENAME,RMDIR,UNLINK,XATTRCHANGE'     --filesets 'fset1' "
        ],
        "stdout": [
          "[I] Finished validating 1 filesets.",
          "[I] Successfully verified filesets for File Audit Logging type: FILESET",
          "[I] Successfully updated File Audit Logging configuration for device: fs1",
          "[I] Successfully checked or created File Audit Logging global catchall and config fileset skip partitions for device: fs1",
          "[I] Successfully created/linked File Audit Logging audit fileset .audit_log with link point /gpfs/fs1/.audit_log",
          "[I] Finished updating 1 filesets.",
          "[I] Successfully created File Audit Logging policy partition(s) to audit device: fs1",
          "[I] Successfully enabled File Audit Logging for device: fs1",
          "EFSSG1180I The file audit logging is successfully enabled for file system fs1."
        ],
        "stderr": [],
        "exitCode": 0
      },
      "pids": []
    }
  ],
  "status": {
    "code": 200,
    "message": "The request finished successfully.