Example: Checking the integrity of all file spaces

You can check the integrity of all file spaces by submitting an HTTP request to the WebSphere® MQ File Transfer Edition Web Gateway. For example, if you are restoring a file system after data loss, you can check that the files in a file space exist in the correct location on the file system. The Web Gateway returns a response in XML or JSON format that lists the names of the file spaces, and an attribute to indicate whether the file space entry matches the files in the file system.

About this task

Use the Web Gateway administration API to request a list of all the file spaces that currently exist. A successful request returns an HTTP status code of 200 and a payload that describes at most 100 file spaces. In this example, the server hosting the WebSphere MQ File Transfer Edition Web Gateway is example.com. There are currently three file spaces, belonging to the users richard, suzanne and hamilton. The user who is requesting the information is associated with the security role wmqfte-admin. The header Accept: application/xml specifies that the query returns the results in XML format. The header x-fte-check-integrity specifies that every file space should be checked to ensure a matching directory exists on the file system.

Procedure

  1. Create an HTTP request with the following format:
    GET HTTP/1.1 /admin/filespace/
    Host: example.com
    User-Agent: mozilla
    Accept: application/xml
    x-fte-check-integrity: true
  2. Submit the request to the Web Gateway. The Web Gateway returns an HTTP response with the following format:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Content-Type: application/xml
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <filespaces xsi:noNamespaceSchemaLocation="FileSpaceInfo.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <filespace transfers="0" location="/mnt/gateway/richard" name="richard" integrity-check-result="OK">
            <quota bytes="1048576"/>
            <writers>
                <authorized>
                    <agent-user>charlene</agent-user>
                    <agent-user>alan</agent-user>
                </authorized>
            </writers>
        </filespace>
        <filespace transfers="2" location="/mnt/gateway/suzanne" name="suzanne" integrity-check-result="MISSING-FILESYSTEM">
            <quota bytes="20489878"/>
            <writers>
                <authorized>
                    <agent-user>charlene</agent-user>
                    <agent-user>sammy</agent-user>
                </authorized>
                <unauthorized>
                    <agent-user>arnold</agent-user>
                    <agent-user>frank</agent-user>
                </unauthorized>
            </writers>
        </filespace>
        <filespace transfers="1" location="/mnt/gateway/hamilton" name="hamilton" integrity-check-result="OK">
            <quota bytes="666999"/>
            <writers>
                <authorized>
                    <agent-user>joseph</agent-user>
                </authorized>
                <unauthorized>
                    <agent-user>junior</agent-user>
                </unauthorized>
            </writers>
        </filespace>
    </filespaces>

Results

This example result indicates that the first and third file spaces in the set of results have passed the integrity check. The integrity-check-result attribute value of OK shows that the file spaces exist in the Web Gateway database and that matching directories have been found on the file system. The second file space has failed the integrity check. The integrity-check-result attribute value of MISSING-FILESYSTEM shows that the file space exists in the Web Gateway database but that the directory indicated by the location attribute cannot be found on the file system. In this case it might be necessary for an administrator to delete the file space, or restore the file space root directory from a backup.

If you have the security role wmqfte-admin, you can also check the integrity of all file spaces by using the administrative console. For more information, see Web Gateway administrative console.

For the possible values of the integrity-check-result attribute, see File space information response format.


Task Task

Feedback

Timestamp icon Last updated: Tuesday, 30 January 2018
http://www.ibm.com/support/knowledgecenter/SSEP7X_7.0.4/com.ibm.wmqfte.doc/web_filespace_integrity_check_all.htm