<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>I have problems getting the HREF of a rpm publication to create
      the distribution.<br>
    </p>
    <p>in
<a class="moz-txt-link-freetext" href="https://pulp-rpm.readthedocs.io/en/latest/workflows/create_sync_publish.html#create-a-publication">https://pulp-rpm.readthedocs.io/en/latest/workflows/create_sync_publish.html#create-a-publication</a></p>
    <p>the command <br>
    </p>
    <p><tt>$ http POST :24817/pulp/api/v3/publications/rpm/rpm/
        repository=$REPO_HREF</tt></p>
    <p>Do not return the _href as in the example. It only gives the
      task, so I can not get the HREF at this moment.<br>
    </p>
    <p>The next command <br>
    </p>
    <p><code class="docutils literal notranslate"><span class="pre">$</span>
        <span class="pre">export</span> <span class="pre">PUBLICATION_HREF=$(http</span>
        <span class="pre">:24817/pulp/api/v3/publications/rpm/rpm/</span>
        <span class="pre">|</span> <span class="pre">jq</span> <span
          class="pre">-r</span> <span class="pre">'.results[]</span> <span
          class="pre">|</span> <span class="pre">._href')</span></code></p>
    <p>only works when there is only one publication. When there is more
      than one it gives</p>
    <p><tt>[vagrant@dev-pulp-server ~]$ http
        $PORT/pulp/api/v3/publications/rpm/rpm/  | jq -r '.results[] |
        ._href'</tt><tt><br>
      </tt><tt>/pulp/api/v3/publications/rpm/rpm/2e145f16-95a8-4a35-b1e4-ecdb5c4c08d9/</tt><tt><br>
      </tt><tt>/pulp/api/v3/publications/rpm/rpm/fa835dfb-4c33-4d7c-a74b-b0065b43ca97/</tt><tt><br>
      </tt><tt>/pulp/api/v3/publications/rpm/rpm/d4cd0d2a-9979-43af-8bcb-e4d24f8f6ebd/</tt><tt><br>
      </tt><tt>/pulp/api/v3/publications/rpm/rpm/c81bf7e3-8ba4-4642-a64f-fae6a73bc9ed/</tt><br>
    </p>
    <p>In previous release the selection was done with the publisher
      href</p>
    <p><code class="docutils literal notranslate"><span class="pre">$</span>
        <span class="pre">export</span> <span class="pre">PUBLICATION_HREF=$(http</span>
        <span class="pre">:24817/pulp/api/v3/publications/rpm/rpm/</span>
        <span class="pre">|</span> <span class="pre">jq</span> <span
          class="pre">-r</span> <span class="pre">'.results[]</span> <span
          class="pre">|</span> <span class="pre">._href')</span></code></p>
    <p>It will be interesting to have a query parameter that allow to
      select a publication based, for example, on the repository.<br>
    </p>
    <p><a class="moz-txt-link-freetext" href="https://pulp-rpm.readthedocs.io/en/latest/restapi.html#operation/publications_rpm_rpm_list">https://pulp-rpm.readthedocs.io/en/latest/restapi.html#operation/publications_rpm_rpm_list</a></p>
    <p>Also, to get the href at the creation of the publication will
      help and reduce the number of task.<br>
    </p>
    <p>Is there any solution I did not see?</p>
    <p>Juan<br>
    </p>
    <div class="moz-signature">-- <br>
      <div style="font-family: Verdana, Helvetica, Arial, sans-serif;
        font-size: 8pt; font-weight: normal; color: #616365;"> <img
          src="cid:part1.BAE87647.97AA3F00@unamur.be" style="display:
          block; margin: 1em 0em;">
        <p style="margin: 1em;"> <span style="font-weight: bold;">Juan
            CABRERA</span><br>
          <span style="color: #69BE28;">Correspondant informatique</span><br>
          <span>Département de Mathématiques</span> </p>
        <p style="margin: 1em;">
          <span style="font-weight: bold;">T.</span> 081724919<br>
          <a style="color: #69BE28;"
            href="mailto:juan.cabrera@unamur.be">juan.cabrera@unamur.be</a><br>
          <a style="color: #69BE28;"
            href="http://staff.unamur.be/jbcabrer">http://staff.unamur.be/jbcabrer</a>
        </p>
        <p style="margin: 1em;"> <span style="font-weight: bold;
            font-size: 8pt;">Université de Namur ASBL</span><br>
          <span>Rue de Bruxelles 61 - 5000 Namur</span><br>
          <span>Belgique</span><br>
        </p>
        <p style="margin: 1em; font-size: 6pt; color: #69BE28;"> <span>Let’s
            respect the environment together.</span><br>
          <span style="font-weight: bold;">Only print this message if
            necessary!</span><br>
        </p>
      </div>
    </div>
  </body>
</html>