Commit Graph

75 Commits

Author SHA1 Message Date
Takashi Kajinami 608e80b9ac Remove ssl middleware from pipeline
... because it was deprecated in foavor of the http_proxy_to_wsgi
middleware[1].

[1] 67ec67698074ef54c9c474228fec92b68015f884

Change-Id: If9ab4d4a02f55015cb81eb69f479b181397290a5
2022-01-15 22:36:42 +09:00
tengqm 957d77a0a9 Update sdk connection, tests and isoformat
We can simplify connection creation now. The Connection constructor
understands not to load yaml or env vars if it doesnt' receive a cloud
argument - so this can all be done in one step.

Update the mocks in the tests to work for the new calling pattern.

Finally - isoformat wasn't processing UTC+00:00. There are some
dark issues with how isoformats get passed around OpenStack, but this
fixes the unittest matching to account for UTC+00:00.
openstacksdk has been working on merging the code from shade and
os-client-config. Part of this will result in the removal of the
Profile object in favor of the CloudRegion object from the new
openstack.config.

This updates the Connection construction code to code that should work
with both old and new versions of openstacksdk.

Temporarily mask some jobs to get this in. Will need to revise the
tempest plugin to fix gate jobs later.

Related-Bug: #1681620
Co-Authored-By: tengqm <tengqim@cn.ibm.com>
Change-Id: I10c74ca48b1ddb848a5a68cc4360431a21e0a2cc
2018-02-06 03:46:36 -05:00
Dai Dang Van ac1d1d71bf Implement policy in code (6)
Like oslo.config, with oslo.policy, we can define all of
default rules in code base and only change some rules
via policy file. Another thing that we should use yaml
format instead of json format[1].

This commit will move all default policies to code for:
- actions
- events
- services
- webhooks

[1] https://governance.openstack.org/tc/goals/queens/policy-in-code.html

Change-Id: I0919eb5dc84c0e134b4918f477923b53dc9fbbbb
Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
2017-10-20 02:04:35 +00:00
Dai Dang Van 44b1c1ae66 Implement policy in code (5)
Like oslo.config, with oslo.policy, we can define all of
default rules in code base and only change some rules
via policy file. Another thing that we should use yaml
format instead of json format[1].

This commit will move all default policies to code for:
- cluster_policies
- receivers

[1] https://governance.openstack.org/tc/goals/queens/policy-in-code.html

Change-Id: Ib0c3fa45a3b0ec9b616b290f5d554893e9529637
Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
2017-10-20 02:04:25 +00:00
Dai Dang Van 2d5e7fb1c9 Implement policy in code (4)
Like oslo.config, with oslo.policy, we can define all of
default rules in code base and only change some rules
via policy file. Another thing that we should use yaml
format instead of json format[1].

This commit will move all default policies to code for:
    - node
    - policies

[1] https://governance.openstack.org/tc/goals/queens/policy-in-code.html

Change-Id: I94be99906238a5453421b7babe8dd7d5ad03b4fa
Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
2017-10-20 02:04:14 +00:00
Dai Dang Van 514d8ddf15 Implement policy in code (3)
Like oslo.config, with oslo.policy, we can define all of
default rules in code base and only change some rules
via policy file. Another thing that we should use yaml
format instead of json format[1].

This commit will move all default policies to code for:
    - clusters
    - profiles

[1] https://governance.openstack.org/tc/goals/queens/policy-in-code.html

Change-Id: I995d0485c36d0aa0e775ce88b803cf6a84d0e72a
Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
2017-10-20 02:03:37 +00:00
Dai Dang Van 1a76e9b406 Implement policy in code (2)
Like oslo.config, with oslo.policy, we can define all of
default rules in code base and only change some rules
via policy file. Another thing that we should use yaml
format instead of json format[1].

This commit will move all default policies to code for:
- build_info
- policy_types
- profile_types

[1] https://governance.openstack.org/tc/goals/queens/policy-in-code.html

Change-Id: I5c27e199e607e9def23db21b1a3050c2413da00a
Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
2017-10-20 01:35:49 +00:00
Dai Dang Van 1eb39637ac Implement policy in code (1)
This commit will prepare for implementing policies in code [1].

