@@ -13,9 +13,7 @@ def __init__(self, token=None):
13
13
self .session .headers .update ({"Authorization" : f"Bearer { token } " })
14
14
15
15
def list (self , repo = None , force_refresh = False ):
16
- """
17
- ListRepositories gets a list of all configured repositories
18
- """
16
+ """ListRepositories gets a list of all configured repositories"""
19
17
params = {}
20
18
if repo :
21
19
params ["repo" ] = repo
@@ -28,9 +26,7 @@ def list(self, repo=None, force_refresh=False):
28
26
return response .json ()
29
27
30
28
def create (self , payload , upsert = False , creds_only = False ):
31
- """
32
- CreateRepository creates a new repository configuration
33
- """
29
+ """CreateRepository creates a new repository configuration"""
34
30
params = {}
35
31
if upsert :
36
32
params ["upsert" ] = upsert
@@ -43,18 +39,14 @@ def create(self, payload, upsert=False, creds_only=False):
43
39
return response .json ()
44
40
45
41
def update (self , repo , payload ):
46
- """
47
- UpdateRepository updates a repository configuration
48
- """
42
+ """UpdateRepository updates a repository configuration"""
49
43
response = self .session .put (
50
44
f"{ self .base_url } /api/v1/repositories/{ repo } " , json = payload
51
45
)
52
46
return response .json ()
53
47
54
48
def get (self , repo , force_refresh = False ):
55
- """
56
- Get returns a repository or its credentials
57
- """
49
+ """Get returns a repository or its credentials"""
58
50
params = {}
59
51
if force_refresh :
60
52
params ["forceRefresh" ] = force_refresh
@@ -65,9 +57,7 @@ def get(self, repo, force_refresh=False):
65
57
return response .json ()
66
58
67
59
def delete (self , repo , force_refresh = False ):
68
- """
69
- DeleteRepository deletes a repository from the configuration
70
- """
60
+ """DeleteRepository deletes a repository from the configuration"""
71
61
params = {}
72
62
if force_refresh :
73
63
params ["forceRefresh" ] = force_refresh
@@ -78,9 +68,7 @@ def delete(self, repo, force_refresh=False):
78
68
return response .json ()
79
69
80
70
def list_apps (self , repo , revision = None ):
81
- """
82
- ListApps returns list of apps in the repo
83
- """
71
+ """ListApps returns list of apps in the repo"""
84
72
params = {}
85
73
if revision :
86
74
params ["revision" ] = revision
@@ -91,9 +79,7 @@ def list_apps(self, repo, revision=None):
91
79
return response .json ()
92
80
93
81
def list_charts (self , repo , force_refresh = False ):
94
- """
95
- GetHelmCharts returns list of helm charts in the specified repository
96
- """
82
+ """GetHelmCharts returns list of helm charts in the specified repository"""
97
83
params = {}
98
84
if force_refresh :
99
85
params ["forceRefresh" ] = force_refresh
@@ -104,9 +90,7 @@ def list_charts(self, repo, force_refresh=False):
104
90
return response .json ()
105
91
106
92
def list_refs (self , repo , force_refresh = False ):
107
- """
108
- RepositoryService_ListRefs
109
- """
93
+ """RepositoryService_ListRefs"""
110
94
params = {}
111
95
if force_refresh :
112
96
params ["forceRefresh" ] = force_refresh
@@ -135,9 +119,7 @@ def validate_access(
135
119
proxy = "" ,
136
120
project = "" ,
137
121
):
138
- """
139
- ValidateAccess validates access to a repository with given parameters
140
- """
122
+ """ValidateAccess validates access to a repository with given parameters"""
141
123
params = {}
142
124
if username != "" :
143
125
params ["username" ] = username
@@ -175,9 +157,7 @@ def validate_access(
175
157
return response .json ()
176
158
177
159
def get_app (self , repo , payload ):
178
- """
179
- GetAppDetails returns application details by given path
180
- """
160
+ """GetAppDetails returns application details by given path"""
181
161
response = self .session .post (
182
162
f"{ self .base_url } /api/v1/repositories{ repo } /appdetails" , json = payload
183
163
)
0 commit comments