Commit Graph

215 Commits

Author SHA1 Message Date
Takashi Kajinami 6155e68f9a Remove deprecated internal rpc function
It was deprecated 6 years ago[1] and is no longer used.

[1] e2b614c529

Change-Id: I0905b1901429f2475784e4752889b83e6567f4ef
2023-12-15 06:07:40 +00:00
rabi 3ab4f15a43 Option for retrieving child templates and env files from swift
This provides an option to specify a swift container for stack
actions and all child templates and env files will be fetched
from the container, if available. However, files coming in the
'files' map from the client will have precedence, if the same
is also present in swift.

Change-Id: Ifa21fbcb41fcb77827997cce2d5e9266ba849b17
Story: #1755453
Task: 17353
2018-07-26 09:50:51 +05:30
Zane Bitter 76ec5af884 Docs: Eliminate warnings in docs generation
Fix all of the existing sphinx warnings, and treat warnings as errors in
future.

Change-Id: I084ef65da1002c47c7d05a68d6f0268b89a36a7a
Depends-On: https://review.openstack.org/553639
Depends-On: https://review.openstack.org/559348
2018-06-21 16:38:47 -04:00
rabi 8db1b3ea41 Remove stack watch service
This removes the rpc api and related code.

Change-Id: Ib89bcc3ff6a542f49467e2ad6c7e2a716a0dc2b4
Partial-Bug: #1743707
2018-01-28 09:35:05 +05:30
Saravanan KR a1a0609e8e Added tags attribute to the template parameter
In some scenarios, it is required to categorize the parameter.
Associating tags with the parameter, it is will be easy to
categorize the parameter and add simple validations to users.
This patch introduces a new attribute 'tags' with the parameters,
which is a list of strings.

Change-Id: I20fc95d606b0b8a08d3b46bf33f4860bff49c74f
2017-11-13 15:51:19 +05:30
ricolin 552f94b928 Add converge flag in stack update for observing on reality
Add converge parameter for stack update API and RPC call,
that allow triggering observe on reality. This will be
triggered by API call with converge argument (with True
or False value) within. This flag also works for resources
within nested stack.
Implements bp get-reality-for-resources

Change-Id: I151b575b714dcc9a5971a1573c126152ecd7ea93
2017-08-07 05:39:29 +00:00
Jenkins 48ef79c5f7 Merge "Use exception_filter in RPC client" 2017-03-29 13:46:53 +00:00
Zane Bitter 73a886d806 RPC Client: don't cast() delete_stack by default
The delete_stack() RPC call in the client can be sent using either call()
or cast(), with cast() the default. This is never what you want, because
the call could raise an exception and you want to hear about that.

We're now passing cast=False explicitly everywhere. We always were in
heat-cfn-api and heat-api, but failing to do so in StackResource caused bug
1499669, which was corrected by I039eb8f6c6a262653c1e9edc8173e5680d81e31b.
Changing the default to call() will prevent anyone making that same mistake
again.

Change-Id: Idd6a27988dadbf1cd8376de24b19f2226f6ae5b7
Related-Bug: #1499669
2017-03-28 15:34:53 +00:00
Zane Bitter e2b614c529 Use exception_filter in RPC client
This provides both better stack traces for exceptions that are not ignored,
and nicer syntax.

Change-Id: I3467c17272e4a6f81ae8293f723f95dfad3180ab
2017-03-27 14:38:53 -04:00
Jenkins c11a736ef7 Merge "Improved the descriptions of funtion parameters." 2017-02-20 00:45:20 +00:00
huangtianhua eaca4eb51b Returns project info while getting sd with admin context
This change adds project information of software configs
if using admin context.

Change-Id: Ia26919aa1177a9366c65710becb2097b79e02445
Closes-Bug: #1646312
2016-12-23 01:13:38 +00:00
Jenkins 708bda5152 Merge "Add a modulo core constraint" 2016-10-26 04:12:29 +00:00
huangtianhua 62f6045f2a Return condition functions based on the filter param
Add 'with_condition_func' filter param for API
template-function-list, if the param set to true,
the response will include the condition functions.

Change-Id: Icdfbafbb98698373648ff2d78db3c45fe2b924ee
Closes-Bug: #1625505
2016-10-14 02:19:37 +00:00
Ana Krivokapic b1144b22ce Add a modulo core constraint
A modulo constraint will be used to restrict numeric values to
leave a certain remainder when divided with certain divisor.
E.g. we can use this to constrain values to even/odd numbers.

Change-Id: I9d7db4307be2a2b93cc928cf5912af7b49c72076
2016-10-11 16:55:11 +02:00
abdul nizamuddin 43752000aa Improved the descriptions of funtion parameters.
Change-Id: I2557abe296d0ef0a0ed80f3a178c91566dbc3654
Closes-Bug: #1630234
2016-10-04 19:18:38 +00:00
Oleksii Chuprykov 68944d2230 Migrate stacks from legacy to convergence engine
Run `heat-manage migrate-convergence-1 <stack_id>` to migrate
legacy stack to convergence engine.

