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>
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>
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>
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 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>
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>
This makes the cli more consistent with AWS and implements
the timeout feature.
Note: the timeout is in minutes and defaults to 60 minutes.
Change-Id: I41dea75170c871c1ee47948643311752d9d5e41e
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
With the new release of pep8 we have some different requirements.
This patch fixes them all.
Change-Id: Ief16becba47007460f8b125907b055aa51de999e
Signed-off-by: Ian Main <imain@redhat.com>
sys.exc_value has been deprecated since Python 1.5, and is not thread-safe.
The replacement is sys.exc_info(), but in this case we don't need even that
since we have the exception in question available.
Change-Id: Ibb4b354fd099fbf0d6390163eb4f7cc9e97db0e9
Signed-off-by: Zane Bitter <zbitter@redhat.com>
To be replaced by proper AWS auth, which needs AWS::IAM::AccessKey
resource type to be hooked up.
Change-Id: Icbdb08493fb51add5e6d3d5f4a153595f93c8f75
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This patch updates the authentication system set up in heat:
- We now authenticate against the 'heat' service at the entry
point to each api call in the engine.
- We are now using the 'Context' class to contain the authentication
information as intended.
- The two context classes are unified and we now use the same one
for both WSGI and RPC. This is the intended design as the
context is loaded by the WSGI middleware and then passed into the
RPC methods.
- We are now doing token authentication in the API that works with
both native keystone and AWS style authentication. That token is
then passed on to the engine for further authentication for various
endpoints.
Note that the heat-api-paste.ini file requires updating in order for
this to work on your system. Admin user and password must be set
properly in the authtoken section in order to perform token based
authentication.
I suspect there will be a few bugs in here yet. This is just part of
the authentication/identification changes we need to make but I wanted
to get this in so we could continue to work with a boto based client.
Change-Id: Ib635ecd3088304e8d51d8e1fc31a8b1bf751caf3
Signed-off-by: Ian Main <imain@redhat.com>
Fix watch db tables and silly programming errors.
get basic posting data to metadata server working
add watch_rule_get_all()
check for alarms in a periodic task
delete watch_data when the rule is deleted
add a last_evaluated field to the watch_rule
remove unused option to watch_data_get
take better account of the sample period.
- still much to be done here (evaluation periods).
add some useful stats to cfn-push-stats
fix how the metric is accessed
fix a divide by zero
Change-Id: Iaf98499d0e3ac6d6f951ea38b3b0f409669258da
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Calling stack.validate will modify the stack's template, which
we don't want to do. We just want to validate the template and move
on with an already parsed template.
The stack creation call to validate the stack was resetting the
stack template attribute. I've made a copy of the stack purely
for validation purposes.
Similarly to the way heat-api works, the engine does all the heavy lifting (db
access, etc.) while the metadata server provides the API layer that communicates
with the engine.
Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
This is a start on issue #111
While no actual validation is done by this patch, this patch introduces
the framework for validating in each of the resource types and returning
an appropriate error when a validation error occurs.
Signed-off-by: Steven Dake <sdake@redhat.com>