Can I create projects using the HP Fortify SSC's REST API? This works beautifully to grab a list of projects:
import requests
import getpass
import json
url = "https://www.example.com/ssc/api/v1/"
endpoint = "auth/obtain_token"
headers = {"Content-Type": "application/json",
"Accept": "application/json"}
username = getpass.getuser()
password = getpass.getpass()
auth = (username, password)
r = requests.post("{url}{endpoint}".format(url=url, endpoint=endpoint), headers=headers, auth=auth)
data = r.json().get("data")
token = data.get("token")
endpoint = "projects"
headers["Authentication"] = "FortifyToken {token}".format(token=token)
r = requests.get("{url}{endpoint}".format(url=url, endpoint=endpoint), headers=headers)
print json.dumps(r.json(), sort_keys=True, indent=4, separators=(',', ': '))
... But I don't see any examples in the API documentation for actually creating a project. I am specifically interested in doing so using the Python requests library. I do NOT want to have to do anything in Java (which is what all of the samples that come with the Fortify SSC WAR package are).
If anyone has any experience with the SSC REST API (or can point me to some better documentation), I'd appreciate any help you can give.
I finally got some good information out of HPE technical support, and was able to put together a script for creating projects using the SSC REST API in Python. The newest version of the SSC (17.10) makes this much easier with the Swaggerized REST API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With