Heat engine is used for doing migration i.e. migration can't
be done offline.

Change-Id: Ie7c2498b37937438f16d154b154b3a6ecbf9ff74
Implements-bp: convergence-migrate-stack
2016-08-22 10:40:29 +03:00
rabi 1f88c675c4 Remove tenant_safe flag from rpc and db api
We can use admin_context to have access to stacks
and software configs across projects. This removes
the tenant_safe flag from rpc and db api. This is
backward compatible with older rpc clients.

We still support use of global_tenant flag for listing
stacks and software configs. However, by default
an admin(user with admin role in admin_project)
would not need that.

Change-Id: I12303dbf30fb80290f95baba0c67cdf684f5f409
2016-08-16 12:38:33 +05:30
huangtianhua 56fad61131 Adds some infos for stack notification
Adds 'description', 'tags' and 'updated_at' for stack
notification for projects such as Searchlight to store
stack metadata.

Change-Id: I7067e6649661d88cb86b4021a27ebbb6393cc7af
Closes-Bug: #1603163
2016-08-05 14:21:57 +08:00
Jenkins 509ebc6a5d Merge "Add stack files retrieval API" 2016-07-12 11:20:30 +00:00
Steven Hardy 316b5b6381 Add stack files retrieval API
Similar to the recent addition that enables retrieval of the current
environment for a stack, this enables reading the current files map
for a running stack, which is useful if you want to introspect the
current state, and/or deploy another similar stack without necessarily
having the exact command/repo used initially.

APIImpact
Implements: blueprint files-show

Change-Id: I3198b6a7dc06648af24c198d39470f3b0d5d6f11
2016-07-11 18:02:59 +01:00
Anant Patil 459086f984 Convergence: Cancel message
Implements a cancel message sending mechanism.

A cancel message is sent to heat engines working on the stack.

Change-Id: I3b529addbd02a79364f7f2a041fc87d5019dd5d9
Patial-Bug: #1533176
2016-07-05 07:52:03 +00:00
Jenkins 257e0a9f67 Merge "Implement event list nested-depth" 2016-06-28 03:01:59 +00:00
Steve Baker 32ade7a243 Implement event list nested-depth
The GET call to list events will support a nested_depth parameter. The
response will have an additional links url with the ref 'root_stack'
to indicate that this API supports nested_depth queries.

This has the following consequences for old/new combinations of
client/server
- new heatclient, new server - nested_depth param is set, server
  returns nested events
- new heatclient, old server - nested_depth param is set, server
  returns events with no root_stack, heatclient falls back to
  recursive event fetch
- old heatclient, new server - nested_depth param is never set,
  recursive event fetch works as before

Here are some timings for a TripleO overcloud stack with ~700 events.

Current heat and python-heatclient master:
time openstack stack event list --nested-depth 4 overcloud |wc -l
744
real    0m17.500s

This change, with heatclient 31278ff5f77b152b5ef7a4197e15c441c72ff163:
time openstack stack event list --nested-depth 4 overcloud  |wc -l
608
real    0m1.725s

The difference in event count (744 vs 608) is due to the stack events
being filtered out for stacks with zero resources - these are a source
of unnecessary noise so their removal should be considered an improvement.

Closes-Bug: #1588561

Change-Id: I27e1ffb770e00a7f929c081b2a505e2007f5d584
2016-06-14 13:39:38 +12:00
Steven Hardy ac4df48771 Fix comment/doc for 1.28 RPC version
The name of the interface added is wrong

Change-Id: Ibbb32916f373e40d622555cdcd0eb6afd25ecc35
2016-06-09 15:52:00 +01:00
Peter Razumovsky f5b64b3e4d Add to resource_schema returning description
Add to resource_schema command ability to return
resource description.

@APIImpact
@DocImpact

Change-Id: I148bb7764af4db45b75ce63d7fa58daa210b3ed4
Closes-bug: #1558049
2016-05-25 16:24:03 +03:00
Peter Razumovsky 42bfc8a282 Add to resource-type-list returning description
Add to resource-type-list command ability to return
resource description.

@APIImpact
@DocImpact

Change-Id: Ia92699e5ca60a891e9704c468e447e1053be7609
Closes-bug: #1558049
2016-05-25 16:10:34 +03:00
Zane Bitter 9a650a5e2f RPC API: Add a template_id parameter to stack_create/update
This allows us to pre-store a template in the database before
creating/updating a stack over RPC, so that we don't need to send the
contents over RPC. This will help us safely de-duplicate files dicts in
the database, reduce the size of messages, and prevent unnecessary
copies of files (in particular) being loaded into memory.

