Skip to content

Commit 5485b31

Browse files
Merge pull request #112 from cadonuno/add-team-and-bu-get-by-name
Add team and bu get by name
2 parents 1950f72 + 0c7b8f8 commit 5485b31

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

veracode_api_py/identity.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ def delete(self,user_guid: UUID):
149149
return APIHelper()._rest_request(uri,"DELETE")
150150

151151
class Teams():
152+
def get_by_name(self, team_name, all_for_org=False):
153+
#Gets a list of teams matching a team_name using the Veracode Identity API
154+
request_params = {'team_name': parse.quote(team_name), 'page': 0}
155+
if all_for_org:
156+
request_params.update({'all_for_org': True})
157+
return APIHelper()._rest_paged_request("api/authn/v2/teams","GET","teams",request_params)
158+
159+
152160
def get_all(self, all_for_org=False):
153161
#Gets a list of teams using the Veracode Identity API
154162
if all_for_org:
@@ -208,6 +216,11 @@ def delete(self, team_guid: UUID):
208216
class BusinessUnits():
209217
base_uri = "api/authn/v2/business_units"
210218

219+
def get_by_name(self, bu_name):
220+
#Gets a list of business units matching a bu_name using the Veracode Identity API
221+
request_params = {'bu_name': parse.quote(bu_name), 'page': 0}
222+
return APIHelper()._rest_paged_request(self.base_uri,"GET","business_units",request_params)
223+
211224
def get_all(self):
212225
request_params = {'page': 0}
213226
return APIHelper()._rest_paged_request(self.base_uri,"GET","business_units",request_params)

0 commit comments

Comments
 (0)