Like oslo.config, with oslo.policy, we can define all of
default rules in code base and only change some rules
via policy file. Another thing that we should use yaml
format instead of json format.

[1] https://governance.openstack.org/tc/goals/queens/policy-in-code.html

Change-Id: I8cd6e148d9b6bb1dc61e2cb1728acafc325bca65
Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
2017-10-19 14:24:29 +07:00
Yuanbin.Chen e11dd8cd63 Add receiver new api interface
This patch allow user use receiver-update api interface
change receiver params

Implements: blueprint add-receiver-update

Change-Id: Iba959a57e7c5c0ba8736581a61a4300dc4f35084
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2017-05-27 18:11:53 +08:00
Jenkins 47a0bd8a5d Merge "API layer support to node adoption" 2017-05-05 14:18:16 +00:00
tengqm 88a9f982d9 API layer support to node adoption
This patch adds API layer support to node adoption, including the
preview mode of node adoption.

Blueprint: senlin-adopt-function
Change-Id: If670b6f898fcc06d78b6ab5d2cc7fad827e6cbda
2017-05-03 23:53:16 -04:00
YiDe Yang fad3fda0ff API layer add services list
Add services list to senlin-api.

Change-Id: Id583d9e54e36274daf9e287e15ed52bc2fd53c0c
partial-blueprint: api-add-services
2017-04-19 17:47:32 +08:00
Aaron-DH e900491c79 Added CORS support to Senlin
OpenStack CrossProject Spec:
   http://specs.openstack.org/openstack/openstack-specs/specs/cors-support.html
Oslo_Middleware Docs:
   http://docs.openstack.org/developer/oslo.middleware/cors.html
OpenStack Cloud Admin Guide:
   http://docs.openstack.org/admin-guide-cloud/cross_project_cors.html

Change-Id: Iedd14f7aebf0969e79b74ec3400e4362029d1b63
2017-03-14 09:25:10 +08:00
tengqm ff26e22cb7 API layer support for node-operation
This adds API layer support to node-operation.

Change-Id: I849c637de07b09003a44d1b1316c3863d152363b
2016-12-28 06:49:02 -05:00
tengqm fc382cc987 API layer support to cluster-operation API
This adds the API layer support to cluster-operation call.

Change-Id: I76d6ad74a6d3feb321f14d415bce65d00d54c03c
2016-12-27 00:34:16 -05:00
tengqm 57b7c144c1 API support for profile_type_ops
This is the API layer patch for listing operations supported by a
specific profile type.

Change-Id: Iadf975552142e964f7cbde24f55ed60798fd671f
2016-12-25 22:09:33 -05:00
pallavi 8542ba8457 Add http_proxy_to_wsgi to api-paste
This sets up the HTTPProxyToWSGI middleware in front of senlin-api. The
purpose of this middleware is to set up the request URL correctly in
the case there is a proxy (For instance, a loadbalancer such as HAProxy)
in front of senlin-api.

So, when TLS connections are terminated at the proxy, and one tries to
get the versions from the '/' resource from senlin-api, one will notice
that the protocol is incorrect; It will show 'http' instead of 'https'.
So this middleware handles such cases, thus helping Keystone discovery
work correctly.

The HTTPProxyToWSGI is off by default and needs to be enabled via a
configuration value.

Change-Id: Ia65ecdcc07084514884258661f840e6edcb200a4
Closes-Bug: #1590608
Co-Authored-By: pallavi <pallavi.s@nectechnologies.in>
2016-12-14 20:46:01 -05:00
lvdongbing f7fd5bae3e Integrate osprofiler into Senlin
Add option to enable osprofiler to measure performance of Senlin.

Change-Id: Ib828c73b99a83d29440caeaaf26d639330e81ace
Implements: blueprint senlin-osprofiler
2016-10-18 03:35:16 -04:00
yanyanhu 7edb329c16 API and engine support for receiver notifying
This patch adds basic support for receiver notifying in
API and engine service layers.

