Commit Graph

33 Commits

Author SHA1 Message Date
Ghanshyam Mann e02a492817 [goal] Deprecate the JSON formatted policy file
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
2021-03-08 19:52:30 -06:00
gecong1973 6925ba26ee modify document for api version v1 support for sql driver
The patch fix the freezer-api.conf.sample and config of
v1 support for sql driver.

Change-Id: Id57681148cf026a2e06d2d6a8ec7aa8fcf1eb4aa
2018-11-01 18:57:09 -07:00
gengchc2 d1a5e93b25 Correct errors about freezer-api supporting for V1 and V2 api
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
2018-11-01 09:16:39 +00:00
Mike Chen 63927a39c5 set enable_v1_api=false in config sample
This is to avoid confusion as v1_api has been disabled by default
since d9f9579317

Change-Id: Idc51fdc31af9c440d1028c74e9c703a204413912
2018-10-30 03:42:33 +00:00
Cai Hui fc088216b2 Remove ababdoned code.
The entry_point "service_v1" has changed to appv1 & appv2.
The extra code in files is cleaned up.

Change-Id: I1b907e3115c15f0fe82ecb2d54457209cfcf21e6
Id: I0d3d3982ea29bfb6a9af1c85dbd244025104c152
2018-09-26 03:36:04 -04:00
wangqi 16fed0a31c Drop all qpid related explanations
Qpid was removed in Mitaka from Oslo Messaging, so we
can remove all qpid related explanations

Change-Id: I1a90db55002454dcbbcb14073055c61a08480daf
2018-03-11 15:55:42 +00:00
Saad Zaher d8e0dc21e0 Part 1: Implement Sqlalchemy driver for freezer-api
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
2018-02-19 11:12:38 +00:00
Hieu LE ae388911e0 Implement policy in code - client (end)
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
2017-10-30 07:29:43 +00:00
Hieu LE b4ba0018d9 Implement policy in code - backup (5)
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
2017-10-16 10:28:32 +07:00
Hieu LE 5222c58007 Implement policy in code - session (4)
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
2017-10-16 10:19:54 +07:00
Hieu LE 22c9c648ad Implement policy in code - action (3)
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
2017-10-16 10:04:53 +07:00
Hieu LE 0013785558 Implement policy in code - job (2)
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
2017-10-16 09:50:25 +07:00
Dai Dang Van 8f3039508a Implement policy in code (1)
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>
2017-10-05 14:33:27 +00:00
Saad Zaher 3a6ec7c213 Configure dsvm gate job to use uwsgi instead of apache2
Change-Id: I31c8f5e724367e863fd613fbad170e52f99f1a42
2017-06-06 16:24:05 +01:00
Saad Zaher 268cfbbfc0 Add Enable/Disable options for freezer-api
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>
2017-04-21 16:08:42 +00:00
Saad Zaher 49e934d589 Implement API v2 with fully support Mutli-tenancy
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
2017-04-10 10:48:55 +00:00
Jenkins 9e5ee52710 Merge "Allow using different database backends" 2017-03-16 00:13:08 +00:00
Saad Zaher 528f3234e9 Allow using different database backends
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
2017-03-15 19:20:56 +00:00
Saad Zaher 231548dfec Remove custom healthcheck app and use oslo middleware instead
We shouldn't use custom healthcheck instead we should use the oslo
middleware healthcheck.

Change-Id: Ib8decdc33dbf3ce7e2e4c28890322f8466748275
2017-03-13 16:09:26 +00:00
Saad Zaher 06b1afccb3 Allow freezer-api to display existing versions
Change-Id: I16117ee5aa3b8987e40c14baf7037137cad13ae2
2017-03-10 18:14:26 +00:00
Jeremy Liu fbd1f04abf Use http_proxy_to_wsgi middleware
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
2016-10-19 07:45:25 +00:00
vnogin d963673bdc Change default value of elasticsearch replicas
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
2016-09-28 14:18:49 +01:00
Saad Zaher ce09bbfa28 Implemented oslo.policy
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
2016-08-11 11:10:57 +00:00
Saad Zaher 525c7f12cb Move to Paste and Paste-deploy
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
2016-05-31 17:19:59 +00:00
Saad Zaher 153279105e Adding storage, keystone_authtoken sections to sample config
Added storage section for elk config and keystone_authtoken section
for keystone related configurations

Change-Id: Iba3e1c97bfd58fb39c6f9208e31014dde8658f2f
Closes-Bug: #1565737
2016-04-04 17:27:29 +01:00
Saad Zaher d4e727d033 Switch Freezer-api to oslo.config and oslo.log
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
2016-04-04 10:52:16 +01:00
memo dfa9598545 Updated LICENSE file and headers
removed unnecesary header in license
added missing header in files

Change-Id: Iea79505307479541de01231dd25c3821e9e8999c
2015-11-09 16:13:30 +00:00
Fabrizio Vanni 4faa13b8e7 Add support for elasticsearch number of replicas
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
2015-10-28 09:49:35 +00:00
Fabrizio Vanni 8c43204bfd devstack plugin interface
adds interface files for freezer-api to be installed
as a devstack plugin

Change-Id: I8e7d2d8ee973b6c6b88208cdb38c9aa6d69ca13d
2015-10-16 12:50:14 +01:00
Fabrizio Vanni 4deb7ead04 config options for elasticsearch connection
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
2015-09-09 18:58:02 +01:00
Erno Kuvaja 7a571cb13d Refactoring logging and translations on freezer_api
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
2015-07-30 19:45:42 +01:00
Fabrizio Vanni 1ecfecdfd3 Fix default auth credentials in freezer-api.conf
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
2015-06-16 17:37:46 +01:00
Fabrizio Vanni acbc7aefae Freezer API
First implementation of the freezer API.
Slightly more than a skeleton with basic functionality

Change-Id: Iae04affea3aa0f4a943599b528df49d9d4a5b845
Implements: blueprint freezer-api-first-rel
2015-04-08 18:25:45 +01:00