Queries the infrequently-accessed files in a specified directory of a General-purpose NAS file system and the subdirectories that contain the files.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListDirectoriesAndFiles | The operation that you want to perform. Set the value to ListDirectoriesAndFiles. |
FileSystemId | String | Yes | 31a8e4**** | The ID of the file system. |
Path | String | Yes | /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. |
NextToken | String | No | TGlzdFJlc291cmNlU****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. |
StorageType | String | Yes | InfrequentAccess | The storage type of the files. Default value: InfrequentAccess (IA). |
DirectoryOnly | Boolean | No | false | Specifies whether to query only directories. Valid values:
|
MaxResults | Long | No | 100 | 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
Parameter | Type | Example | Description |
---|---|---|---|
NextToken | String | TGlzdFJlc291cmNlU****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. |
RequestId | String | 2D69A58F-345C-4FDE-88E4-BF518948**** | The ID of the request. |
Entries | Array of Entry | The details about the files or directories. | |
Type | String | File | The type of the query result. Valid values:
|
HasInfrequentAccessFile | Boolean | true | 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:
|
Ctime | String | 2021-02-11T10:08:10Z | The time when the raw data was modified. The time follows the ISO 8601 standard in the This parameter is returned and valid only if the value of the Type parameter is File. |
Mtime | String | 2021-02-11T10:08:08Z | The time when the file was last modified. The time follows the ISO 8601 standard in the This parameter is returned and valid only if the value of the Type parameter is File. |
Size | Long | 1024 | The size of the files. Unit: bytes. This parameter is returned and valid only if the value of the Type parameter is File. |
StorageType | String | InfrequentAccess | The storage type of the files. This parameter is returned and valid only if the value of the Type parameter is File. Valid values:
|
Atime | String | 2021-02-01T10:08:08Z | The time range for the query. The time follows the ISO 8601 standard in the This parameter is returned and valid only if the value of the Type parameter is File. |
Name | String | file.txt | The name of the file or directory. |
RetrieveTime | String | 2021-02-11T10:08:08Z | The time when the last data retrieval task was run. The time follows the ISO 8601 standard in the This parameter is returned and valid only if the value of the Type parameter is File. |
Inode | String | 66 | The file or directory inode. |
FileId | String | 66 | The ID of the directory or file. |
Owner | String | 37862c**** | 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 code | Error code | Error message | Description |
---|---|---|---|
400 | OperationDenied.InvalidNextToken | The specified NextToken is invalid. | The error message returned because the specified NextToken parameter is invalid. |
404 | InvalidFileSystem.NotFound | The specified file system does not exist. | The error message returned because the specified file system does not exist. |
404 | InvalidParameter.PathNotExist | The 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.