How to pass in team parameters to VeracodeAPI.create_app method

29 Views Asked by At

Trying to pass -> VeracodeAPI.create_app("self", app_name_input, business_criticality_input, teams=['Hello'])

returns _rest_request raise requests.exceptions.RequestException() requests.exceptions.RequestException

VeracodeAPI.create_app("self", app_name_input, business_criticality_input, teams=['Hello'])

1

There are 1 best solutions below

0
Tim Jarrett On

I'm a maintainer of the veracode-api-py library.

You want to omit the self argument when calling methods in this library (or other Python libraries), since the Python runtime provides it for you. (See here for an explanation.)

Also, note in the docs that the create_app method requires you to pass the guid for the team and not its name. You can get the GUID for a team using the get_teams method in the library.

Your example should look like this (where you want to use the GUID for the team in place of the placeholder GUID below):

from veracode_api_py import VeracodeAPI

app_name_input = 'Your app name'
business_criticality_input = 'HIGH' # One of [ VERY_HIGH, HIGH, MEDIUM, LOW, VERY_LOW ]

VeracodeAPI().create_app(app_name_input, business_criticality_input, 
                         teams=['733xxxxx-yyyy-zzzz-qqqq-1234567890ab'])