yeah I meant type &quot;resource&quot;. Thanks very helpful!<br><div class="gmail_quote"><div dir="ltr">John Mazzitelli &lt;<a href="mailto:mazz@redhat.com">mazz@redhat.com</a>&gt;於 2016年8月7日 週日,02:21寫道:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">BTW: the subject of your thread is &quot;Metric under Resource Type&quot; - I just wanted to clarify.<br>
<br>
You can&#39;t put Metrics under Resource Types - you put Metrics under Resources. See here :<br>
<br>
<a href="https://github.com/hawkular/hawkular-agent/blob/master/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/storage/AsyncInventoryStorage.java#L363" rel="noreferrer" target="_blank">https://github.com/hawkular/hawkular-agent/blob/master/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/storage/AsyncInventoryStorage.java#L363</a><br>
<br>
I believe Lukas K. told me once that right now you also can&#39;t put metric *types* under resource types either - all types are direct children under the root (so metric types are peers to resource types, not under them). The agent follows this rule as you see here:<br>
<br>
<a href="https://github.com/hawkular/hawkular-agent/blob/master/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/storage/AsyncInventoryStorage.java#L401" rel="noreferrer" target="_blank">https://github.com/hawkular/hawkular-agent/blob/master/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/storage/AsyncInventoryStorage.java#L401</a><br>
<br>
----- Original Message -----<br>
&gt; &gt; I posted my feed, resources and metrics to inventory with /bulk api.<br>
&gt; &gt; But the errors shows:<br>
&gt; &gt; &quot;errorMsg&quot; : &quot;Entity of type &#39;Metric&#39; cannot be created under an entity of<br>
&gt; &gt; type &#39;Resource&#39;.&quot;<br>
&gt; &gt; Why is this not allowed since I can do it with normal create entity api?<br>
&gt; &gt; How can I create a metric under a certain resource with bulk api?<br>
&gt;<br>
&gt; The agent does it in its /bulk requests. You can see how the agent does it<br>
&gt; here:<br>
&gt;<br>
&gt; <a href="https://github.com/hawkular/hawkular-agent/blob/master/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/storage/AsyncInventoryStorage.java#L194" rel="noreferrer" target="_blank">https://github.com/hawkular/hawkular-agent/blob/master/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/storage/AsyncInventoryStorage.java#L194</a><br>
&gt; _______________________________________________<br>
&gt; hawkular-dev mailing list<br>
&gt; <a href="mailto:hawkular-dev@lists.jboss.org" target="_blank">hawkular-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a><br>
&gt;<br>
_______________________________________________<br>
hawkular-dev mailing list<br>
<a href="mailto:hawkular-dev@lists.jboss.org" target="_blank">hawkular-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a><br>
</blockquote></div>