2016-11-27 357 views
0

我读过的文件,而我得到的REST API GET网址...如何更新HP Fortify的“处理规则”通过REST

http://localhost:8080/ssc/api/v1/projectVersions/6/resultProcessingRules 

工作,并返回“配置文件的列表 - 处理规则“(通过ID 6)。 例如

"data": [ 
    { 
     "displayName": "Require approval if the Build Project is different between scans", 
     "identifier": "com.fortify.manager.BLL.processingrules.BuildProjectProcessingRule", 
     "enabled": true, 
     "displayable": true 
    } 

我不能去工作,是PUT命令来设置这个“启用=真”到“启用=假”

我回来了同样的错误消息,每次...

{ 
    "message": "An unexpected error occurred accessing resource of type Project Version Result Processing Rules.", 
    "responseCode": 500, 
    "errorCode": -20010 
} 

和日志只是说...

2016-11-27 23:24:40,076 [ERROR] com.fortify.server.platform.endpoints.rest.ProjectVersionResultProcessingRulesController - ApiGeneralResourceException: 'An unexpected error occurred accessing resource of type Project Version Result Processing Rules.' [url: /ssc/api/v1/projectVersions/6/resultProcessingRules] 
2016-11-27 23:24:40,077 [WARN] org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver - Handler execution resulted in exception: java.lang.String cannot be cast to java.util.List 

谁能告诉我正确的有效载荷应该是什么这个comman d?

回答

0

使用邮差,我得到这个工作:

下面是我用

  • 授权= FortifyToken A13D ... E2
  • 内容类型=应用程序/ JSON
  • 头Accept = application/json

这里是body:

[ 
    { 
    "displayName": "Require approval if the Build Project is different between scans", 
    "identifier": "com.fortify.manager.BLL.processingrules.BuildProjectProcessingRule", 
    "enabled": true, 
    "displayable": true 
    } 
] 

注意

试图找出谁调用REST API是执行通过HTML5 UI的动作,而着眼于交通(提琴手,浏览器的开发者工具时,我已经使用诀窍等)。然后查看它发送的请求。 HTML5接口使用REST API。