<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229534#M191387</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/16941/454596169.html" nodeid="16941"&gt;@jack jack
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;First you should open a new HCC thread that way each individual queries are tracked separately. &lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2017 14:24:18 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2017-06-08T14:24:18Z</dc:date>
    <item>
      <title>How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229525#M191378</link>
      <description>&lt;P&gt;Need curl calls to grant different view access through rest apis. I am currently able to create user and reset the password using ambari rest api as of now @&lt;A href="https://community.hortonworks.com/users/140/nsabharwal.html"&gt;Neeraj Sabharwal&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 01:08:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229525#M191378</guid>
      <dc:creator>hadcloudera</dc:creator>
      <dc:date>2017-05-13T01:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229526#M191379</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18288/sushantc.html" nodeid="18288"&gt;@Sushant Choudhary&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;
Suppose you want to give File View &lt;STRONG&gt;"Grant permission to these users"&lt;/STRONG&gt; , The username is&lt;STRONG&gt; "jay"&lt;/STRONG&gt; then you can make the following API call for the FileView.&lt;/P&gt;&lt;PRE&gt;# curl -i -u admin:admin -H "X-Requested-By: ambari" -X PUT  -d '[{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"amy_ds","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"holger_gov","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"maria_dev","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"raj_ops","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"jay","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"views","principal_type":"GROUP"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.ADMINISTRATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.OPERATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"SERVICE.OPERATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"SERVICE.ADMINISTRATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.USER","principal_type":"ROLE"}}]'  &lt;A href="http://localhost:8080/api/v1/views/FILES/versions/1.0.0/instances/AUTO_FILES_INSTANCE/privileges" target="_blank"&gt;http://localhost:8080/api/v1/views/FILES/versions/1.0.0/instances/AUTO_FILES_INSTANCE/privileges&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 01:17:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229526#M191379</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-05-13T01:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229527#M191380</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18288/sushantc.html" nodeid="18288"&gt;@Sushant Choudhary
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;From readability point i am posting the JSON data in the Pretty JSON format here.&lt;/P&gt;&lt;PRE&gt;[
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "amy_ds",
      "principal_type": "USER"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "holger_gov",
      "principal_type": "USER"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "maria_dev",
      "principal_type": "USER"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "raj_ops",
      "principal_type": "USER"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "jay",
      "principal_type": "USER"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "views",
      "principal_type": "GROUP"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "CLUSTER.ADMINISTRATOR",
      "principal_type": "ROLE"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "CLUSTER.OPERATOR",
      "principal_type": "ROLE"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "SERVICE.OPERATOR",
      "principal_type": "ROLE"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "SERVICE.ADMINISTRATOR",
      "principal_type": "ROLE"
    }
  },
  {
    "PrivilegeInfo": {
      "permission_name": "VIEW.USER",
      "principal_name": "CLUSTER.USER",
      "principal_type": "ROLE"
    }
  }
