Filesharing Service Walk Task¤
task api name:
walk
The walk task recursively lists files under a File Sharing URL. It returns complete nf://... URLs for each file found and skips hidden files and special directories.
Inputs¤
| Parameter | Required | Description |
|---|---|---|
url |
No | Directory URL to walk, default nf:// |
Output¤
Returns a recursive list of file URLs under the requested path.
Examples¤
Walk the repository root:
nf#file walk
Walk a subdirectory:
nf#file walk url nf://templates/
Context manager:
from norfab.core.nfapi import NorFab
with NorFab(inventory="./inventory.yaml") as nf:
client = nf.make_client()
result = client.run_job(
service="filesharing",
task="walk",
workers="any",
kwargs={"url": "nf://"},
)
print(result)
Direct lifecycle:
from norfab.core.nfapi import NorFab
nf = NorFab(inventory="./inventory.yaml")
try:
nf.start()
client = nf.make_client()
result = client.run_job(
service="filesharing",
task="walk",
workers="any",
kwargs={"url": "nf://templates/"},
)
print(result)
finally:
nf.destroy()
Filesharing Walk Command Shell Reference¤
NorFab shell supports these command options for Filesharing walk task:
nf# man tree file
root
└── file: File sharing service
└── walk: Walk directory tree recursively
nf#
Python API Reference¤
Recursively list published files beneath an nf:// directory.
Hidden files and internal paths containing double-underscore directory markers are omitted from the returned namespace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Root directory URL beginning with |
required |
Returns:
| Type | Description |
|---|---|
Result
|
A result containing normalized |
Result
|
directories and unsafe URLs produce failed results. |
Source code in norfab\workers\filesharing_worker\local_files_tasks.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |