Class: Veracode::API::Upload

Inherits:
Base
  • Object
show all
Defined in:
lib/veracode/upload.rb

Constant Summary collapse

CREATE_APP_URI =
"/api/4.0/createapp.do"
DELETE_APP_URI =
"/api/4.0/deleteapp.do"
GET_VENDOR_LIST_URI =
"/api/4.0/getvendorlist.do"
CREATE_BUILD_URI =
"/api/4.0/createbuild.do"
DELETE_BUILD_URI =
"/api/4.0/deletebuild.do"
UPLOAD_FILE_URI =
"/api/4.0/uploadfile.do"
REMOVE_FILE_URI =
"/api/4.0/removefile.do"
GET_FILE_LIST_URI =
"/api/4.0/getfilelist.do"
GET_APP_LIST_URI =
"/api/4.0/getapplist.do"
GET_APP_INFO_URI =
"/api/4.0/getappinfo.do"
GET_BUILD_LIST_URI =
"/api/4.0/getbuildlist.do"
GET_BUILD_INFO_URI =
"/api/4.0/getbuildinfo.do"
BEGIN_PRESCAN_URI =
"/api/4.0/beginprescan.do"
GET_PRESCAN_RESULTS_URI =
"/api/4.0/getprescanresults.do"
BEGIN_SCAN_URI =
"/api/4.0/beginscan.do"

Constants inherited from Base

Base::VERACODE_REQ_VER

Instance Attribute Summary

Attributes inherited from Base

#account_id

Instance Method Summary collapse

Methods inherited from Base

#getXML, #initialize, #postAPI

Constructor Details

This class inherits a constructor from Veracode::API::Base

Instance Method Details

#get_application_info(app_id) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/veracode/upload.rb', line 63

def get_application_info(app_id)
  xml = getXML(GET_APP_INFO_URI + "?app_id=" + app_id)
  case xml.code
 when 200
    clean_xml = xml.body.strip
   parsed = Veracode::Parser.parse(clean_xml) 
   appinfo = Veracode::Upload::ApplicationInfo.new(parsed.appinfo)
  else
    xml.error!
  end
end

#get_application_listObject



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/veracode/upload.rb', line 24

def get_application_list
  xml = getXML(GET_APP_LIST_URI)
 case xml.code
 when 200
    clean_xml = xml.body.strip
   parsed = Veracode::Parser.parse(clean_xml) 
   apps = Veracode::Upload::AppList.new(parsed.applist)
  else
    xml.error!
  end
end

#get_build_info(app_id, build_id = nil) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/veracode/upload.rb', line 48

def get_build_info(app_id, build_id=nil) 
  url = GET_BUILD_INFO_URI + "?app_id=" + app_id
  url += "&build_id=#{build_id}" if !build_id.nil? 
  
  xml = getXML(url)
  case xml.code
 when 200
    clean_xml = xml.body.strip
   parsed = Veracode::Parser.parse(clean_xml) 
   builds = Veracode::Upload::BuildInfo.new(parsed.buildinfo)
  else
    xml.error!
  end
end

#get_build_list(app_id) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/veracode/upload.rb', line 36

def get_build_list(app_id)
  xml = getXML(GET_BUILD_LIST_URI + "?app_id=" + app_id)
  case xml.code
 when 200
    clean_xml = xml.body.strip
   parsed = Veracode::Parser.parse(clean_xml) 
   appinfo = Veracode::Upload::BuildList.new(parsed.buildlist)
  else
    xml.error!
  end
end