Fixes #143
The stack retrieval DB calls were already fixed in previous commits but
there was still one query (resource_get_by_physical_resource_id) that
would return any resource, not just the ones owned the user.
Change-Id: Ie02ff1e8ba6ea8da2c3d0c7f0a87c32452824fc6
This was broken by 3b91d100a6. Resources
should be removed from the DB only when the stack is deleted.
Change-Id: I6822aee8453afd6076793cff9206a035cff33588
Signed-off-by: Zane Bitter <zbitter@redhat.com>
1) The metadata saved in manager.py was not always showing up
in the db (from wait_condition.py)
2) Reuse a little method in parser.py to retrieve the parsed_template
db entry (and store the parsed_template_id).
Change-Id: Ib5b5474b81c0b7439eb1fa4aec5a0f1f21bbde1c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This is already done in load_paste_app()
Fixes #146
Change-Id: I3631b7ade06c8b142960abbf9c172461fae93a56
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Revise response format for CreateStack, ListStacks and DescribeStacks
so the StackId element is formatted in a similar way to the AWS spec
Change-Id: I0dd34a6dae2e30c63619449ebbf89643ccc9d364
Signed-off-by: Steven Hardy <shardy@redhat.com>
This finishes up the API calls with per-user returns of stacks and
events.
Change-Id: Iab6118f35978a6f62ad4d3454842cb7f3d686bc8
Signed-off-by: Ian Main <imain@redhat.com>
The DB API changed in 892b99bff4, while
these calls were added in 247cc2bb9a. Both
patches were under review simultaneously.
Change-Id: I8fc6c3228c99f025e01fc82979fa94f086649909
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Fixes #62.
This commit implements the `DescribeStackResource`,
`DescribeStackResources` and `ListStackResources` AWS API calls.
Change-Id: Id9161b3c3eb527d5936c5b8978e32a67ba6c12bb
Modifies heat internal default date-string representation to match AWS spec
Note heat.common.utils.strtime default format loses sub-second precision
Avoids having to regex mangle datetime string format
ref #125
Change-Id: I1347e82b1c3ccac5eac7c85858cf8009723547c2
Signed-off-by: Steven Hardy <shardy@redhat.com>
- Reformat ListStacks/DescribeStacks responses to align time format with AWS spec
- Remove duplicate member tags in DescribeStacks (now handled by XMLResponseSerializer)
ref #125
Change-Id: Ib001acba591dba52f3f56052427d2b298d781ea0
Signed-off-by: Steven Hardy <shardy@redhat.com>
The format of the params received by the manager is a property of the Heat
API protocol, not of the template, so it makes sense not to have the parser
extracting the template parameter data from them. This simplifies the
implementation of #123 (Nested Stacks).
Change-Id: I8eaf50caf79f69359cbc8ee1f0193c08d7944d1c
Signed-off-by: Zane Bitter <zbitter@redhat.com>
This code was previously misleading, as it appeared to get stacks by id,
but actually got them by name. This patch adds a separate API, so
get_stack() gets the stack by id and get_stack_by_name() gets it by name.
Change-Id: I1cbbb3f9211661ad665e208d87298f177825f8ac
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Unfortunately, as long as the user_creds_id column is not nullable the
script will still fail if there is data in the database. However with this
patch it is at least left in a recoverable state. Also, downgrades now
work.
Change-Id: Ibb7b7664ad2532154fab90a50bbb95ae9ccfbb91
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Raise a specific exception (NotFound) if something is not found in the
database. Then we can match on this exception, rather than searching the
error message (which effectively makes the text of error messages part of
the API).
Change-Id: I22673ffb1407cf95b1fe24eaec8824039c1dda4e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Most of this code is common between resources, so put it in the parent
Resource class and have subclasses provide handle_create()/handle_delete()
methods for all their extra needs.
Change-Id: I14c6afa9fdd1ecc065036fa93bde2a693b6c3eb2
Signed-off-by: Zane Bitter <zbitter@redhat.com>
Rework to align API response format with AWS API XML key naming,
ref #125
Change-Id: Ifa0d1b87d0b721e71c50be06815a7aaf12b07bb3
Signed-off-by: Steven Hardy <shardy@redhat.com>
This was "ERROR" in the event status description.
Change-Id: I401bbbe1c8e8cafe64a692b7faba63bd2ab38a4c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This patch takes the credentials passed in from the context and allows
you to store them in the database in the 'user_creds' table for later
use with HA operations. It also adds a 'username' to the stack table
for direct comparison and user validation to support per-user stacks.
Thanks to Angus for fixing the tests for me :)
Signed-off-by: Ian Main <imain@redhat.com>
- Don't return a dict error
- in manager return full response
- return the result in Resource.validate()
Change-Id: I585ea9dd9cf747927fb4effb90cfff49cba20931
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
AWS API returns response as XML, this implements a new response serializer which
turns dicts returned from the engine into AWS style XML responses. Ref #125.
Updated following review comment.
Change-Id: I8170ed814be0b5cea98761a2723e12be216374a3
Signed-off-by: Steven Hardy <shardy@redhat.com>
In order to support HA operations, eg restarting an instance, we
need to have full credentials in the engine. This patch passes
in the credential information into the engine and uses it to validate
the the user. A future patch will have this information stored in
database and associated with each stack. It also assigns the username
in the case of EC2 style authentication allowing us to support
per-user stacks with EC2 auth.
Change-Id: I4b92f83d4d10a2bfebd4ddedc8a4f53b3e1217fe
Signed-off-by: Ian Main <imain@redhat.com>
we need this to re-create resources else we get foreign key errors
from the db.
Change-Id: I41b142db020ae84026f3b7007ecd7d927a27880d
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>