<div dir="ltr">But this procedure will force me to download all images in advance, which I can not do.<div><br></div><div>I NEED the previous behavior, where Glance download the images by itself, on demand.</div><div><br></div><div>How to do this with V2 ?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 February 2016 at 01:47, Fei Long Wang <span dir="ltr"><<a href="mailto:feilong@catalyst.net.nz" target="_blank">feilong@catalyst.net.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Glance v2 doesn't support 'location' anymore, now there are multi
    locations for image in V2. You can use 'glance location-add' after
    create the the image by 'glance image-create --file xxx'<div><div class="h5"><br>
    <br>
    <div>On 18/02/16 15:51, Martinx - ジェームズ
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">Hey guys, any news about this?
        <div><br>
        </div>
        <div>I want to use Glance v2 but, without --location that points
          to a URL and, for me, without it, it is impossible to use it
          (v2).</div>
        <div><br>
        </div>
        <div>So, any plans to bring back --location, I want to use v2
          like this:</div>
        <div><br>
        </div>
        <div>--</div>
        <div>glance image-create --location <a href="http://uec-images.ubuntu.com/releases/14.04.3/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img" target="_blank">http://uec-images.ubuntu.com/releases/14.04.3/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img</a>
          --name "Ubuntu 14.04.3 LTS - Trusty Tahr - 64-bit - Cloud
          Based Image" --visibility public --container-format bare
          --disk-format qcow2<br>
        </div>
        <div>--</div>
        <div><br>
        </div>
        <div>But, "--location" isn't recognized anymore!</div>
        <div><br>
        </div>
        <div>Thanks!</div>
        <div>Thiago</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 22 January 2014 at 14:30, Mark
          Washenberger <span dir="ltr"><<a href="mailto:mark.washenberger@markwash.net" target="_blank">mark.washenberger@markwash.net</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr"><br>
              <div class="gmail_extra"><br>
                <br>
                <div class="gmail_quote"><span>On Wed, Jan 22,
                    2014 at 1:05 AM, Public Mail <span dir="ltr"><<a href="mailto:kpublicmail@gmail.com" target="_blank"></a><a href="mailto:kpublicmail@gmail.com" target="_blank">kpublicmail@gmail.com</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
                      All,<br>
                      <br>
                          I have two questions ...<br>
                      <br>
                          1) Glance v1 APIs can take a --location
                      argument when creating an image<br>
                             but v2 APIs can't - bug or feature?
                      (Details below)<br>
                    </blockquote>
                    <div><br>
                    </div>
                  </span>
                  <div>I'd call that a missing feature. I think we
                    probably need a glance image-location-add command
                    somewhere in the client. But fair warning, this is
                    typically a role-restricted operation. </div>
                  <span>
                    <div> </div>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <br>
                          2) How should glanceclient (v2 commands)
                      handle reserved attributes?<br>
                              a) status quo: (Apparently) let the user
                      set them but the server<br>
                                 will return "attribute is reserved"
                      error.  Pros: No missing<br>
                                 functionality, no damage done.  Cons:
                      Bad usability.<br>
                              b) hard-code list of reserved attributes
                      in client and don't expose<br>
                                 them to the user.<br>
                                  Pros: quick to implement.<br>
                                  Cons: Need to track reserved
                      attributes in server<br>
                                      implementation.<br>
                              c) get-reserved words from schema
                      downloaded from server (and don't<br>
                                 expose them to the user).<br>
                                  Pros: Don't need to track server
                      implmentation.<br>
                                  Cons: Complex - reserved words can
                      vary from command to<br>
                                      command.<br>
                      <br>
                            I personally favor (b) on the grounds that a
                      client implementation<br>
                            needs to closely understand server behaviour
                      anyway so the sync-ing<br>
                            of reserved attributes shouldn't be a big
                      problem (*provided* the<br>
                            list of reserved attributes is made
                      available in the reference<br>
                            documentation which doesn't seem to be the
                      case currently).<br>
                    </blockquote>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                  </span>
                  <div>We are in a bit of a bind with schemas--what's
                    needed is schema resources to represent each request
                    and response, not just each resource. Because,
                    obviously, the things you can PATCH and POST are
                    necessarily different than the things you can GET in
                    any service api. However, it is not clear to me how
                    we get from one schema per resource to one schema
                    per request and response in a backwards compatible
                    way. So b) might be the only way to go.</div>
                  <div>
                    <div>
                      <div><br>
                      </div>
                      <div> </div>
                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                        <br>
                        So what does everybody think?<br>
                        <br>
                        <details><br>
                        When using glance client's v1 interface I can
                        image-create an image and<br>
                        specify the image file's location via the
                        --location parameter.<br>
                        Alternatively I can image-create an empty image
                        and then image-update the<br>
                        image's location to some url.<br>
                        <br>
                        However, when using the client's v2 commands I
                        can neither image-create the<br>
                        file using the --location parameter, nor
                        image-update the file later.<br>
                        <br>
                        When using image-create with --location, the
                        client gives the following<br>
                        error (printed by warlock):<br>
                        <br>
                          Unable to set 'locations' to '[u'<a href="http://192.168.1.111/foo/bar%27" target="_blank"></a><a href="http://192.168.1.111/foo/bar" target="_blank">http://192.168.1.111/foo/bar</a>']'<br>
                        <br>
                        This is because the schema dictates that the
                        location should be an object<br>
                        of the form [{"url": "string", "metadata":
                        object}, ...] but there is no<br>
                        way to specify such an object from the command
                        line - I cannot specify a<br>
                        string like '{"url": "<a href="http://192.168.1.111/foo/bar" target="_blank">192.168.1.111/foo/bar</a>",
                        "metadata": {}}' for there is<br>
                        no conversion from command line strings to
                        python dicts nor is there any<br>
                        conversion from a simple URL string to a
                        suitable location object.<br>
                        <br>
                        If I modify
                        glanceclient.v2.images.Controller.create to
                        convert the<br>
                        locations parameter from a URL string to the
                        desired object then the<br>
                        request goes through to the glance server where
                        it fails with a 403 error<br>
                        (Attribute 'locations' is reserved).<br>
                        <br>
                        So is this discrepancy between V1 & V2
                        deliberate (a feature :)) or is it a<br>
                        bug?<br>
                        </details><br>
                        <br>
                        _______________________________________________<br>
                        OpenStack-dev mailing list<br>
                        <a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
                        <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
                      </blockquote>
                    </div>
                  </div>
                </div>
                <br>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            OpenStack-dev mailing list<br>
            <a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
            <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre cols="72">-- 
Cheers & Best regards,
Fei Long Wang (王飞龙)
--------------------------------------------------------------------------
Senior Cloud Software Engineer
Tel: <a href="tel:%2B64-48032246" value="+6448032246" target="_blank">+64-48032246</a>
Email: <a href="mailto:flwang@catalyst.net.nz" target="_blank">flwang@catalyst.net.nz</a>
Catalyst IT Limited
Level 6, Catalyst House, 150 Willis Street, Wellington
-------------------------------------------------------------------------- </pre>
  </font></span></div>

<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>