-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,41 @@ | ||
import wranglertools.fdnDCIC as fdnDCIC | ||
import os | ||
import json | ||
|
||
def run(keypairs_file, schema_name): | ||
|
||
assert os.path.isfile(str(keypairs_file)) | ||
|
||
|
||
try: | ||
key = fdnDCIC.FDN_Key(keypairs_file, "default") | ||
except Exception as e: | ||
print(e) | ||
print("key error") | ||
raise e | ||
|
||
try: | ||
connection = fdnDCIC.FDN_Connection(key) | ||
except Exception as e: | ||
print(e) | ||
print("connection error") | ||
raise e | ||
|
||
try: | ||
#response = fdnDCIC.get_FDN("/profiles/file_reference.json", connection, frame="object") | ||
response = fdnDCIC.get_FDN("/" + schema_name, connection, frame=None) | ||
#response = fdnDCIC.get_FDN("/search/?type=FileReference", connection, frame=None) | ||
except Exception as e: | ||
print(e) | ||
print("post error") | ||
raise e | ||
def run(keypairs_file, schema_name): | ||
|
||
print(response) | ||
assert os.path.isfile(str(keypairs_file)) | ||
|
||
try: | ||
key = fdnDCIC.FDN_Key(keypairs_file, "default") | ||
except Exception as e: | ||
print(e) | ||
print("key error") | ||
raise e | ||
try: | ||
connection = fdnDCIC.FDN_Connection(key) | ||
except Exception as e: | ||
print(e) | ||
print("connection error") | ||
raise e | ||
try: | ||
# response = fdnDCIC.get_FDN("/profiles/file_reference.json", connection, frame="object") | ||
response = fdnDCIC.get_FDN("/" + schema_name, connection, frame=None) | ||
# response = fdnDCIC.get_FDN("/search/?type=FileReference", connection, frame=None) | ||
except Exception as e: | ||
print(e) | ||
print("post error") | ||
raise e | ||
|
||
print(response) | ||
|
||
|
||
if __name__ == "__main__": | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description="file_reference_upload") | ||
parser.add_argument('-k','--keypairs_file',help='key-pairs file') | ||
parser.add_argument('-s','--schema',help='schema name (e.g. file_reference, workflow)') | ||
args = parser.parse_args() | ||
import argparse | ||
|
||
run(args.keypairs_file, args.schema) | ||
parser = argparse.ArgumentParser(description="file_reference_upload") | ||
parser.add_argument('-k', '--keypairs_file', help='key-pairs file') | ||
parser.add_argument('-s', '--schema', help='schema name (e.g. file_reference, workflow)') | ||
args = parser.parse_args() | ||
|
||
run(args.keypairs_file, args.schema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters