@@ -66,7 +66,15 @@ def _get_generator(
66
66
yield response
67
67
68
68
def base_list_call (
69
- self , resource , expand , favourite , clover_enabled , max_results , label = None , start_index = 0 , ** kwargs
69
+ self ,
70
+ resource ,
71
+ expand ,
72
+ favourite ,
73
+ clover_enabled ,
74
+ max_results ,
75
+ label = None ,
76
+ start_index = 0 ,
77
+ ** kwargs
70
78
):
71
79
flags = []
72
80
params = {"max-results" : max_results }
@@ -93,7 +101,9 @@ def base_list_call(
93
101
94
102
""" Projects & Plans """
95
103
96
- def projects (self , expand = None , favourite = False , clover_enabled = False , max_results = 25 ):
104
+ def projects (
105
+ self , expand = None , favourite = False , clover_enabled = False , max_results = 25
106
+ ):
97
107
return self .base_list_call (
98
108
"project" ,
99
109
expand = expand ,
@@ -207,7 +217,9 @@ def enable_plan(self, plan_key):
207
217
208
218
""" Branches """
209
219
210
- def search_branches (self , plan_key , include_default_branch = True , max_results = 25 , start = 0 ):
220
+ def search_branches (
221
+ self , plan_key , include_default_branch = True , max_results = 25 , start = 0
222
+ ):
211
223
params = {
212
224
"max-result" : max_results ,
213
225
"start-index" : start ,
@@ -249,7 +261,9 @@ def get_branch_info(self, plan_key, branch_name):
249
261
:param branch_name:
250
262
:return:
251
263
"""
252
- resource = "plan/{plan_key}/branch/{branch_name}" .format (plan_key = plan_key , branch_name = branch_name )
264
+ resource = "plan/{plan_key}/branch/{branch_name}" .format (
265
+ plan_key = plan_key , branch_name = branch_name
266
+ )
253
267
return self .get (self .resource_url (resource ))
254
268
255
269
def create_branch (
@@ -272,7 +286,9 @@ def create_branch(
272
286
:param cleanup_enabled: bool
273
287
:return: PUT request
274
288
"""
275
- resource = "plan/{plan_key}/branch/{branch_name}" .format (plan_key = plan_key , branch_name = branch_name )
289
+ resource = "plan/{plan_key}/branch/{branch_name}" .format (
290
+ plan_key = plan_key , branch_name = branch_name
291
+ )
276
292
params = {}
277
293
if vcs_branch :
278
294
params = dict (
@@ -334,7 +350,9 @@ def results(
334
350
"""
335
351
resource = "result"
336
352
if project_key and plan_key and job_key and build_number :
337
- resource += "/{}-{}-{}/{}" .format (project_key , plan_key , job_key , build_number )
353
+ resource += "/{}-{}-{}/{}" .format (
354
+ project_key , plan_key , job_key , build_number
355
+ )
338
356
elif project_key and plan_key and build_number :
339
357
resource += "/{}-{}/{}" .format (project_key , plan_key , build_number )
340
358
elif project_key and plan_key :
@@ -471,7 +489,9 @@ def plan_results(
471
489
include_all_states = include_all_states ,
472
490
)
473
491
474
- def build_result (self , build_key , expand = None , include_all_states = False , start = 0 , max_results = 25 ):
492
+ def build_result (
493
+ self , build_key , expand = None , include_all_states = False , start = 0 , max_results = 25
494
+ ):
475
495
"""
476
496
Returns details of a specific build result
477
497
:param expand: expands build result details on request. Possible values are: artifacts, comments, labels,
@@ -496,7 +516,9 @@ def build_result(self, build_key, expand=None, include_all_states=False, start=0
496
516
include_all_states = include_all_states ,
497
517
)
498
518
except ValueError :
499
- raise ValueError ('The key "{}" does not correspond to a build result' .format (build_key ))
519
+ raise ValueError (
520
+ 'The key "{}" does not correspond to a build result' .format (build_key )
521
+ )
500
522
501
523
def build_latest_result (self , plan_key , expand = None , include_all_states = False ):
502
524
"""
@@ -519,7 +541,11 @@ def build_latest_result(self, plan_key, expand=None, include_all_states=False):
519
541
include_all_states = include_all_states ,
520
542
)
521
543
except ValueError :
522
- raise ValueError ('The key "{}" does not correspond to the latest build result' .format (plan_key ))
544
+ raise ValueError (
545
+ 'The key "{}" does not correspond to the latest build result' .format (
546
+ plan_key
547
+ )
548
+ )
523
549
524
550
def delete_build_result (self , build_key ):
525
551
"""
@@ -531,9 +557,18 @@ def delete_build_result(self, build_key):
531
557
plan_key = "{}-{}" .format (build_key [0 ], build_key [1 ])
532
558
build_number = build_key [2 ]
533
559
params = {"buildKey" : plan_key , "buildNumber" : build_number }
534
- return self .post (custom_resource , params = params , headers = self .form_token_headers )
560
+ return self .post (
561
+ custom_resource , params = params , headers = self .form_token_headers
562
+ )
535
563
536
- def execute_build (self , plan_key , stage = None , execute_all_stages = True , custom_revision = None , ** bamboo_variables ):
564
+ def execute_build (
565
+ self ,
566
+ plan_key ,
567
+ stage = None ,
568
+ execute_all_stages = True ,
569
+ custom_revision = None ,
570
+ ** bamboo_variables
571
+ ):
537
572
"""
538
573
Fire build execution for specified plan.
539
574
!IMPORTANT! NOTE: for some reason, this method always execute all stages
@@ -569,7 +604,9 @@ def stop_build(self, plan_key):
569
604
570
605
""" Comments & Labels """
571
606
572
- def comments (self , project_key , plan_key , build_number , start_index = 0 , max_results = 25 ):
607
+ def comments (
608
+ self , project_key , plan_key , build_number , start_index = 0 , max_results = 25
609
+ ):
573
610
resource = "result/{}-{}-{}/comment" .format (project_key , plan_key , build_number )
574
611
params = {"start-index" : start_index , "max-results" : max_results }
575
612
return self .get (self .resource_url (resource ), params = params )
@@ -582,7 +619,9 @@ def create_comment(self, project_key, plan_key, build_number, comment, author=No
582
619
}
583
620
return self .post (self .resource_url (resource ), data = comment_data )
584
621
585
- def labels (self , project_key , plan_key , build_number , start_index = 0 , max_results = 25 ):
622
+ def labels (
623
+ self , project_key , plan_key , build_number , start_index = 0 , max_results = 25
624
+ ):
586
625
resource = "result/{}-{}-{}/label" .format (project_key , plan_key , build_number )
587
626
params = {"start-index" : start_index , "max-results" : max_results }
588
627
return self .get (self .resource_url (resource ), params = params )
@@ -592,7 +631,9 @@ def create_label(self, project_key, plan_key, build_number, label):
592
631
return self .post (self .resource_url (resource ), data = {"name" : label })
593
632
594
633
def delete_label (self , project_key , plan_key , build_number , label ):
595
- resource = "result/{}-{}-{}/label/{}" .format (project_key , plan_key , build_number , label )
634
+ resource = "result/{}-{}-{}/label/{}" .format (
635
+ project_key , plan_key , build_number , label
636
+ )
596
637
return self .delete (self .resource_url (resource ))
597
638
598
639
def get_projects (self ):
@@ -626,7 +667,9 @@ def deployment_project(self, project_id):
626
667
return self .get (self .resource_url (resource ))
627
668
628
669
def deployment_environment_results (self , env_id , expand = None , max_results = 25 ):
629
- resource = "deploy/environment/{environmentId}/results" .format (environmentId = env_id )
670
+ resource = "deploy/environment/{environmentId}/results" .format (
671
+ environmentId = env_id
672
+ )
630
673
params = {"max-result" : max_results , "start-index" : 0 }
631
674
size = 1
632
675
if expand :
@@ -643,7 +686,11 @@ def deployment_dashboard(self, project_id=None):
643
686
Returns the current status of each deployment environment
644
687
If no project id is provided, returns all projects.
645
688
"""
646
- resource = "deploy/dashboard/{}" .format (project_id ) if project_id else "deploy/dashboard"
689
+ resource = (
690
+ "deploy/dashboard/{}" .format (project_id )
691
+ if project_id
692
+ else "deploy/dashboard"
693
+ )
647
694
return self .get (self .resource_url (resource ))
648
695
649
696
""" Users & Groups """
0 commit comments