<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body 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'<br>
    <br>
    <div class="moz-cite-prefix">On 18/02/16 15:51, Martinx - ジェームズ
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAJSM8J2TODx4f2VpaJdn=DqWgkjyF6r2wkXp52WyFwRQ-C-XRg@mail.gmail.com"
      type="cite">
      <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 moz-do-not-send="true"
href="http://uec-images.ubuntu.com/releases/14.04.3/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img">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 moz-do-not-send="true"
              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 class="">On Wed, Jan 22,
                    2014 at 1:05 AM, Public Mail <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:kpublicmail@gmail.com"
                        target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:kpublicmail@gmail.com">kpublicmail@gmail.com</a></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 class="">
                    <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 class="h5">
                      <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
                          moz-do-not-send="true"
                          href="http://192.168.1.111/foo/bar%27"
                          target="_blank"><a class="moz-txt-link-freetext" href="http://192.168.1.111/foo/bar">http://192.168.1.111/foo/bar</a>'</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 moz-do-not-send="true"
                          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 moz-do-not-send="true"
                          href="mailto:OpenStack-dev@lists.openstack.org"
                          target="_blank">OpenStack-dev@lists.openstack.org</a><br>
                        <a moz-do-not-send="true"
                          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 moz-do-not-send="true"
              href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
            <a moz-do-not-send="true"
              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 class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Cheers & Best regards,
Fei Long Wang (王飞龙)
--------------------------------------------------------------------------
Senior Cloud Software Engineer
Tel: +64-48032246
Email: <a class="moz-txt-link-abbreviated" href="mailto:flwang@catalyst.net.nz">flwang@catalyst.net.nz</a>
Catalyst IT Limited
Level 6, Catalyst House, 150 Willis Street, Wellington
-------------------------------------------------------------------------- </pre>
  </body>
</html>