Change-Id: Id1990d5cbac8b3954ce224af73425d4fd8db17d6
2016-05-16 10:50:59 -04:00
Jay Dobies b0ca694dd7 Add environment retrieval API
Adds a call to the REST API to retrieve the environment for a running
stack.

APIImpact
Implements: blueprint environment-show

Change-Id: I7e3577dfc854018245d79afdfee45a9d250d73a7
2016-04-18 14:30:52 -04:00
Thomas Herve a709637a17 Replace SD RPC polling by long RPC call
This changes the way SoftwareDeployment updates its internal status.
Instead of querying the deployment status in a loop using RPC client, it
makes a single call, which returns once the status has been updated.

Closes-Bug: #1549219
Change-Id: I484b7c8cb4a4e71817be6bea764f23b68a39b2d4
2016-04-05 20:47:25 +02:00
Jenkins 9345e1648f Merge "Use oslo.utils.reflection to extract class name" 2016-03-06 05:01:48 +00:00
Ahmed Elkhouly f52d77f0d2 Resource mark unhealthy RPC and ReST API
There may exist resources that the user (or application) knows are
unhealthy where Heat has no way of determining that.

Add a PATCH handler to the Resource endpoint::

  /stacks/<stack_name>/<stack_id>/resources/<resource_id>

The PATCH method will accept a JSON body of the form::

  {
    'mark_unhealthy': <bool>,
    'resource_status_reason': <string>
  }

This patch Implements:
- RPC API to mark resources as CHECK_FAILED in both the legacy and
convergence architectures in heat-engine
- ReST front end to the RPC API call in heat-api

Change-Id: Ifa48b179723a2100fff548467db9e162bc669d13
Partially-implements: blueprint mark-unhealthy
2016-02-24 18:00:44 -05:00
zhaozhilong 63c0d51017 Fix a small typo again
list_stack_resoure -> list_stack_resource

Change-Id: I8613c92740549e978a52048d33aac969726aa941
2016-02-24 06:18:48 +00:00
zhaozhilong 23f4bd2187 Fix a small typo
resoruces -> resources

Change-Id: I42d044e47439530d05dbf9433a459191eb34dd21
2016-02-18 19:29:32 +08:00
Kanagaraj Manickam 6c4709696b Stack resource search
heat resource-list -f <filters>

imlements blueprint heat-stack-resource-search

APIImpact

Change-Id: Iaae88f3b32bc2ba7b41a4078ef3aa8ffc07079b7
2016-02-16 17:52:24 +05:30
Bo Wang 4136b47666 Use oslo.utils.reflection to extract class name
The oslo.utils.reflection.get_class_name() handles more variations
of where a class name may come from (on) python 2 and python 3.
Its usage allows getting more accurate class names so we'd better use it.

Change-Id: Iff0e109a558d0185f126781369bac216da930bca
2016-02-16 20:04:59 +08:00
Kanagaraj Manickam 692059eeb0 Adds ignore_errors for template_validate REST API
Adds additional parameter ignore_errors to ignore set
of errors during the template valation in API.

APIImpact

implements blueprint heat-template-validate-improvements

Change-Id: Ib8a6d6be4509857bbc90c8f604a882b7a706da10
2016-02-04 17:09:22 +05:30
Jenkins 35b90e3fc5 Merge "Add environment_files to REST and RPC APIs" 2016-02-02 16:58:23 +00:00
Jay Dobies c2d8a15b24 Add environment_files to REST and RPC APIs
Adds an optional list of environment files that can be specified instead
of resolving multiple environments client-side. This change covers both
the REST API changes and the internal RPC API changes.

APIImpact
Implements: blueprint multi-environments
Change-Id: I45fb9d4480f6ab4e5fe30cb2e3b62a03777484c7
2016-01-28 10:18:51 -05:00
Jenkins 4e7a584e5c Merge "RPC API: Define correct constants for resource data" 2016-01-27 18:48:53 +00:00
Jenkins 99d3d1b1f8 Merge "Adds RPC api for export action" 2016-01-26 19:08:45 +00:00
Zane Bitter 415dc236ab RPC API: Define correct constants for resource data
For some reason we were using constants from a different data structure
(the resource schema) as field names in the resource data structure, even
though the names made no sense, just because they happened to have the
value we wanted. This change defines properly-named constants and puts them
in the RES_KEYS tuple where they belong.

