We have moved, please see https://github.com/openstack/mixmatch
cci-moc / k2k-proxy Goto Github PK
View Code? Open in Web Editor NEWK2K-Aware Proxy for OpenStack
Home Page: http://k2k-proxy.readthedocs.io
License: Apache License 2.0
K2K-Aware Proxy for OpenStack
Home Page: http://k2k-proxy.readthedocs.io
License: Apache License 2.0
We have moved, please see https://github.com/openstack/mixmatch
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...
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.
Proxy configuration variable now reside in the [proxy]
configuration group. Move them to the root [DEFAULT]
.
http://developer.openstack.org/api-ref-blockstorage-v2.html#os-vol-transfer-v2
When this API call is used, the volume will no longer be where the proxy has recorded it.
Hopefully there's some sort of notification when this action happens...
It's a security hazard
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.