<?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: CLI to get expiration date of Cloudera license in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/CLI-to-get-expiration-date-of-Cloudera-license/m-p/319934#M228043</link>
    <description>&lt;P&gt;sending basic examples of getting the expiration date via API&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for single host:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;import cm_client&lt;BR /&gt;from cm_client.rest import ApiException&lt;BR /&gt;from pprint import pprint&lt;/P&gt;&lt;P&gt;# Configure HTTP basic authorization: basic&lt;BR /&gt;cm_client.configuration.username = '&amp;lt;USERNAME&amp;gt;'&lt;BR /&gt;cm_client.configuration.password = '&amp;lt;PASSWORD&amp;gt;'&lt;/P&gt;&lt;P&gt;# Create an instance of the API class&lt;BR /&gt;api_host = 'http://&amp;lt;Cloudera host&amp;gt;'&lt;BR /&gt;port = '7180'&lt;BR /&gt;api_version = 'v41'&lt;BR /&gt;# Construct base URL for API&lt;BR /&gt;api_url = api_host + ':' + port + '/api/' + api_version&lt;BR /&gt;api_client = cm_client.ApiClient(api_url)&lt;BR /&gt;cluster_api_instance = cm_client.ClouderaManagerResourceApi(api_client)&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;# Retrieve information about the Cloudera Manager license.&lt;BR /&gt;api_response = cluster_api_instance.read_license()&lt;BR /&gt;pprint(api_response.expiration)&lt;BR /&gt;except ApiException as e:&lt;BR /&gt;print("Exception when calling ClouderaManagerResourceApi-&amp;gt;read_license: %s\n" % e)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;for several hosts:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;import cm_client&lt;BR /&gt;from cm_client.rest import ApiException&lt;BR /&gt;from pprint import pprint&lt;BR /&gt;import datetime&lt;/P&gt;&lt;P&gt;# Configure HTTP basic authorization: basic&lt;BR /&gt;cm_client.configuration.username = '&amp;lt;USERNAME&amp;gt;'&lt;BR /&gt;cm_client.configuration.password = '&amp;lt;PASSWORD&amp;gt;'&lt;/P&gt;&lt;P&gt;hosts_list= {"&amp;lt;host 1&amp;gt;" , "&amp;lt;host 2&amp;gt;" , "&amp;lt;host 3&amp;gt;", ....}&lt;BR /&gt;# Create an instance of the API class&lt;/P&gt;&lt;P&gt;for cdh_host in hosts_list:&lt;BR /&gt;api_host = 'http://' + cdh_host&lt;BR /&gt;port = '7180'&lt;BR /&gt;api_version = 'v41'&lt;BR /&gt;# Construct base URL for API&lt;BR /&gt;api_url = api_host + ':' + port + '/api/' + api_version&lt;BR /&gt;api_client = cm_client.ApiClient(api_url)&lt;BR /&gt;cluster_api_instance = cm_client.ClouderaManagerResourceApi(api_client)&lt;BR /&gt;print cdh_host + ":"&lt;BR /&gt;try:&lt;BR /&gt;# Retrieve information about the Cloudera Manager license.&lt;BR /&gt;api_response = cluster_api_instance.read_license()&lt;BR /&gt;expiration_date = api_response.expiration[0:10]&lt;BR /&gt;print(expiration_date)&lt;BR /&gt;print "##############"&lt;BR /&gt;except ApiException as e:&lt;BR /&gt;print("Exception when calling ClouderaManagerResourceApi-&amp;gt;read_license: %s\n" % e)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jul 2021 10:58:20 GMT</pubDate>
    <dc:creator>noamsh88</dc:creator>
    <dc:date>2021-07-06T10:58:20Z</dc:date>
    <item>
      <title>CLI to get expiration date of Cloudera license</title>
      <link>https://community.cloudera.com/t5/Support-Questions/CLI-to-get-expiration-date-of-Cloudera-license/m-p/319526#M227863</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to write Bash script to run across all of our Cloudera hosts and to monitor if some envs are going to be expired&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;via GUI, i'm able to see it on&amp;nbsp;&lt;A href="http://&amp;lt;cloudera" target="_blank" rel="noopener"&gt;http://&amp;lt;cloudera&lt;/A&gt;&amp;nbsp;host&amp;gt;:7180/cmf/license/settings page&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does anyone know how can i get result of Cloudera license expiration date via command line?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Noam&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 13:24:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/CLI-to-get-expiration-date-of-Cloudera-license/m-p/319526#M227863</guid>
      <dc:creator>noamsh88</dc:creator>
      <dc:date>2021-06-29T13:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: CLI to get expiration date of Cloudera license</title>
      <link>https://community.cloudera.com/t5/Support-Questions/CLI-to-get-expiration-date-of-Cloudera-license/m-p/319535#M227866</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/89916"&gt;@noamsh88&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;check out these cloudera API's&lt;BR /&gt;&lt;A href="http://cloudera.github.io/cm_api/apidocs/v18/path__cm_license.html" target="_blank" rel="noopener"&gt;http://cloudera.github.io/cm_api/apidocs/v18/path__cm_license.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 15:11:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/CLI-to-get-expiration-date-of-Cloudera-license/m-p/319535#M227866</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2021-06-29T15:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: CLI to get expiration date of Cloudera license</title>
      <link>https://community.cloudera.com/t5/Support-Questions/CLI-to-get-expiration-date-of-Cloudera-license/m-p/319852#M227990</link>
      <description>&lt;P&gt;Thanks Shelton for the advise&lt;/P&gt;&lt;P&gt;will write something to get the expiration date via API&lt;/P&gt;&lt;P&gt;will be sharing example for future reference for community&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 11:26:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/CLI-to-get-expiration-date-of-Cloudera-license/m-p/319852#M227990</guid>
      <dc:creator>noamsh88</dc:creator>
      <dc:date>2021-07-05T11:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: CLI to get expiration date of Cloudera license</title>
      <link>https://community.cloudera.com/t5/Support-Questions/CLI-to-get-expiration-date-of-Cloudera-license/m-p/319934#M228043</link>
      <description>&lt;P&gt;sending basic examples of getting the expiration date via API&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for single host:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;import cm_client&lt;BR /&gt;from cm_client.rest import ApiException&lt;BR /&gt;from pprint import pprint&lt;/P&gt;&lt;P&gt;# Configure HTTP basic authorization: basic&lt;BR /&gt;cm_client.configuration.username = '&amp;lt;USERNAME&amp;gt;'&lt;BR /&gt;cm_client.configuration.password = '&amp;lt;PASSWORD&amp;gt;'&lt;/P&gt;&lt;P&gt;# Create an instance of the API class&lt;BR /&gt;api_host = 'http://&amp;lt;Cloudera host&amp;gt;'&lt;BR /&gt;port = '7180'&lt;BR /&gt;api_version = 'v41'&lt;BR /&gt;# Construct base URL for API&lt;BR /&gt;api_url = api_host + ':' + port + '/api/' + api_version&lt;BR /&gt;api_client = cm_client.ApiClient(api_url)&lt;BR /&gt;cluster_api_instance = cm_client.ClouderaManagerResourceApi(api_client)&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;# Retrieve information about the Cloudera Manager license.&lt;BR /&gt;api_response = cluster_api_instance.read_license()&lt;BR /&gt;pprint(api_response.expiration)&lt;BR /&gt;except ApiException as e:&lt;BR /&gt;print("Exception when calling ClouderaManagerResourceApi-&amp;gt;read_license: %s\n" % e)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;for several hosts:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;import cm_client&lt;BR /&gt;from cm_client.rest import ApiException&lt;BR /&gt;from pprint import pprint&lt;BR /&gt;import datetime&lt;/P&gt;&lt;P&gt;# Configure HTTP basic authorization: basic&lt;BR /&gt;cm_client.configuration.username = '&amp;lt;USERNAME&amp;gt;'&lt;BR /&gt;cm_client.configuration.password = '&amp;lt;PASSWORD&amp;gt;'&lt;/P&gt;&lt;P&gt;hosts_list= {"&amp;lt;host 1&amp;gt;" , "&amp;lt;host 2&amp;gt;" , "&amp;lt;host 3&amp;gt;", ....}&lt;BR /&gt;# Create an instance of the API class&lt;/P&gt;&lt;P&gt;for cdh_host in hosts_list:&lt;BR /&gt;api_host = 'http://' + cdh_host&lt;BR /&gt;port = '7180'&lt;BR /&gt;api_version = 'v41'&lt;BR /&gt;# Construct base URL for API&lt;BR /&gt;api_url = api_host + ':' + port + '/api/' + api_version&lt;BR /&gt;api_client = cm_client.ApiClient(api_url)&lt;BR /&gt;cluster_api_instance = cm_client.ClouderaManagerResourceApi(api_client)&lt;BR /&gt;print cdh_host + ":"&lt;BR /&gt;try:&lt;BR /&gt;# Retrieve information about the Cloudera Manager license.&lt;BR /&gt;api_response = cluster_api_instance.read_license()&lt;BR /&gt;expiration_date = api_response.expiration[0:10]&lt;BR /&gt;print(expiration_date)&lt;BR /&gt;print "##############"&lt;BR /&gt;except ApiException as e:&lt;BR /&gt;print("Exception when calling ClouderaManagerResourceApi-&amp;gt;read_license: %s\n" % e)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 10:58:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/CLI-to-get-expiration-date-of-Cloudera-license/m-p/319934#M228043</guid>
      <dc:creator>noamsh88</dc:creator>
      <dc:date>2021-07-06T10:58:20Z</dc:date>
    </item>
  </channel>
</rss>

