Support Questions
Find answers, ask questions, and share your expertise

How to create service in hdfs-plugin with Rest Api call?

How to create service in hdfs-plugin with Rest Api call?

Explorer

I am trying to create a service in hdfs-plugin. I am refering this link.

I have tried below curl command:

curl -H "Content-Type: application/json" -X POST -d '{"configs": {"password": "*****","username": "admin"},"description":"hdfsservice","isEnabled": true,"name": "hadoopdev","type": "test","version": 1}' http://localhost:6080/service/public/v2/api/service

When I ran this it didn't give any response, not even any error.

Can someone help me to know if this is the correct curl or not?

1 REPLY 1
Highlighted

Re: How to create service in hdfs-plugin with Rest Api call?

Explorer

I am able to create with the below rest call:

curl -ivu admin:admin -H "Content-Type: application/json" -d '{"name":"hdfs-test-service","description":"testing","repositoryType":"hdfs","config":"{\"username\":\"admin\",\"password\":\"admin\",\"fs.default.name\":\"hdfs://<namenode-host>:9000\",\"hadoop.security.authorization\":true,\"hadoop.security.authentication\":\"simple\"}","isActive":true}' -X POST http://<ranger-host>:6080/service/public/api/repository