none
JAVA API for getting information about a given HDInsight RRS feed

  • Question

  • Hi,

     Can you please point me to documentation that will let me get the following information using some java api ?

     I need information similar to what is displayed by azure cli => az hdinsight show --resource-group <resource group> --name <cluster name>

     I am using Oracle java 8 

    Regards,

    Kiran

    Thursday, September 5, 2019 4:57 AM

All replies

  • Hi Kiran,

    The HDInsight SDK for Java provides classes and methods that allow you to manage your HDInsight clusters. It includes operations to create, delete, update, list, resize, execute script actions, monitor, get properties of HDInsight clusters, and more.

    To get properties for a given cluster:

    client.clusters.getByResourceGroup("<Resource Group Name>", "<Cluster Name>");

    Example: You can use get to confirm that you have successfully created your cluster.

    ClusterInner cluster = client.clusters().getByResourceGroup("<Resource Group Name>", "<Cluster Name>");
    
    System.out.println(cluster.name()); //Prints the name of the cluster
    
    System.out.println(cluster.id()); //Prints the resource Id of the cluster

    Hope this helps.      

    ----------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    Thursday, September 5, 2019 5:51 AM
    Moderator
  • Hi Kiran,

    Just checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same. And, if you have any further query do let us know.

    Friday, September 6, 2019 9:02 AM
    Moderator
  • Hi Kiran,

    Following up to see if the above suggestion was helpful. And, if you have any further query do let us know.

    Tuesday, September 10, 2019 4:21 AM
    Moderator