Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add the Service to the Cluster.

    Code Block
    POST
    /api/v1/clusters/MyCluster/services
    {
    "ServiceInfo": {
      "service_name":"TESTSRV"
      }
    }
  2. Add the Components to the Service. In this case, add TEST_CLIENT to TESTSRV.

    Code Block
    POST
    /api/v1/clusters/MyCluster/services/TESTSRV/components/TEST_CLIENT
    
  3. Install the component on a host. For example, on the c6403.ambari.apache.org host, first create the component resource, then have Ambari install the component. This will end up calling the install() method in the command script.

    Code Block
    POST
    /api/v1/clusters/MyCluster/hosts/c6403.ambari.apache.org/host_components/TEST_CLIENT
    Code Block
    PUT
    /api/v1/clusters/MyCluster/hosts/c6403.ambari.apache.org/host_components/TEST_CLIENT
    
    {
      "RequestInfo":{
        "context":"Install Test Srv"},
         "Body":{
          "HostRoles":{
            "state":"INSTALLED"
          }
       }
    }
  4. Use the following to configure the client on the host. This will end up calling the configure() method in the command script.

    Code Block
    POST
    /api/v1/clusters/MyCluster/requests
     
    {
      "RequestInfo" : {
        "command" : "CONFIGURE",
        "context" : "Config Test Srv Client"
      },
      "Requests/resource_filters": [{
        "service_name" : "TESTSRV",
         "component_name" : "TEST_CLIENT",
        "hosts" : "c6403.ambari.apache.org"
      }]
    }
  5. If you want to see which hosts the component is installed.

    Code Block
    GET
    /api/v1/clusters/MyCluster/components/TEST_CLIENT