File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ class BuildRun(BaseModel):
4848 """Models artifactory build runs."""
4949
5050 uri : str
51- buildsNumber : Optional [List [Run ]] = None
51+ buildsNumbers : Optional [List [Run ]] = None
5252
5353
5454class BuildArtifact (BaseModel ):
Original file line number Diff line number Diff line change 1717 BuildPromotionRequest ,
1818 BuildPromotionResult ,
1919 BuildProperties ,
20+ BuildRun ,
2021)
2122from pyartifactory .objects .object import ArtifactoryObject
2223
@@ -28,6 +29,23 @@ class ArtifactoryBuild(ArtifactoryObject):
2829
2930 _uri = "build"
3031
32+ def get_build_runs (self , build_name : str ) -> BuildRun :
33+ """Provides information about the build runs for the given build name.
34+
35+ :param build_name: Build name to be retrieved
36+ :return: BuildRun model object containing server response
37+ """
38+ try :
39+ response = self ._get (
40+ f"api/{ self ._uri } /{ build_name } " ,
41+ )
42+ print (response .json ())
43+ logger .debug ("Build Runs successfully retrieved" )
44+ except requests .exceptions .HTTPError as error :
45+ self ._raise_exception (error )
46+
47+ return BuildRun (** response .json ())
48+
3149 def get_build_info (
3250 self ,
3351 build_name : str ,
You can’t perform that action at this time.
0 commit comments