As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:
1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.
2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.
Also replace policy.json to policy.yaml ref from doc.
[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html
Change-Id: I066488c47e1bb6502b27b8677988113f66b9b09b
At present, the codes as follows:
db/elastic/driver.py:
Def get_engine (self):
If not self._engine:
Self._engine = db_session.ElasticSearchEngineV2(self.backend)
Return self._engine
There is that freezer-api can't support support v1.
Actually, there is enable_v1_api ,but it is not used correctly.
The documents will be modified in other patches.
For example:
1)freezer-api v1:
/etc/freezer/freezer-api.conf:
[DEFAULT]
enable_v1_api = True
[storage]
driver = elasticsearch
backend = elasticsearch
[elasticsearch]
hosts = http://172.16.1.200:9200
number_of_replicas = 0
index = freezer
/etc/freezer/scheduler.conf:
[DEFAULT]
enable_v1_api = True
command: freezer --os-backup-api-version 1 job-list
2)freezer-api v2:
/etc/freezer/freezer-api.conf:
[DEFAULT]
enable_v1_api = False
or
# enable_v1_api = False
[storage]
driver = elasticsearch
backend = elasticsearch
[elasticsearch]
hosts = http://172.16.1.200:9200
number_of_replicas = 0
index = freezer
/etc/freezer/scheduler.conf:
[DEFAULT]
enable_v1_api = False
or
# enable_v1_api = False
command: freezer job-list
Change-Id: Iccee3a7cde986d0ba2aaf018fafa6bca411c34bf
The entry_point "service_v1" has changed to appv1 & appv2.
The extra code in files is cleaned up.
Change-Id: I1b907e3115c15f0fe82ecb2d54457209cfcf21e6
Id: I0d3d3982ea29bfb6a9af1c85dbd244025104c152
Add support to oslo.db to be used as a DB driver. The DB driver will be
used with API v2. When it's completely implemented, API V1 will be
deprecated and removed by the end of the cycle. Freezer-api will keep
supporting V2 with Elasticsearch, Sqlalchemy drivers.
This patch implements the follow:
* Abstract Base DB driver to be implemented by each driver
* Base driver; will return only access to the db engine, session
* SqlAlchemy driver;
* ElasticSearch driver;
* Implement both drivers in freezer-manage
Partially-Implements: blueprint oslo-db
Depends-On: I81e417155da48f46dd2113e5745fb3c21c96499f
Depends-On: I2e5724b1f1a75121952e2beb3844d2c489e4df68
Depends-On: Idb4ac050652d1d0107bf3fcd447d7cbedd811809
Depends-On: I81d46c89859752c0cbc21ef02de90db7f19f942c
Change-Id: I93ed1b909f538728a1a9bd5c8b07baf7aeddb705
This commit migrate all client policies into code [1] and
also remove policy.json usage file completely.
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
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Change-Id: I7c7fd83aa2516c053e38d7598cf79e63401f7519
This commit migrate all backup policies into 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
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Change-Id: I3ec5d3282c28289cef7e7ab595ee1bebda03ca32
This commit migrate all session policies into 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
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Change-Id: I5d45029deaf34d9627b9ac66a90af13ad305a8a4
This commit migrate all action policies into 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
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Change-Id: I42a77408124666ac54909d858b4db74908460176
This commit migrate all job policies into 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
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Change-Id: Ia80ee3eb4617cab66b4529e501ca72d2a38b7eba
This commit will prepare for implementing policies in code[1].
Once we completed moving all of policies into code base,
we can also change default policy rules via policy.yaml
instead of policy.json and generate policy.yaml by command:
$ tox -e genpolicy
[1]https://governance.openstack.org/tc/goals/queens/policy-in-code.html
Change-Id: I587ee663eff9632ec355cef8152c13e1ebfffeb5
Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Allow users to enable whatever freezer-api version they like.
* Added enable_v1_api to control v1 api
* Added enable_v2_api to control v2 api
Implements blueprint api-v2-multi-tenancy
Change-Id: I62a31476d416f9fe89e6e90c2206a55a8c1b7d14
Signed-off-by: Saad Zaher <eng.szaher@gmail.com>
Added Freezer API V2 which supports mainly multitenancy
Added a new database driver to support project_id parameter.
API v2 will be in development status till the end of pike
API v1 will be deprecated by end of Pike
oslo.db patch will be based on API v2
Implements blueprint api-v2-multi-tenancy
Signed-off-by: Saad Zaher <eng.szaher@gmail.com>
Change-Id: I2791246b7d6dc6c91427af45c0930e5d334a4861
Abstract storage configuration section to load different database
backend drivers. so we can keep supporting elasticsearch for
a while after moving to oslo.db also this will help in adding
API v2 as the elasticsearch driver will be changed.
Each db driver will register it's configuration on the run time.
Change-Id: Ie861e569f4add783c6f580cd0c08ed0fb3440151
This sets up the HTTPProxyToWSGI middleware in front of Freezer.
The purpose of this middleware is to set up the request URL
correctly in case there is a proxy (For instance, a loadbalancer
such as HAProxy) in front of Freezer.
The HTTPProxyToWSGI is off by default and needs to be enabled
via a configuration value.
Depends-On: Iffd38a325204a3ec7380a7a56061866477d3d06e
Change-Id: I44d60863eefeb52891474653aa9fcf1ba57d50a1
Closes-bug: #1590608
After executing "freezer-scheduler register" we face problem that
all shards failed in elasticsearch (ES).
If we use number of replicas "0" according to ES documentation
for one node installation then this issue disappeared.
After "first use" of freezer tool cloud engineer can add
additional ES nodes to cluster and fine tune this value
in configuration file.
Change-Id: I4f2a6562358aefb6244f8d0590a9f138db19a925
Moving freezer-api to oslo.policy and modified freezer context
to be injected through paste configuration
Change-Id: I20b9ac48cf3419015ff54f6c57de5f00c8e6d5f2
Implements: blueprint switch-freezer-api-oslo-policy
Start using Paste and Paste deploy for providing some flexability
to system administrator while deploying freezer-api.
Implements blueprint move-to-paste
Change-Id: I3f68a98ae7822495627791edb5be125556ff0b98
Added storage section for elk config and keystone_authtoken section
for keystone related configurations
Change-Id: Iba3e1c97bfd58fb39c6f9208e31014dde8658f2f
Closes-Bug: #1565737
Switching freezer-api to oslo config opts and oslo logging opts to
follow Openstack standards and benfit from oslo libraries
Change-Id: I1b97db2e02087dccca3be25246c275d4e778094f
Implements: blueprint switch-api-to-oslo-config
It is now possible to specify the number of replicas of the freezer
index in the elasticsearch database.
The value is set by the freezer-db-init script and can be specified
either as a command line parameter or defined in the freezer-api config
file.
When not specified it is set to the default value 2.
Adds the following command line parameter to the freeze-db-init script:
-r --replicas <N>
Adds the following parameter to the [storage] group of the
freezer-api.conf file:
number_of_replicas = N
Change-Id: I210dce8bf634727f52c87152c3d036cc4d7065b5
Add support for options to be passed the the elasticsearch connection
The following options are supported in the freezer-api.conf file:
hosts='http://localhost:9200'
use_ssl=False
ca_certs=''
use_ssl=False
timeout=60
retries=20
The provided values are the respective defaults.
Implements blueprint: api-conf-db-options
Change-Id: I373503bf845d0ac8091c83280ac21611d30d1a07
Refactoring logging to use oslo.log to have standard OpenStack logging.
Refactoring log messages to enable i18n translations.
Refactoring Exception messages to enable i18n translations.
New requirement oslo.log.
Change-Id: I68850f9236f228c2ba99db2c3f3fb3a412f5ee4c
The default credentials in freezer-api.conf
erroneously used the admin user and tenant
Now they contain the user "freezer" and tenant "service".
This is consistent with the installation documentation
Closes bug: #1465712
Change-Id: Icd315c2613980fac41c958b5854a2a10c5a8c6c2
First implementation of the freezer API.
Slightly more than a skeleton with basic functionality
Change-Id: Iae04affea3aa0f4a943599b528df49d9d4a5b845
Implements: blueprint freezer-api-first-rel