Skip to content
Snippets Groups Projects
Commit 96130222 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

add missing --token parameter

parent d70f8a32
Branches
No related tags found
1 merge request!9add optional private key and private key password
......@@ -19,7 +19,7 @@ import datetime
from urllib.parse import urlparse, urlunparse
# ==============================================================
# The request header
ATDB_HEADER = {
REQUEST_HEADER = {
'content-type': "application/json",
'cache-control': "no-cache"
}
......@@ -79,7 +79,7 @@ class LDVSpecInterface():
self.host = LDV_HOST_PROD
if not self.host.endswith('/'):
self.host += '/'
self.header = ATDB_HEADER
self.header = REQUEST_HEADER
self.header['Authorization'] = f'Token {token}'
self._session = None
......
......@@ -70,8 +70,7 @@ def main():
parser.add_argument("--version", default=False, help="Show current version of this program", action="store_true")
parser.add_argument("-v", "--verbose", default=False, help="More information at run time.", action="store_true")
parser.add_argument("-l", "--limit", default=0, type=int, help="Limit on the number of queries (0 is no limit)", action="store")
parser.add_argument("-t", "--token", default="ad9b37a24380948601257f9c1f889b07a00ac81e",
help="Token to access the REST API of ldvspec", action="store")
parser.add_argument("--host", nargs="?", default='dev',
help="The ldv-spec-db host. Presets are 'dev' (default), 'test', 'prod', otherwise give a full url like https://sdc.astron.nl:5554/ldvspec/api/v1")
parser.add_argument("--configuration", default='~/shared/ldv_migrate.cfg',
......@@ -82,6 +81,7 @@ def main():
# tested with 10.000 results in 90 seconds so # 11 mil. will be at least 28 hours
parser.add_argument("-r", "--max_nbr_dps_to_insert_per_request", default=1000, type=int,
help="The number of dataproducts to insert per REST request (0 is no limit)", action="store")
parser.add_argument("--token", default="ca1a247b2d9ccb556f450e541874e714e6d04eba", help="Token for ldvspec")
args = parser.parse_args()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment