Nexfs Management API Documentation

Method Index

GetDirectoryListing

Retrieving a director and file listings from Nexfs using the Management API


Action: GetDirectoryListing

Request a directory listing and optionally file listing for the specified directory.


Permissions

For a directory only listing the requesting session must have the nexfs/ListDirectories role enabled.


To retrieve a directory and file listing the requesting session must have the nexfs/ListFiles role enabled.


Request Parameters

A request must be made against the nexfs management console api with the GetConfig action.


The request must be signed with a valid AWS V4 style Signature using an active temporary session security token.


Action

GetDirectoryListing


BaseDir

The directory (the request directory) from within the Nexfs filesystem to list directories and files from.


Mode

(Optional) Mode can be set to 0 (default) or 1


If the request mode is set to 0 then only directories contained in the requested directory returned


If the request mode is set to 1 then both directories and files are returned


If mode is not included, the request defaults to directory listing only.


Request Body

The request does not have a request body.


Response Syntax


HTTP1/1 200

{

"Listing":

{

"directory entry string":

{

"Type": "string"

}

, ...

}

}


Response Elements

If the action is successful, the service sends back an HTTP 200 response.


The following data is returned in json format by the service.


Listing

The directory listing containing label.


directory entry string

Each entry is a string representing the name of a folder or file within the request directory


Type

Either "dir" for a directory or "file" for a file entry


Errors

Also See Rest Error Responses


400 BadRequest The request was Malformed

A BadRequest is returned if BaseDir is missing from the request


400 BadRequest The requested directory does not exist

No entry matching the requested BaseDir exists within the Nexfs filesystem

401 Unauthorized The request cannot be authenticated


403 Forbidden Session does not have the rights to perform the requested action

500 InternalServerError An Internal Error was encountered


Example Request


GET http://nexfs.example.com:9200/nexfsconsoleapi?Action=GetDirectoryListing&ListDir=/&Mode=1

Authorization: AWS4-HMAC-SHA256 Credential=aafce8a974554b5fa9fa7da6c2bef1d2/20220823/nexfs/nexfsconsoleapi/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=6354e5c9224ad95eb4f2504e1803660b441288e3d779d0aeb3278867af053204

host: nexfs.example.com

x-amz-date: 20220823T210253Z

Example Mode 0 Response


{

"Listing": {

"sampledirectory": {

"Type": "dir"

}

,"afolder": {

"Type": "dir"

}

,"bfolder": {

"Type": "dir"

}

}

}


Example Mode 1 Response


{

"Listing": {

".fileabc.txt": {

"Type": "file"

}

,"1GB": {

"Type": "file"

}

,"1GB-2": {

"Type": "file"

}

,"golf": {

"Type": "file"

}

,"sampledirectory": {

"Type": "dir"

}

,"introviedo.mp4": {

"Type": "file"

}

,"afolder": {

"Type": "dir"

}

,"bfolder": {

"Type": "dir"

}

}

}