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