Rohit Gupta created RANGER-5695:
-----------------------------------
Summary: Delete request on service/audit/metrics api is returning
204 for all type of params
Key: RANGER-5695
URL: https://issues.apache.org/jira/browse/RANGER-5695
Project: Ranger
Issue Type: Bug
Components: Ranger
Affects Versions: 3.0.0
Reporter: Rohit Gupta
*PROBLEM STATEMENT:*
Delete request on service/audit/metrics Api is returning 204 status code for
both existing param or non-existing param.
Either make delete request with existing service name and type or non-existing
service name and type in both cases its returning 204 as status code.
*BUILDS:*
Base Url:
[https://quasar-jlwjwm-1.quasar-jlwjwm.root.hwx.site:7183|https://quasar-jlwjwm-1.quasar-jlwjwm.root.hwx.site:7183/]
CDH-Version: 7.1.9-1.cdh7.1.9.p0.44702451
Parcel URL:
[http://cloudera-build-us-west-1.vpc.cloudera.com/s3/build/44702451/cdh/7.x/parcels]
*STEPS TO REPRODUCE:*
1. Create metrics for serviceName="cm_hive" and serviceType="hive" by making
POST call on "/service/audit/metrics" endpoint with following payload:
{code:java}
{ "serviceType": "hive", "serviceName": "cm_hive", "appId": "hive",
"clusterName": "Cluster 1", "throughPutUnit": "PER MINUTE", "numberOfAudits":
6799, "clientIP": "172.27.18.78", "metricsText": { "metrics": { "1m":
5000 } }} {code}
2. Then Try to delete the metrics by making delete request on
"/service/audit/metrics?retentionPeriod=1&serviceName={*}cm_hive{*}&serviceType={*}hive{*}"
endpoint. The status code will be 204 without any response text. Here
serviceName and serviceType are existent.
3. But if a delete request is performed on
"/service/audit/metrics?retentionPeriod=1&serviceName={*}cm_hive_unknown{*}&serviceType={*}hive_unknown{*}".
Then also it will return 204 as status code without any response text for
non-existent service name and type.
*CURRENT BEHAVIOUR:*
Right now getting 204 for both the cases even if the service name and type
exist or not.
*EXPECTED BEHAVIOUR:*
The response code should be proper and different for both cases with proper
response text.
*OCCURRENCE:*
manual testing
*IMPACT:*
User not able to identify is the delete operation went though correctly or not.
The input param provided by user to delete is correct or not.
*LOG ARTIFACTS:*
Find in attachments
*REPRODUCIBLE ENVIRONMENT:*
Below cluster available for next 12 hrs .
quasar-jlwjwm-1.quasar-jlwjwm.root.hwx.site
*ARTIFACTS to help Dev to reproduce or verify the fix:*
No artifacts available for manual testing.
Verify fix on any 7.1.9 cluster by using the same scenario from steps to
reproduce.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)