Commit Graph

125 Commits (f416aa695544fafe09a7be02f34cebc0f4d718b4)

Author SHA1 Message Date
Jay Lau (Guangya Liu) f416aa6955 Remove # -*- encoding: utf-8 -*- from some python files
Some python files do not need to encode in utf-8, so just remove
"# -*- encoding: utf-8 -*-" from those files.

Change-Id: Iafdf4eda876b6599b75c7710e69f62918842ebec
Closes-Bug: #1422067
8 years ago
Hongbin Lu d28a780d77 Implement update bay node_count
It is implemented by updating the Heat stack with the new node_count

Partially implements: blueprint update-node-count

Change-Id: I2c331043bb6e6fce14fc82932dcd9c3677448598
8 years ago
Davanum Srinivas 6a84010253 Change ctxt to context to for consistency
rename ctxt in all files under magnum/

Closes-Bug: #1416922
Change-Id: I28870d1381bd7107d431d5d3c76ad636f6d1d90a
8 years ago
Jenkins 33d1084d7a Merge "Container logs should use HTTP GET other actions use PUT" 8 years ago
Davanum Srinivas f51fd3bb4f Container logs should use HTTP GET other actions use PUT
We need to tighten the check on which HTTP methods are allowed
and raise appropriate HTTP error. /logs should respond only
to HTTP GET and not HTTP PUT. other actions should respond
only to HTTP PUT and error out on HTTP GET.

Also see related change in python client:
I1cff0b33d3be1eedeb373fda7ef223a1ba596b59

Closes-Bug: #1409316
Change-Id: Ia78d8a246a8d9d06f949a2d893331e967d64913e
8 years ago
Davanum Srinivas 17c5711c55 Remove imports from oslo namespaces
Oslo team is recommending everyone to use the direct imports and
not use the Oslo namespaces. So switch all our code to use oslo_*
instead of "from oslo." or "import oslo" or "from oslo"

NOTE: some of the tests still have mocks referring to oslo.utils
@mock.patch('oslo.utils.timeutils.utcnow')
as the tests break otherwise. We should do this later.

Closes-bug: #1419385
Change-Id: I8e3fbeb833cddc3f55674a0e781ffe69d5033ad4
8 years ago
Davanum Srinivas d43259dbf2 Cleanup code and remove newly ignored hack rules
newer hacking has rules for the following:
  H105  Don't use author tags
  H238  old style class declaration, use new style (inherit from `object`)
  W292 no newline at end of file

So we need to clean them up and stop ignoring them

Change-Id: I12b995cf87d6bc0938298f397b41a4693627bb4b
8 years ago
Hongbin Lu 266573036b Add tests for Replication Controller Rest API
Partially implements: blueprint increase-test-coverage

Change-Id: I949566c8726c8d28b141c1a1497d365b34667426
8 years ago
Jay Lau (Guangya Liu) de93db51b9 Enable multi tenant for two k8s resource operation APIs
1) get_service_by_uuid
2) get_rc_by_uuid

Implements part of bp multi-tenant

Change-Id: Ib96e777bf73c7e29e1dc0834df273e11d14bd8c7
8 years ago
Jenkins ad1471f0dd Merge "Removed container_id from container api." 8 years ago
Jenkins 2720b8fe0f Merge "Add tests for Service Rest API" 8 years ago
digambar 5163e1214f Removed container_id from container api.
Change-Id: I6730be9b4164357fc66c55365e0b9781e41d669b
Closes-Bug: 1417865
8 years ago
Hongbin Lu 24f1042b58 Add tests for Service Rest API
Partially implements: blueprint increase-test-coverage

Change-Id: I785549349461b2eca06d5d605182f3ac988b2a2a
8 years ago
Jay Lau (Guangya Liu) 1e98de6973 Enable multi tenant for get_pod_by_uuid
Implements part of bp multi-tenant

Change-Id: Ief0c3f93880f62a3bc50132927338c83447b7739
8 years ago
digambar df3960eb38 Fix and clean up Container api
Change-Id: I2da4a58309f76224dd2097def121b4106d239fa5
8 years ago
Jenkins ed9fe5513b Merge "Consolidate codes for k8s resources api" 8 years ago
Jenkins 87e170231d Merge "Fix and clean up Container api" 8 years ago
Hongbin Lu 6865365ddb Clean up codes in node API
Change-Id: Icc6a594fa51227424cf0ae47174eaf7f2a2fd659
8 years ago
Hongbin Lu e63918416c Consolidate codes for k8s resources api
Change-Id: I2479c89de91618f891f7501cac059323b476f7d3
8 years ago
digambar 847f7908da Fix and clean up Container api
Change-Id: Icacca5284026318227a11a009b7540632c0dd532
8 years ago
OTSUKA, Yuanying 2306534079 Don't use deprecated auth header
"X-Tenant-Id" and "X-Tenant" auth header is deprecated in
keystonemiddleware [1]. So this remove these header and replace to
"X-Project-Id".
And this also flesh up around RequestContext.

[1]: https://github.com/openstack/keystonemiddleware/blob/master/keystonemiddleware/auth_token.py#L371

Change-Id: I5f3adcb6eaed4fe75da6ec77c367a2b6c785ae5d
8 years ago
Hongbin Lu 7e40170f40 Add tests for Pod api
Partially Implements: blueprint increase-test-coverage

Change-Id: I94c609eea49ccc8f5d539ce61f523cf6b344d4da
8 years ago
Jenkins b5f07b8e5d Merge "Pull RequestContext Patching Into Test Base" 8 years ago
Andrew Melton 5999adfa0d Pull RequestContext Patching Into Test Base
The new patching only ensures that auth_token_info is properly
set up by default. A real RequestContext is returned, and it is
passed through to_dict and from_dict to ensure there are no
assumptions made that will not work through RPC.

