Support Questions

Find answers, ask questions, and share your expertise

rest api install service

avatar
Expert Contributor
in attempt to use the rest api to install the service rather than blueprints creating service yields 400 error with a cryptic "No repositories were found for service installation"
curl -vX POST -u admin:admin --header "X-Requested-By: ambari" -d '{"ServiceInfo":{"service_name":"ZOOKEEPER"}}' http://myhost:8080/api/v1/clusters/testCluster/services
"status" : 400,
"message" : "No repositories were found for service installation"

if i check my repository_version as so

http://myhost:8080/api/v1/stacks/HDP/versions/2.6/repository_versions/
{
  "href" : "http://myhost:8080/api/v1/stacks/HDP/versions/2.6/repository_versions/",
  "items" : [
    {
      "href" : "http://myhost:8080/api/v1/stacks/HDP/versions/2.6/repository_versions/1",
      "RepositoryVersions" : {
        "id" : 1,
        "stack_name" : "HDP",
        "stack_version" : "2.6"
      }
    }
  ]
}

It seems that there was a recent commit which added this but there are no new examples which specify where and how this repository id is to be supplied ?

What is the correct way to add a service to a cluster ?

Also where are all the payload definition references ?

1 ACCEPTED SOLUTION

avatar
Expert Contributor

so this works; probably the documentation needs to be updated

curl -vX POST -u admin:admin --header "X-Requested-By: ambari"-d '{"ServiceInfo":{"service_name":"ZOOKEEPER", "desired_repository_version_id":1}}' http://myhost:8080/api/v1/clusters/testCluster/services

View solution in original post

1 REPLY 1

avatar
Expert Contributor

so this works; probably the documentation needs to be updated

curl -vX POST -u admin:admin --header "X-Requested-By: ambari"-d '{"ServiceInfo":{"service_name":"ZOOKEEPER", "desired_repository_version_id":1}}' http://myhost:8080/api/v1/clusters/testCluster/services