Skip to content

Commit f2a48a7

Browse files
committed
new methods
1 parent 8477cba commit f2a48a7

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

scripts/migration/migrate.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,24 @@ def get_clowder_v1_user_collections_top_level(headers, user_v1):
189189
return top_level_collections
190190

191191
def process_collection_descendants(collection, headers):
192-
sub_collections_endpoint = ""
192+
child_collections_endpoint = f"{CLOWDER_V1}/api/getChildCollections"
193193
datasets_endpoint = f"{CLOWDER_V1}/api/datasets"
194194

195+
child_col_response = requests.get(child_collections_endpoint, headers=headers)
196+
dataset_response = requests.get(datasets_endpoint, headers=headers)
197+
child_col_json = child_col_response.json()
198+
dataset_json = dataset_response.json()
199+
200+
print(f"Got child collections and datasets")
201+
for child in child_col_json:
202+
print(f"Make a folder for this child")
203+
print(f"Call process descendants")
204+
process_collection_descendants(child, headers)
205+
206+
for dataset in dataset_json:
207+
print(f"Make a folder for this dataset")
208+
print(f"Add folders and subfolders")
209+
195210
def process_dataset_folders(dataset, headers):
196211
pass
197212

0 commit comments

Comments
 (0)