Skip to content

Commit

Permalink
Add'l changes to support #56
Browse files Browse the repository at this point in the history
  • Loading branch information
tjarrettveracode committed Jul 26, 2023
1 parent 80b4628 commit 4f6086a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docs/applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ _Note_: You can also access these methods from the `Applications` class.
- `get_apps(policy_check_after(opt))` : get a list of Veracode applications (JSON format). If provided, returns only applications that have a policy check date on or after `policy_check_after` (format is `yyyy-mm-dd`).
- `get_app(guid(opt),legacy_id(opt))`: get information for a single Veracode application using either the `guid` or the `legacy_id` (integer).
- `get_app_by_name(name)`: get list of applications whose names contain the search string `name`.
- `create_app(app_name, business_criticality, business_unit(opt), teams(opt), policy_guid(opt))`: create an application profile.
- `create_app(app_name, business_criticality, business_unit(opt), teams(opt), policy_guid(opt), custom_fields(opt array))`: create an application profile.
- `business_criticality`: one of "VERY HIGH", "HIGH", "MEDIUM", "LOW", "VERY LOW"
- `business_unit`: the GUID of the business unit to which the application should be assigned
- `teams`: a list of the GUIDs of the teams to which the application should be assigned
- `policy_guid` The GUID of the policy to set for this application.
- `update_app(guid, app_name, business_criticality, business_unit(opt), teams(opt), policy_guid(opt))`: update an application profile. Note that partial updates are NOT supported, so you need to provide all values including those that aren't changing.
- `policy_guid`: the GUID of the policy to set for this application.
- `custom_fields`: an array of custom field values for the application
- `update_app(guid, app_name, business_criticality, business_unit(opt), teams(opt), policy_guid(opt), custom_fields(opt array))`: update an application profile. Note that partial updates are NOT supported, so you need to provide all values including those that aren't changing.
- `delete_app(guid)`: delete the application identified by `guid`. This is not a reversible action.
- `get_custom_fields()`: get a list of app profile custom fields available for your organization.
- `policy_guid` The GUID of the policy to set for this application.
Expand Down
11 changes: 9 additions & 2 deletions veracode_api_py/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,15 @@ def get_app(self, guid: UUID = None, legacy_id=None):
def get_app_by_name(self, appname):
return Applications().get_by_name(appname)

def create_app(self, app_name, business_criticality, business_unit: UUID = None, teams=[]):
return Applications().create(app_name, business_criticality, business_unit, teams)
def create_app(self, app_name, business_criticality, business_unit: UUID = None, teams=[], policy_guid = None, custom_fields=[]):
return Applications().create(app_name=app_name, business_criticality=business_criticality,
business_unit=business_unit, teams=teams, policy_guid=policy_guid,
custom_fields=custom_fields)

def update_app(self, guid: UUID, app_name, business_criticality, business_unit: UUID = None, teams=[], policy_guid = None, custom_fields=[]):
return Applications().update(guid=guid, app_name=app_name, business_criticality=business_criticality,
business_unit=business_unit, teams=teams, policy_guid=policy_guid,
custom_fields=custom_fields)

def delete_app(self, guid: UUID):
return Applications().delete(guid)
Expand Down

0 comments on commit 4f6086a

Please sign in to comment.