Support Questions

Find answers, ask questions, and share your expertise

REST API + create an instance of SLIDER view

avatar

hi all

we want to create an instance of SLIDER view

103465-capturepng7.png

so we run the following API

 curl --user admin:admin -i -H 'X-Requested-By: ambari' -X POST http://localhost:8080/api/v1/views/SLIDER/versions/2.0.0/instances/SLIDER_NEW
HTTP/1.1 400 Bad Request
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-store
Pragma: no-cache
Set-Cookie: AMBARISESSIONID=hpxbpzq0m16x1xygqwvbu3340;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: admin
Content-Type: text/plain
Content-Length: 527
{
  "status" : 400,
  "message" : "{\"propertyResults\":{\"ambari.server.password\":{\"valid\":false,\"detail\":\"No property values exist for the required parameter ambari.server.password.\"},\"ambari.server.url\":{\"valid\":false,\"detail\":\"No property values exist for the required parameter ambari.server.url.\"},\"ambari.server.username\":{\"valid\":false,\"detail\":\"No property values exist for the required parameter ambari.server.username.\"}},\"valid\":false,\"detail\":\"The instance has invalid properties.\"}"

but not succeeded

please advice what is wrong with my API?

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Michael Bronson

Can you please try something like this:

# curl --user admin:admin -i -H 'X-Requested-By: ambari'  -X POST -d '{"ViewInstanceInfo":{"instance_name":"SLIDER_NEW","label":"SLIDER_NEW","visible":true,"description":"SLIDER_NEWDescription","properties":{"ambari.server.url":"http://localhost:8080/api/v1/clusters/YOUR_CLUSTER_NAME","ambari.server.username":"admin","ambari.server.password":"admin","slider.user":"admin"},"cluster_type":"NONE"}}'  http://localhost:8080/api/v1/views/SLIDER/versions/2.0.0/instances/SLIDER_NEW

.

You will need to make sure to change the Cluster Name "YOUR_CLUSTER_NAME" in the following piece of the JSON data:

"ambari.server.url":"http://localhost:8080/api/v1/clusters/YOUR_CLUSTER_NAME"

.

View solution in original post

6 REPLIES 6

avatar
Master Mentor

@Michael Bronson

Can you please try something like this:

# curl --user admin:admin -i -H 'X-Requested-By: ambari'  -X POST -d '{"ViewInstanceInfo":{"instance_name":"SLIDER_NEW","label":"SLIDER_NEW","visible":true,"description":"SLIDER_NEWDescription","properties":{"ambari.server.url":"http://localhost:8080/api/v1/clusters/YOUR_CLUSTER_NAME","ambari.server.username":"admin","ambari.server.password":"admin","slider.user":"admin"},"cluster_type":"NONE"}}'  http://localhost:8080/api/v1/views/SLIDER/versions/2.0.0/instances/SLIDER_NEW

.

You will need to make sure to change the Cluster Name "YOUR_CLUSTER_NAME" in the following piece of the JSON data:

"ambari.server.url":"http://localhost:8080/api/v1/clusters/YOUR_CLUSTER_NAME"

.

avatar

@Jay , when I click on "go to instance" we get

103466-capturepng7.png

Slider View requires access to user's home directory in HDFS to proceed. Contact your administrator to create the home directory. (File hdfs://hdfsha/user/slider does not exist.)
Michael-Bronson

avatar

I solved it by

hadoop fs -mkdir /user/slider

Michael-Bronson

avatar

but when I click on Create App button ( on the right side )

we get black screen , - why?

103467-capturepng7.png

Michael-Bronson

avatar

example after we click on - Create App button

103468-capturepng7.png

Michael-Bronson

avatar
Master Mentor

@Michael Bronson

Just create the home directory as follows

# su - hdfs
$ hdfs dfs -mkdir /user/slider
$ hdfs dfs -chown slider:hdfs /user/slider

That should be enough .. good luck