Change-Id: Iddf561a3d94014abd80fabe5f8f482acc9c74661
2016-09-19 04:00:20 -04:00
Jenkins efc5b752a9 Merge "Add new api for policy validation" 2016-08-25 09:36:09 +00:00
Ethan Lynn 06e938ac23 Add new api for policy validation
This patch adds a new api 'policies/validate' for policy
validation.

APIImpact

Change-Id: Iee50946bdca893b3f50dcbf82b3230eb27339d9e
blueprint: validate-profile-policy
2016-08-23 00:32:16 +08:00
Ethan Lynn cf1885ad50 Add new api for profile validation
This patch adds a new api `profiles/validate` for profile
validation.
Example of request body:
{
   "profile":{
      "spec":{
         "type":"os.nova.server",
         "version":"1.0",
         "properties":{
            "flavor":"t1"
         }
      }
   }
}

APIImpact

blueprint: validate-profile-policy

Change-Id: I8564a3400a63dd80d29de418a5ea88aaf8b1d09a
2016-08-22 08:56:39 +00:00
tengqm 65b26229e5 API layer support for cluster-collect
This patch adds API layer support to cluster-collect.

Change-Id: I9ce475eb88b3abe8e5684735ada7206c650b1d27
2016-06-16 08:51:15 -04:00
tengqm c7ca07eb5d Move middleware filter resources
This patch moves the middleware filter resources to the middleware
subdirectory to avoid circular imports when future changes to wsgi is
introduced.

Partial-bp: api-microversioning
Change-Id: Id04f0054ab1d930327fb7b349626fcfaeafbc422
2016-03-22 10:17:06 -04:00
tengqm ebacf7819b Move app controller into dedicated module
Previously, the wsgi app controller was somewhat hidden inside the
"__init__.py" module. It is causing confusion to developers thus a bad
practice. This patch proposes moving it into a dedicated module for
clarity.

Change-Id: Ic89c091ca3f4f856c8ca4e55f946d1705751a0ce
2016-01-18 00:21:28 -05:00
tengqm 4203e1a779 Refactor modules used by senlin-api
This patch moves wsgi into api module, merge JSON serializers and
deserializers into the same module for easier maintenance.

Change-Id: I579de8701c69ef6e231762b9eb3192dc3208a9de
2016-01-15 10:17:45 -05:00
tengqm 97bc168353 Fix broken policy JSON file
The previous patch to policy.json has broken it. This patch fixes the
problem.

Change-Id: I06957c5c282b079a68e678f9fb111599bbe0e2af
2015-12-24 20:00:29 -05:00
Jun, Xu 09e637aefc Remove webhook in "etc/senlin/policy.json"
Change-Id: Id32c1c277aee7ffbc8c598b7ab5510a32a081869
2015-12-23 08:08:34 +00:00
tengqm 77943afc31 API support to receivers
This patch adds Receiver support at the API layer.

Change-Id: I400f9d34737d443e1cc4b7f4fcc6f6241ff96bd2
partial-blueprint: support-general-receiver-abstraction
2015-12-21 04:11:27 -05:00
lvdongbing a82eecae12 Remove senlin.conf.sample
As senlin.conf.sample is in git tree, gitignore couldn't ignore it.
This patch remove senlin.conf.sample to make gitingore work.

Closes-Bug: #1526578
Change-Id: I06b9e4f1b197f8cd847145c8173e2d05b2a832d0
2015-12-15 20:36:13 -05:00
tengqm fa3f67b758 Fix policy json file to delete project checking
This patch fixes default JSON file used for policy checking. Policy
checking at this layer is not deemed useful from the community. It may
eventually go away. This also fixes some other issues introduced by
previous changes.

Change-Id: I6823303c24c716dd97434f3ebcfb52414fc61341
2015-12-07 03:36:32 -05:00
tengqm ae3f6a38c6 Fix profile schema api
This patch fixes the bug descripted in the bug report.

Change-Id: I568261dc34602dd2b535ac78087df688a8612976
Closes-Bug: #1523038
2015-12-05 08:29:48 -05:00
Haiwei Xu a9b9e882c2 Revise ssl filter in api-paste.ini
The local ssl middleware is replaced by oslo_middleware,
so revise the filter in api-paste.ini