If necessary, tests can still return a mock context by setting
a return_value or side_effect on self.mock_make_ctxt.

Change-Id: I6369e0bd89d83a5ea3ddde2b35423233fee18327
8 years ago
Jay Lau (Guangya Liu) 98f2522e53 Update doc string for api base.py
API base.py is not only for service but k8s resource, including
pod, service and replication conroller

Change-Id: Ib10a30aa443ac3486ff88f675b134220763b6c82
8 years ago
Jenkins e954a22b6d Merge "Persist project_id and user_id for baymodel object" 8 years ago
Jenkins 129a1bcc62 Merge "Fix manifest url doesn't work" 8 years ago
Jay Lau (Guangya Liu) 7d5baf384a Persist project_id and user_id for baymodel object
Implements part of bp multi-tenant

Change-Id: Ief01572eeda39e2ea6aa19839d12f1a14feeae4d
8 years ago
Jay Lau (Guangya Liu) 075581b132 Persist project_id and user_id
This patch persists project_id and user_id for the following objects:
1) bay
2) node
3) container

Implements part of bp multi-tenant

Change-Id: Iab2c1c8b1b97dde0827050cba34baab581a75f0c
8 years ago
OTSUKA, Yuanying a8e6bbe3e9 Fix manifest url doesn't work
Metadata of Pod/Service/RepplicationController must be persisted to database,
but it doesn't work with manifest_url. This fixes it.

Change-Id: I4da065e7dfc5345120ee5bc12d931a7707432010
Closes-Bug: #1412646
8 years ago
Hongbin Lu bc1a709a34 Fix and clean up ReplicationController api
Change-Id: Ia1826952aa1b7b973904dd18ddd7cb2ba5229e00
8 years ago
Hongbin Lu 80ee0fa9be Fix and clean up codes at service api
Change-Id: Ib5da1f5e4ab0b21647a7931ef7b237d61e89a22c
8 years ago
Hongbin Lu 7ac1bd8609 Fix and clean up codes at Pod api
Change-Id: I417209f0d512904c20e64ef50d1ff372fbeb5a74
8 years ago
Hongbin Lu 97e7fcdb7e Fix and clean up BayModel and Bay api
There are several codes that were ported from Ironic are unused or
incorrect. This commit is for cleaning up these codes.

Change-Id: I0dd1cb84690c094c1775ac835136fb4a34e0fc6c
8 years ago
Jenkins c91ab4f571 Merge "Port NoExceptionTracebackHook from Ironic" 8 years ago
Jenkins 78ed1c6c9e Merge "Port parsable error middleware from Ironic" 8 years ago
Hongbin Lu a162727cc0 Port NoExceptionTracebackHook from Ironic
Change-Id: I160d602bb39a82c2ffb41d18389f793ae9269f87
Partial-Bug: 1411871
8 years ago
Hongbin Lu c645023c70 Port parsable error middleware from Ironic
Partial-Bug: 1411871
Change-Id: Ibe67d06f0d3a685dc08b896d466dfa94513c5d10
8 years ago
OTSUKA, Yuanying a61f1ff719 Rename `resource`_data/url attributes to manifest/manifest_url
Pod, Service and ReplicationController have data and definition_url attribute,
but it's name is needlessly long.
This fixes it to more appropriate attribute name.

Change-Id: I64e8922ef8f6fc0dc4a7fda02aa0913ca15177e4
8 years ago
Jay Lau (Guangya Liu) 7c00de388f Make replication controller delete working
Change-Id: I00aedeaeac5f7f72f2f9b530a116e772890b50fa
8 years ago
Jay Lau (Guangya Liu) e7a2366af6 Set replication controller name from rc manifest
Only replication controller manifest knows about rc name, so
this patch retrieve rc name from rc manifest.

Change-Id: I8193c2066ea1f0a40761f304f784fbb3b2d16796
9 years ago
Jenkins 2a3b73b9d7 Merge "Implement bay deletion on api" 9 years ago
OTSUKA, Yuanying f8ae58f2a2 Implement bay deletion on api
Heat stack was not deleted when bay deleted. This fixes it.

Change-Id: I52e82c3b50854f80c86b6553e99d256962a38497
Closes-bug: #1410507
9 years ago
Jay Lau (Guangya Liu) 9c68323035 Add rc_data support for magnum replication controller
Change-Id: I041ee8a4e111d6c900ff6d654eeb23d61fff28ff
9 years ago
OTSUKA, Yuanying 444a202859 Implement service deletion
Service deletion is working from magnum api.

Change-Id: Ifbd10246682dda32bb28bbc1d640ff365d53495d
9 years ago
OTSUKA, Yuanying b982600545 Set service name from service manifest
Only service manifest knows about service name, so this patch retrieve service
name from service manifest.

Change-Id: I1eb0f7dd7227875e1d10e5bd1d22f7e989e15f86
9 years ago
Jenkins 978b28e4ea Merge "Implement pod deletion" 9 years ago
Jenkins 464a4422b7 Merge "Set pod name from pod manifest" 9 years ago
OTSUKA, Yuanying b30b4f1f25 Implement pod deletion
Pod deletion is working from magnum api.

Change-Id: I6b6ccc9d95bddc42a98450cebac15bfd7aceab37
9 years ago
OTSUKA, Yuanying 5fe240f50e Set pod name from pod manifest
Only pod manifest knows about pod name, so this patch retrieve pod name from
pod manifest.

Change-Id: I7ad53e1ddcef76a644c8da7b7369423705c72a2c
9 years ago