如何通过 REST 更新 HP Fortify 'Processing Rules'
How to update HP Fortify 'Processing Rules' via REST
我已经阅读了文档,我得到了 REST API GET URL...
http://localhost:8080/ssc/api/v1/projectVersions/6/resultProcessingRules
工作和 return 我的应用程序的 'Profile - Processing Rules' 列表(通过 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
}
我无法开始工作的是将此设置从 'enabled=true' 到 'enabled=false'
的 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
谁能告诉我这个命令的正确负载应该是多少?
使用 Postman,我让它工作:
这是我用过的headers
- 授权 = FortifyToken A13D...E2
- Content-Type = application/json
- 接受 = 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 执行操作(Fiddler,浏览器的开发工具等)。然后查看它发送的请求。 HTML5 接口在底层使用 REST API。
我已经阅读了文档,我得到了 REST API GET URL...
http://localhost:8080/ssc/api/v1/projectVersions/6/resultProcessingRules
工作和 return 我的应用程序的 'Profile - Processing Rules' 列表(通过 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
}
我无法开始工作的是将此设置从 'enabled=true' 到 'enabled=false'
的 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
谁能告诉我这个命令的正确负载应该是多少?
使用 Postman,我让它工作:
这是我用过的headers
- 授权 = FortifyToken A13D...E2
- Content-Type = application/json
- 接受 = 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 执行操作(Fiddler,浏览器的开发工具等)。然后查看它发送的请求。 HTML5 接口在底层使用 REST API。