Queries the infrequently-accessed files in a specified directory of a General-purpose NAS file system and the subdirectories that contain the files.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesListDirectoriesAndFiles

The operation that you want to perform.

Set the value to ListDirectoriesAndFiles.

FileSystemIdStringYes31a8e4****

The ID of the file system.

PathStringYes/pathway/to/folder

The absolute path of the directory.

The path must start with a forward slash (/) and must be a path that exists in the mount target.

NextTokenStringNoTGlzdFJlc291cmNlU****mVzJjE1MTI2NjY4NzY5MTAzOTEmMiZORnI4NDhVeEtrUT0=

The token that is used to initiate the next request. If the response of the current request is truncated, you can use the token to initiate another request and obtain the remaining records.

StorageTypeStringYesInfrequentAccess

The storage type of the files.

Default value: InfrequentAccess (IA).

DirectoryOnlyBooleanNofalse

Specifies whether to query only directories.

Valid values:

  • false (default value): queries both directories and files.
  • true: queries only directories.
MaxResultsLongNo100

The maximum number of directories or files to include in the results of each query.

Valid values: 10 to 128.

Default value: 100.

Response parameters

ParameterTypeExampleDescription
NextTokenStringTGlzdFJlc291cmNlU****mVzJjE1MTI2NjY4NzY5MTAzOTEmMiZORnI4NDhVeEtrUT0=

The token that is used to initiate the next request. If the response of the current request is truncated, you can use the token to initiate another request and obtain the remaining records.

RequestIdString2D69A58F-345C-4FDE-88E4-BF518948****

The ID of the request.

EntriesArray of Entry

The details about the files or directories.

TypeStringFile

The type of the query result.

Valid values:

  • File
  • Directory
HasInfrequentAccessFileBooleantrue

Indicates whether the files contain the data that is dumped to the IA storage medium.

This parameter is returned and valid only if the value of the Type parameter is Directory.

Valid values:

  • true: The files contain data that is dumped to the IA storage medium.
  • false: The files do not contain data that is dumped to the IA storage medium.
CtimeString2021-02-11T10:08:10Z

The time when the raw data was modified.

The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

This parameter is returned and valid only if the value of the Type parameter is File.

MtimeString2021-02-11T10:08:08Z

The time when the file was last modified.

The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

This parameter is returned and valid only if the value of the Type parameter is File.

SizeLong1024

The size of the files.

Unit: bytes.

This parameter is returned and valid only if the value of the Type parameter is File.

StorageTypeStringInfrequentAccess

The storage type of the files.

This parameter is returned and valid only if the value of the Type parameter is File.

Valid values:

  • standard: General-purpose NAS file system
  • InfrequentAccess: IA storage medium
AtimeString2021-02-01T10:08:08Z

The time range for the query.

The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

This parameter is returned and valid only if the value of the Type parameter is File.

NameStringfile.txt

The name of the file or directory.

RetrieveTimeString2021-02-11T10:08:08Z

The time when the last data retrieval task was run.

The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

This parameter is returned and valid only if the value of the Type parameter is File.

InodeString66

The file or directory inode.

FileIdString66

The ID of the directory or file.

OwnerString37862c****

The ID of the portable account.

This parameter is returned and valid only if the value of the ProtocolType parameter is SMB and RAM-based access control is enabled.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListDirectoriesAndFiles
&FileSystemId=31a8e4****
&Path=/pathway/to/folder
&NextToken=TGlzdFJlc291cmNlU****mVzJjE1MTI2NjY4NzY5MTAzOTEmMiZORnI4NDhVeEtrUT0=    
&StorageType=InfrequentAccess
&DirectoryOnly=false
&MaxResults=100
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListDirectoriesAndFilesResponse>
    <NextToken>TGlzdFJlc291cmNlU****mVzJjE1MTI2NjY4NzY5MTAzOTEmMiZORnI4NDhVeEtrUT0=</NextToken>
    <RequestId>2D69A58F-345C-4FDE-88E4-BF518948****</RequestId>
    <Entries>
        <Type>File</Type>
        <HasInfrequentAccessFile>true</HasInfrequentAccessFile>
        <Ctime>2021-02-11T10:08:10Z</Ctime>
        <Mtime>2021-02-11T10:08:08Z</Mtime>
        <Size>1024</Size>
        <StorageType>InfrequentAccess</StorageType>
        <Atime>2021-02-01T10:08:08Z</Atime>
        <Name>file.txt</Name>
        <RetrieveTime>2021-02-11T10:08:08Z</RetrieveTime>
        <Inode>66</Inode>
        <FileId>66</FileId>
        <Owner>37862c****</Owner>
    </Entries>
</ListDirectoriesAndFilesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "NextToken" : "TGlzdFJlc291cmNlU****mVzJjE1MTI2NjY4NzY5MTAzOTEmMiZORnI4NDhVeEtrUT0=",
  "RequestId" : "2D69A58F-345C-4FDE-88E4-BF518948****",
  "Entries" : [ {
    "Type" : "File",
    "HasInfrequentAccessFile" : true,
    "Ctime" : "2021-02-11T10:08:10Z",
    "Mtime" : "2021-02-11T10:08:08Z",
    "Size" : 1024,
    "StorageType" : "InfrequentAccess",
    "Atime" : "2021-02-01T10:08:08Z",
    "Name" : "file.txt",
    "RetrieveTime" : "2021-02-11T10:08:08Z",
    "Inode" : "66",
    "FileId" : "66",
    "Owner" : "37862c****"
  } ]
}

Error codes

HTTP status codeError codeError messageDescription
400OperationDenied.InvalidNextTokenThe specified NextToken is invalid.The error message returned because the specified NextToken parameter is invalid.
404InvalidFileSystem.NotFoundThe specified file system does not exist.The error message returned because the specified file system does not exist.
404InvalidParameter.PathNotExistThe specified path does not exist.The error message returned because the specified path does not exist.

For a list of error codes, see Service error codes.