Skip to content
Snippets Groups Projects
Commit fffe4b4c authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-272: forward extra kwargs to template

parent fbcecdbb
No related branches found
No related tags found
1 merge request!213Resolve TMSS-272
...@@ -263,12 +263,13 @@ class TMSSsession(object): ...@@ -263,12 +263,13 @@ class TMSSsession(object):
content = response.content.decode('utf-8') content = response.content.decode('utf-8')
raise Exception("Could not set status with url %s - %s %s - %s" % (response.request.url, response.status_code, responses.get(response.status_code), content)) raise Exception("Could not set status with url %s - %s %s - %s" % (response.request.url, response.status_code, responses.get(response.status_code), content))
def post_template(self, template_path:str, name: str, description: str, version: str, schema: str): def post_template(self, template_path:str, name: str, description: str, version: str, schema: str, **kwargs):
'''POST a template at <BASE_URL>/<template_path> with the given name, description and version''' '''POST a template at <BASE_URL>/<template_path> with the given name, description and version'''
json_data = {'name': name, json_data = {'name': name,
'description': description, 'description': description,
'version': version, 'version': version,
'schema': json.loads(schema) if isinstance(schema, str) else schema} 'schema': json.loads(schema) if isinstance(schema, str) else schema}
json_data.update(**kwargs)
response = self.session.post(url='%s/%s/' % (self.base_url, template_path), json=json_data) response = self.session.post(url='%s/%s/' % (self.base_url, template_path), json=json_data)
if response.status_code == 201: if response.status_code == 201:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment