@@ -234,7 +234,7 @@ def start_launch(self,
234
234
logger .debug ("start_launch - ID: %s" , self .launch_id )
235
235
return self .launch_id
236
236
237
- def finish_launch (self , end_time , status = None , ** kwargs ):
237
+ def finish_launch (self , end_time , status = None , attributes = None , ** kwargs ):
238
238
"""Finish a launch with the given parameters.
239
239
240
240
Status can be one of the followings:
@@ -243,11 +243,14 @@ def finish_launch(self, end_time, status=None, **kwargs):
243
243
# process log batches firstly:
244
244
if self ._batch_logs :
245
245
self .log_batch ([], force = True )
246
+ if attributes and isinstance (attributes , dict ):
247
+ attributes = _dict_to_payload (attributes )
246
248
data = {
247
249
"endTime" : end_time ,
248
- "status" : status
250
+ "status" : status ,
251
+ "attributes" : attributes
249
252
}
250
- url = uri_join (self .base_url_v1 , "launch" , self .launch_id , "finish" )
253
+ url = uri_join (self .base_url_v2 , "launch" , self .launch_id , "finish" )
251
254
r = self .session .put (url = url , json = data , verify = self .verify_ssl )
252
255
logger .debug ("finish_launch - ID: %s" , self .launch_id )
253
256
return _get_msg (r )
0 commit comments