Skip to content

Commit

Permalink
Merge pull request #11 from simonsobs/add-satp2
Browse files Browse the repository at this point in the history
add satp2 config
  • Loading branch information
guanyilun authored May 7, 2024
2 parents 234cf41 + 1e7a6ca commit a472a96
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/scheduler_server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,29 @@ def schedule():
return response

def get_preset_config(preset_name, default={}):
http_headers = {
'headers': {
'accept': 'application/json',
'xc-token': os.environ["NOCODB_TOKEN"],
},
'queries': {
'sort': '-from',
'fields': 'program,from,to,config,status'
}
}

presets = {
'rest.satp1': {
'url': os.environ['NOCODB_SATP1_URL'],
'headers': {
'accept': 'application/json',
'xc-token': os.environ["NOCODB_TOKEN"],
},
'queries': {
'sort': '-from',
'fields': 'program,from,to,config,status'
}
**http_headers,
},
'rest.satp2': {
'url': os.environ['NOCODB_SATP2_URL'],
**http_headers,
},
'rest.satp3': {
'url': os.environ['NOCODB_SATP3_URL'],
'headers': {
'accept': 'application/json',
'xc-token': os.environ["NOCODB_TOKEN"],
},
'queries': {
'sort': '-from',
'fields': 'program,from,to,config,status'
}
**http_headers,
}
}
return presets.get(preset_name, default)

0 comments on commit a472a96

Please sign in to comment.