Versions Compared

Key

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

...

The following example shows creating an instance of the FILES view Files View, name FILES, version 0.1.0 .0 view called "MyFiles".

  1. Create the view instance.

    Code Block
    POST /api/v1/views/FILES/versions/0.1.0.0/instances/MyFiles
    
    [ {
    "ViewInstanceInfo" : {
        "properties" : {
          "dataworker.defaultFs" : "webhdfs://your.namenode.host:50070"
        }
      }
    } ]
    
    201 - CREATED
    Info

    When creating your view instance, be sure to provide all required view instance properties, otherwise you will receive a 500 with a message explaining the properties that are required.

  2. Restart Ambari Server to pick-up the view instance and UI resources.

    Code Block
    ambari-server restart
  3. Confirm the newly created view instance is available.

    Code Block
    GET /api/v1/views/FILES/
    
    {
      "href" : "http://127c6401.0ambari.0apache.1org:8080/api/v1/views/FILES/versions/0.1.0.0/",
      "ViewInfoViewVersionInfo" : {
        "archive" : "/var/lib/ambari-server/resources/views/files-0./work/FILES{0.1-SNAPSHOT-jar-with-dependencies.jar.0}",
        "label" : "Files",
        "masker_class" : null,
        "parameters" : [
          {
            "name" : "dataworker.defaultFs",
            "description" : "FileSystem URI",
            "required" : true,
            "masked" : false
          },
          {
            "name" : "dataworker.username",
            "description" : "The username (defaults to ViewContext username)",
            "required" : false,
            "masked" : false
          }
        ],
        "version" : "0.1.0.0",
        "view_name" : "FILES"
      },
      "permissions" : [ ],
      "instances" : [
        {
          "href" : "http://127c6401.0ambari.0apache.1org:8080/api/v1/views/FILES/versions/0.1.0.0/instances/MyFiles",
          "ViewInstanceInfo" : {
            "instance_name" : "MyFiles",
            "version" : "0.1.0",
            "view_name" : "FILES"
          }
        }
      ]
    }
  4. Browse to the view instance.

    Code Block
    http://127.0.0.1:8080/views/FILES/0.1.0.0/MyFiles