Change-Id: Iedf80b33bd90fa2e45a7ddcbaac62da73258c7fe
2015-09-25 10:05:31 +09:00
tengqm d1ff8cba64 Fix policy json file for project checking
The default policy checking of project was incorrect. This patch fixes
the checking.

Change-Id: I740977053dba60d6167ec258404ae48e47432786
2015-08-27 02:54:23 -04:00
tengqm 7809b1516e API layer support for triggers
This patch adds API layer support to triggers.

Change-Id: Ie48d8fc9713e3a7141d78c71f9a6ef3fc439ab40
2015-08-25 11:16:49 -04:00
yanyanhu 9431a6da1d Add cloud_backend_name option into Senlin config
This option is used to define the default cloud backend that Senlin
will talk with to create real resources.

Partially implement: blueprint reimplement-senlin-drivers-as-plugin
Change-Id: I4e1c4a8e43dcb48fb028fa3066a7aed434579f9a
2015-08-09 21:44:46 -04:00
tengqm 4d0a9e598a Stop stealing keystonemiddleware options
Previously, we have been stealing configuration options from the
keystonemiddleware. This is dangerous. The keystonemiddleware package
may deprecate options at any time. This patch proposes some options for
Senlin to do role delegations.

Change-Id: Iea0571ffc63b7ec1504e440bb1e0dd3a2ce85a71
2015-07-17 09:10:59 -04:00
Haiwei Xu 3cef8499ab Add webhook policy
Add webhook policy to policy.json

Change-Id: I538a4f29fd4e97ada455191547944c5e441c616c
2015-06-19 16:07:38 +09:00
tengqm 8aeb5a4f29 Remove api-flavor configuration option
This is not used in Senlin at all. Delete it.

Change-Id: I540674b929bcfa21399f1ba417908106f4ebfe26
2015-04-26 00:00:01 -04:00
tengqm bda59efe5b Delete some useless options in config
Some configuration options are never used in Senlin. Delete them from
the config module and the sample config file.

Change-Id: I0ef4f63d4c77397bf2a346c1f13547dfa45d44fc
2015-04-25 23:47:27 -04:00
yanyanhu f4ae261d89 Split webhook middleware from webhooks module
Change-Id: I3c7ff59ea1d22fd9b5ee6e4d96b5a56f1b26e58c
2015-04-13 23:10:38 -04:00
tengqm 2e56405b52 Separate trust middleware out from common module
Another patch to separate out middleware modules from common modules.

Change-Id: I3f4ce6ce520026418bf81879cc7b1a8bd6c78904
2015-04-12 23:40:26 -04:00
tengqm 977d8979db Move context middleware out of common module
We are separating middleware logic out of the common modules. This will
help improve the code layout for maintenance.

Change-Id: I5540df2b0da7e68708411b75052f330a6c56c63d
2015-04-12 23:27:17 -04:00
tengqm c1d9ee8dca Migrate to oslo.policy
This patch removes the dependency to policy in oslo incubator because
oslo_policy has graduated.

Change-Id: I14966d1d3bd50a1e077a49c117e29230755ffb85
2015-04-09 11:30:29 -04:00
yanyanhu 9fe9cddd70 Remove authurl middleware
Change-Id: I6bc24680ed6b4e5783ad40613e180adcaa1115ca
2015-04-02 06:18:44 -04:00
tengqm 42b1fc9b9c Updated the sample conf file
The sample conf file is generated using the latest configuration.

Change-Id: Id8578bb41d58de4b5fdd3ecf933ee24bcd4e9a51
2015-03-30 22:51:04 -04:00
yanyanhu d06aec8bcb Add trust middleware into senlin-api pipeline 2015-03-10 04:03:17 -04:00
tengqm 4b897ea9db Added policy item for node-update 2015-03-05 17:46:27 +08:00
tengqm 4de7f0b8a5 Added entry for policy_update 2015-03-03 13:24:53 +08:00
tengqm c747cae781 Policy enabling for event list/show 2015-02-27 13:57:21 +08:00