Change-Id: Ia47ba64d85f0f4b93ba242b6d54e7f318fac7481
2016-01-22 13:01:45 -05:00
Zane Bitter f0fa7312a0 Don't calculate attributes for metadata request
The RPC API call describe_stack_resource is used by two separate ReST API
calls and one CFN API call: Resource.show and Resource.metadata in heat-api
and StackController.describe_stack_resource. The metadata call in
particular throws away all of the results of the describe_stack_resource
output except for the metadata itself. Either this call or the cfn one
(depending on configuration) is also used very, very often: it's the one
that every instance running os-collect-config polls for information about
software deployments (so, to a first approximation, every server in every
stack will be calling this once every 30s).

Since blueprint detailed-resource-show merged in
6d8a5cb35c, every call to the RPC
describe_stack_resource API has resulted in Heat fetching the attribute
values for every single attribute in the resource from its corresponding
OpenStack API (including those calls originating from a request for just
the metadata, or from the cfn API which similarly discards the attribute
values).

This is insanely inefficient (we're making OpenStack API calls to fetch
data that we don't even return to the user). It's quite possibly a
substantial part of the reason why we've had so much difficulty scaling up
Heat to deal with large numbers of servers polling it for config. And it
tends to leave a lot of annoying warnings in the log messages, not just of
Heat but also the other services it is polling, since polling the metadata
generally happens using the heat_stack_user's credentials, not those of the
actual owner of the resource - it can't actually find the resource and
returns a 404.

The fix is to change the default "with_attr" value in the RPC client to
False, and only pass None (the previous default) or a list of extra
attributes to include in the specific case where the ReST API will actually
return the attribute values to the user and not just discard them. Since
the server previously treated any falsey value for the parameter (e.g.
None, False or []) as equivalent, and since nothing was previously passing
False, this change is safe to backport to stable branches. The api and
engine can be updated in any order without change in behaviour until a new
api is talking to a new server (at which point the bug is fixed).

This change also updates the ReST API unit tests to accurately reflect the
data returned from the engine.

Change-Id: Ifffeaa552d3205ca06a79adda09d35a77099a2bf
Closes-Bug: #1507568
2016-01-22 12:10:40 -05:00
Kanagaraj Manickam 47d59f2b1e Adds RPC api for export action
Adds RPC client api for export action and test cases.

RPC_VERSION = 1.22
Partial-Bug: #1353670

Co-Authored-By: Jason Dunsmore <jasondunsmore@gmail.com>
Change-Id: I88ef9bba073bf4e730e1dae114a9c5d3b856ca13
2016-01-20 14:50:35 -06:00
Thomas Herve b3a56659ee Provide software deployment id on create
There is currently a race condition where software deployment populates
its metadata when being created, before the parent resource receives an
ID. This creates a window where the metadata is available but the
resource can't be signalled. This fixes it by providing the creation ID.

Change-Id: If58679138db95cf1da7ab5a4906217da446a391f
Closes-Bug: #1532445
2016-01-19 11:40:58 +01:00
Oleksii Chuprykov c8818c864f Add resolve_outputs parameter to stacks API
Add resolve_outputs parameter to stack_show. It allows user
to get stack data without resolving outputs. It is needed because
of 2 reasons:
1) We have output_show an output_list already in our API
2) Such resolving can consume a huge amount of time, but user may
want to resolve only several or none outputs.

@APIImpact, @DOCImpact

Change-Id: I03104efc535a7bd4326cbec56c01cd887db38ab6
2016-01-06 13:01:15 +02:00
hgangwx 4235bd366b Wrong usage of "a"
Wrong usage of "a" in the mesages:
"a integer representing the number of matched stacks"
"Send a signal and a exception will raise"
Should be:
"an integer representing the number of matched stacks"
"Send a signal and an exception will raise"
Totally 3 occasion in Heat base code.

Change-Id: Ic5ff16dd8d31d4573490ac423f7457e75b872e6b
2015-12-26 18:08:47 +08:00
Pratik Mallya 31537eefe3 Use user id instead of user name in notification body
Change-Id: I65186c637a1fc8b4c2f28e079e761d6a3994defd
Closes-Bug: #1518400
2015-12-07 08:25:04 -06:00
linwwu 1a8790d970 Fix some inconsistency in docstrings
Added colon after ":param" according to:
http://docs.openstack.org/developer/hacking

Change-Id: Ie6d2f0b602ec479797ccfde3cfa92baf0605b129
2015-12-02 01:43:16 +08:00
Peter Razumovsky 2e76bb0716 Add APIs implementation for output functions
APIImpact

Add new APIs for showing and listing stack outputs.
It can be used by heat client and separately for
getting stack outputs.

implements bp api-call-output

Change-Id: Ia24b24f59e2c592801e4e670ba5510f642ecf45c
2015-10-28 14:40:57 +03:00
Peter Razumovsky cdc6e96723 Fix [H405] pep rule in heat/rpc
Implements bp docstring-improvements

Change-Id: Ic7df3c1b2e6538caf4b938e5856cbc0ff68d591a
2015-10-08 15:13:52 +03:00