Example: Listing all file spaces

You can list all file spaces by submitting an HTTP request to the WebSphere® MQ Managed File Transfer Web Gateway. The Web Gateway returns a response in XML or JSON format that lists the names of the file spaces, the quota of each file space, and the users who are authorized and not authorized to write to each file space.

About this task

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 Web Gateway is example.com. There are currently three file spaces, belonging to the users richard, suzanne and hamilton. There are no file transfers currently in progress into the file space richard. There is one transfer in progress into the file space hamilton, and two transfers into the file space suzanne. 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.

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
  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="https://www.w3.org/2001/XMLSchema-instance">
        <filespace transfers="0" location="/mnt/gateway/richard" name="richard">
            <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">
            <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">
            <quota bytes="666999"/>
            <writers>
                <authorized>
                    <agent-user>joseph</agent-user>
                </authorized>
                <unauthorized>
                    <agent-user>junior</agent-user>
                </unauthorized>
            </writers>
        </filespace>
    </filespaces>