&lt;/PRE&gt;&lt;P&gt;. &lt;/P&gt;&lt;P&gt;You can edit the PrivilegeInfo section from the above JSON data to give appropriate permission (principal_name)&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 01:24:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229527#M191380</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-05-13T01:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229528#M191381</link>
      <description>&lt;P&gt;Is VIEW.USER permission specific to File view ? How do I grant access to Tez/Hive view. Any documentation on this ?&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 01:42:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229528#M191381</guid>
      <dc:creator>hadcloudera</dc:creator>
      <dc:date>2017-05-13T01:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229529#M191382</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18288/sushantc.html" nodeid="18288"&gt;@Sushant Choudhary
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Granting permission is not different for Hive/Tez/File View or other Views. The curl call should be almost same. You need to just adjust the privilleges properly in the json. Please take a look at the "Hive View" granting example for user "jay"&lt;/P&gt;&lt;P&gt;
&lt;STRONG&gt;Example For Hive&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl -i -u admin:admin -H "X-Requested-By: ambari" -X PUT  -d  '[{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"amy_ds","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"holger_gov","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"maria_dev","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"raj_ops","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"jay","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.ADMINISTRATOR","principal_type":"ROLE"}}]'  &lt;A href="http://localhost:8080/api/v1/views/HIVE/versions/1.5.0/instances/AUTO_HIVE_INSTANCE/privileges" target="_blank"&gt;http://localhost:8080/api/v1/views/HIVE/versions/1.5.0/instances/AUTO_HIVE_INSTANCE/privileges&lt;/A&gt;
&lt;/PRE&gt;&lt;P&gt;
For more information of User Permissions for views please refer to: &lt;/P&gt;&lt;P&gt;
- &lt;A href="https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-views/content/section_user_permissions_hive_view.html"&gt;https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-views/content/section_user_permissions_hive_view.html
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- &lt;A href="https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-views/content/section_user_permissions_tez_view.html"&gt;https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-views/content/section_user_permissions_tez_view.html&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18288/sushantc.html" nodeid="18288"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 07:48:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229529#M191382</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-05-13T07:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229530#M191383</link>
      <description>&lt;P&gt;Hi Jay, I am trying to get all critical alerts from ambari using:&lt;/P&gt;&lt;P&gt;&lt;A href="http://ambari-server:8080/api/v1/clusters/clustername/alerts?Alert/state.in%28CRITICAL%29"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;curl -u username:password -i -H 'X-Requested-By:ambari' -X GET &lt;A href="http://ambari-server:8080/api/v1/clusters/clustername/alerts?Alert/state=CRITICAL" target="_blank"&gt;http://ambari-server:8080/api/v1/clusters/clustername/alerts?Alert/state=CRITICAL&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I don't want all fields here . For e.g I need service name and definition name , how to incorporate it in above curl&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 16:34:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229530#M191383</guid>
      <dc:creator>hadcloudera</dc:creator>
      <dc:date>2017-05-17T16:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229531#M191384</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18288/sushantc.html" nodeid="18288"&gt;@Sushant
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If the original query that you asked as part of this thread is resolved and the previously provided updates helped you in answering your query then please mark this thread as "Accept" , that way it helps the community users to find a specific  query and it's specific answer quickly.&lt;/P&gt;&lt;P&gt;
I will suggest it will be great if oyu open a new Thread in HCC for your new query related to Alert.&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18288/sushantc.html" nodeid="18288"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 16:44:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229531#M191384</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-05-17T16:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229532#M191385</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18288/sushantc.html" nodeid="18288"&gt;@Sushant
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also regarding your query on getting ambari CRITICAL alerts list please try:&lt;/P&gt;&lt;PRE&gt;
curl -u username:password -i -H 'X-Requested-By:ambari' -X GET &lt;A href="http://erie1.example.com:8080/api/v1/clusters/ErieCluster/alerts?fields=*&amp;amp;Alert/state.in%28CRITICAL%29"&gt;http://erie1.example.com:8080/api/v1/clusters/ErieCluster/alerts?fields=*&amp;amp;Alert/state.in(CRITICAL)&lt;/A&gt;

OR

curl -u username:password -i -H 'X-Requested-By:ambari' -X GET &lt;A href="http://erie1.example.com:8080/api/v1/clusters/ErieCluster/alerts?fields=*&amp;amp;Alert/state=CRITICAL" target="_blank"&gt;http://erie1.example.com:8080/api/v1/clusters/ErieCluster/alerts?fields=*&amp;amp;Alert/state=CRITICAL&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 16:52:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229532#M191385</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-05-17T16:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229533#M191386</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/18288/sushantc.html"&gt;Sushant&lt;/A&gt; How can I create a read-only user by ambari Rest API&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 14:22:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229533#M191386</guid>
      <dc:creator>454596169</dc:creator>
      <dc:date>2017-06-08T14:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I grant different view access like Hive/Tez/File using ambari rest api calls ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229534#M191387</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/16941/454596169.html" nodeid="16941"&gt;@jack jack
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;First you should open a new HCC thread that way each individual queries are tracked separately. &lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 14:24:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-grant-different-view-access-like-Hive-Tez-File/m-p/229534#M191387</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-06-08T14:24:18Z</dc:date>
    </item>
  </channel>
</rss>

