<?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>topic Re: Get kubernetes cluster name form uuid in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-kubernetes-cluster-name-form-uuid/m-p/260594#M3439</link>
    <description>&lt;P&gt;Hi Johan,&lt;/P&gt;&lt;P&gt;Try adding &lt;STRONG&gt;,fromRelationships.isClusterOfPg(type("PROCESS_GROUP"),entityId("PROCESS_GROUP-ID"))&lt;/STRONG&gt; on entityselector field&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Elena.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Oct 2024 05:46:29 GMT</pubDate>
    <dc:creator>erh_inetum</dc:creator>
    <dc:date>2024-10-25T05:46:29Z</dc:date>
    <item>
      <title>Get kubernetes cluster name form uuid</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-kubernetes-cluster-name-form-uuid/m-p/260562#M3437</link>
      <description>&lt;P&gt;Hi!, when getting some information from a process group instance&amp;nbsp; that runs on a pod in a kubernetes cluster, I can get the&amp;nbsp;KUBERNETES_CLUSTER_ID that looks like a UUID:&lt;/P&gt;
&lt;P&gt;curl &lt;A href="https://{environmentid}.live.dynatrace.com/api/v2/entities/PROCESS_GROUP_INSTANCE-ABCDEFGHI1234567" target="_blank" rel="noopener"&gt;https://{environmentid}.live.dynatrace.com/api/v2/entities/PROCESS_GROUP_INSTANCE-ABCDEFGHI1234567&lt;/A&gt; | jq -r '.properties.metadata[] | select(.key == "KUBERNETES_CLUSTER_ID")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;703de8b4-2bc0-4f31-8303-3507b58d9d8b&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when I try to find to which cluster is related there is no field that can match that UUID:&lt;/P&gt;
&lt;P&gt;curl &lt;A href="https://{environmentid}.live.dynatrace.com/api/v2/entities?entitySelector=type(KUBERNETES_CLUSTER" target="_blank" rel="noopener"&gt;https://{environmentid}.live.dynatrace.com/api/v2/entities?entitySelector=type(KUBERNETES_CLUSTER&lt;/A&gt;)' | jq .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;{
  "totalCount": 3,
  "pageSize": 50,
  "entities": [
    {
      "entityId": "KUBERNETES_CLUSTER-A1",
      "type": "KUBERNETES_CLUSTER",
      "displayName": "cluster-1"
    },
    {
      "entityId": "KUBERNETES_CLUSTER-B2",
      "type": "KUBERNETES_CLUSTER",
      "displayName": "cluster-2"
    },
    {
      "entityId": "KUBERNETES_CLUSTER-C3",
      "type": "KUBERNETES_CLUSTER",
      "displayName": "cluster-3"
    }
  ]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I relate that UUID with some entity that can give me the cluster name?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Johann&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 07:27:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-kubernetes-cluster-name-form-uuid/m-p/260562#M3437</guid>
      <dc:creator>johannrenck</dc:creator>
      <dc:date>2024-10-25T07:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Get kubernetes cluster name form uuid</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-kubernetes-cluster-name-form-uuid/m-p/260594#M3439</link>
      <description>&lt;P&gt;Hi Johan,&lt;/P&gt;&lt;P&gt;Try adding &lt;STRONG&gt;,fromRelationships.isClusterOfPg(type("PROCESS_GROUP"),entityId("PROCESS_GROUP-ID"))&lt;/STRONG&gt; on entityselector field&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Elena.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 05:46:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-kubernetes-cluster-name-form-uuid/m-p/260594#M3439</guid>
      <dc:creator>erh_inetum</dc:creator>
      <dc:date>2024-10-25T05:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get kubernetes cluster name form uuid</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-kubernetes-cluster-name-form-uuid/m-p/260600#M3440</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/82177"&gt;@johannrenck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should specify the entity selector based on which the results will be filtered and being included in the Json file and later on can be saved in Excel Sheet.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-10-25_10h23_45.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/24133i24420649D064733C/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-10-25_10h23_45.png" alt="2024-10-25_10h23_45.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DT Ref:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://docs.dynatrace.com/docs/dynatrace-api/environment-api/entity-v2/get-entity-type" target="_blank"&gt;https://docs.dynatrace.com/docs/dynatrace-api/environment-api/entity-v2/get-entity-type&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can also refer to the provided guidance by&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/40722"&gt;@erh_inetum&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hoping it adds value.&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Peter.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 06:29:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-kubernetes-cluster-name-form-uuid/m-p/260600#M3440</guid>
      <dc:creator>Peter_Youssef</dc:creator>
      <dc:date>2024-10-25T06:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Get kubernetes cluster name form uuid</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Get-kubernetes-cluster-name-form-uuid/m-p/260617#M3441</link>
      <description>&lt;P&gt;you can use this entity selector to get the full details about the cluster&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;type(KUBERNETES_CLUSTER),kubernetesClusterId("703de8b4-2bc0-4f31-8303-3507b58d9d8b")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then, under relationships key focus on `toRelationship` and use it in reverse way like the following entitySelector statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;type(process_group_instance),fromRelationship.isMainPgiOfCgi(type(CONTAINER_GROUP_INSTANCE),fromRelationship.isCgiOfCluster(type(KUBERNETES_CLUSTER),kubernetesClusterId("703de8b4-2bc0-4f31-8303-3507b58d9d8b")))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is if you need to get all process group instances that's included within your cluster as example&lt;/P&gt;&lt;P&gt;you trace each entity from the relationship in this way like this&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://{environmentid}.live.dynatrace.com/api/v2/entities?entitySelector=type(KUBERNETES_CLUSTER" target="_blank" rel="noopener nofollow noreferrer"&gt;https://{environmentid}.live.dynatrace.com/api/v2/entities&lt;FONT color="#0000FF"&gt;&lt;U&gt;/&lt;/U&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT color="#0000FF"&gt;&lt;U&gt;KUBERNETES_CLUSTER-C3&lt;/U&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;, then check the entity details and to follow the sequence of relationships&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 09:39:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Get-kubernetes-cluster-name-form-uuid/m-p/260617#M3441</guid>
      <dc:creator>MostafaHussein</dc:creator>
      <dc:date>2024-10-25T09:39:19Z</dc:date>
    </item>
  </channel>
</rss>

