Giter Site home page Giter Site logo

k2k-proxy's Introduction

k2k-proxy's People

Contributors

gsilvis avatar knikolla avatar wjdanalharthi avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

k2k-proxy's Issues

Explicit URLs have to be munged

Sometimes Openstack API calls take or return a full URL to a resource. We have to make sure to replace the host/endpoint in the URL with the proxy's...

openstack image list, endless loop

Doing openstack image list causes an endless loop.

2016-10-12 14:48:39.056 44768 INFO root [-] Local Token: d7d145432c6d4d8ab5a5ef326316757e
2016-10-12 14:48:39.057 44768 INFO root [-] Getting session for d7d145432c6d4d8ab5a5ef326316757e
2016-10-12 14:48:39.058 44768 INFO root [-] Getting Admin Client
[pid: 44768|app: 0|req: 12/85] 127.0.0.1 () {30 vars in 426 bytes} [Wed Oct 12 14:48:39 2016] GET /image/v2/images => generated 1420 bytes in 2157 msecs (HTTP/1
.1 200) 2 headers in 88 bytes (1 switches on core 0)
2016-10-12 14:48:41.220 44771 INFO root [-] Local Token: d7d145432c6d4d8ab5a5ef326316757e
2016-10-12 14:48:41.222 44771 INFO root [-] Getting session for d7d145432c6d4d8ab5a5ef326316757e
2016-10-12 14:48:41.223 44771 INFO root [-] Getting Admin Client
[pid: 44771|app: 0|req: 25/86] 127.0.0.1 () {30 vars in 513 bytes} [Wed Oct 12 14:48:41 2016] GET /image/v2/images?marker=295b7130-24f9-4bb6-897e-c868640a190f =
> generated 1420 bytes in 1870 msecs (HTTP/1.1 200) 2 headers in 88 bytes (1 switches on core 0)
2016-10-12 14:48:43.096 44768 INFO root [-] Local Token: d7d145432c6d4d8ab5a5ef326316757e
[pid: 44768|app: 0|req: 13/87] 127.0.0.1 () {30 vars in 513 bytes} [Wed Oct 12 14:48:43 2016] GET /image/v2/images?marker=295b7130-24f9-4bb6-897e-c868640a190f =
> generated 1420 bytes in 572 msecs (HTTP/1.1 200) 2 headers in 88 bytes (1 switches on core 1)
2016-10-12 14:48:43.675 44768 INFO root [-] Local Token: d7d145432c6d4d8ab5a5ef326316757e
[pid: 44768|app: 0|req: 14/88] 127.0.0.1 () {30 vars in 513 bytes} [Wed Oct 12 14:48:43 2016] GET /image/v2/images?marker=295b7130-24f9-4bb6-897e-c868640a190f =
> generated 1420 bytes in 1222 msecs (HTTP/1.1 200) 2 headers in 88 bytes (1 switches on core 0)
2016-10-12 14:48:44.902 44771 INFO root [-] Local Token: d7d145432c6d4d8ab5a5ef326316757e
[pid: 44771|app: 0|req: 26/89] 127.0.0.1 () {30 vars in 513 bytes} [Wed Oct 12 14:48:44 2016] GET /image/v2/images?marker=295b7130-24f9-4bb6-897e-c868640a190f =
> generated 1420 bytes in 395 msecs (HTTP/1.1 200) 2 headers in 88 bytes (1 switches on core 1)
2016-10-12 14:48:45.305 44771 INFO root [-] Local Token: d7d145432c6d4d8ab5a5ef326316757e
[pid: 44771|app: 0|req: 27/90] 127.0.0.1 () {30 vars in 513 bytes} [Wed Oct 12 14:48:45 2016] GET /image/v2/images?marker=295b7130-24f9-4bb6-897e-c868640a190f =
> generated 1420 bytes in 821 msecs (HTTP/1.1 200) 2 headers in 88 bytes (1 switches on core 0)

Output of curl looks fine

curl http://localhost:5001/image/v2/images -H 'x-auth-token: ee8d65ccc8a245eebacf788739737e4b' | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1420  100  1420    0     0    680      0  0:00:02  0:00:02 --:--:--   680
{
    "images": [
        {
            "checksum": "ee1eca47dc88f4879d8a229cc70a07c6",
            "container_format": "bare",
            "created_at": "2016-09-23T18:55:43Z",
            "direct_url": "rbd://072f06a6-dbc0-4801-a7be-a4392ef3ccab/kumo-images2/6dcc7b02-8dbc-4dec-9032-cbbac5587420/snap",
            "disk_format": "qcow2",
            "file": "/v2/images/6dcc7b02-8dbc-4dec-9032-cbbac5587420/file",
            "id": "6dcc7b02-8dbc-4dec-9032-cbbac5587420",
            "min_disk": 0,
            "min_ram": 0,
            "name": "Cirros",
            "owner": "7e9d4dff8cfc4e0a9767f325d30bc1b5",
            "protected": false,
            "schema": "/v2/schemas/image",
            "self": "/v2/images/6dcc7b02-8dbc-4dec-9032-cbbac5587420",
            "size": 13287936,
            "status": "active",
            "tags": [],
            "updated_at": "2016-09-23T18:55:53Z",
            "virtual_size": null,
            "visibility": "public"
        },
        {
            "checksum": "ee1eca47dc88f4879d8a229cc70a07c6",
            "container_format": "bare",
            "created_at": "2016-10-12T16:37:42Z",
            "direct_url": "rbd://072f06a6-dbc0-4801-a7be-a4392ef3ccab/kumo-images3/295b7130-24f9-4bb6-897e-c868640a190f/snap",
            "disk_format": "qcow2",
            "file": "/v2/images/295b7130-24f9-4bb6-897e-c868640a190f/file",
            "id": "295b7130-24f9-4bb6-897e-c868640a190f",
            "min_disk": 0,
            "min_ram": 0,
            "name": "cirros_kumo3",
            "owner": "e39c30b7498f4fab8f7fd82ee5398e96",
            "protected": false,
            "schema": "/v2/schemas/image",
            "self": "/v2/images/295b7130-24f9-4bb6-897e-c868640a190f",
            "size": 13287936,
            "status": "active",
            "tags": [],
            "updated_at": "2016-10-12T16:37:53Z",
            "virtual_size": null,
            "visibility": "public"
        }
    ]
}

The second call with the marker will return the exact same output, because we never check for the marker parameter when no limit is provided, which is what the openstackclient is doing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.