Commit Graph

91 Commits

Author SHA1 Message Date
wangqiangbj b64129d435 fix typos
Change-Id: I8a58467fa86b0e7a3e18e33dcb57f147b728bf32
2019-01-09 21:03:33 +08:00
Zuul a2ef179412 Merge "Auto generate backend for core plug_in" 2018-01-08 23:35:22 +00:00
JinLi 731ed8c5d4 Auto generate backend for core plug_in
Adds the logic to auto generate binding_urls and user this
binding_url to retrieve ipaddress for port.

Change-Id: I3c83ec3f23fae271c775c9b862bc9ba0c9b9e1ff
2018-01-04 23:36:54 +00:00
Jin Li 3fa2a729ac Add ipaddress to BaseServiceBinding
If we need to add ip address when we are doing bindings,
we should add ip address as an attribute to BaseServiceBinding.
By adding it to the BaseServiceBinding, we will enforce all bindings
to have a consistent name across all services.

For example, in ietf-sfc we have both sfDataPlaneLocator and
sffDataPlaneLocator which extends BaseServiceBinding.They named their
ip address attribute “ip”. For net-l3vpn, they have vpnBinding extends
BaseServiceBinding, and it name its ip address attribute “ipaddress”.
This inconsistence in naming the ip attribute causes some troubles
in auto generating the backend.

Change-Id: I9f3f53937ae25e5e1dbfc5939db18d476c137f86
2018-01-04 15:24:50 -08:00
Zuul 8b721a0531 Merge "Remove confusing else statement" 2017-11-22 19:10:53 +00:00
Jin Li a0bffe14c0 Remove confusing else statement
The append_model() function in the generator.py file has a confusing else
statement. There is no need for setting
model['file_version'] = yaml_dict['file_version'] as entering the else
statement implies they are equal.

Change-Id: I5278677ac5890350dfac6d58cc8b04ff91f33849
2017-11-22 18:50:16 +00:00
JinLi 0bbfe4f360 Change state_path to use its default value
State_path is defined in gluon/conf/config.py, its default value is $gluon_home/gluon.
In the [default] section of the /etc/proton/proton.conf file, its value overrided to
/opt/proton/ which can cause confusion. This patch changes it back to use default value
for state_path defined in gluon/conf/config.py.

Change-Id: I6af2d7e04e51b0476430975c10cc01fca24c9d9d
2017-11-13 18:46:45 -08:00
JinLi 27f386ab68 Change status code to 200
In do_post, "status_code != 201" is checked for twice, one of them should be "status_code != 200"

Change-Id: Ia344225f1d5a013183d6af2c7876f4acab401546
Closes-Bug: #1719476
2017-09-25 15:55:24 -07:00
Jenkins adab3f1ca8 Merge "Add version number into URL" 2017-08-26 07:19:21 +00:00
Jenkins 5b46ab1021 Merge "Policies in yaml" 2017-08-26 01:17:10 +00:00
JinLi 8668c8d613 Add version number into URL
When backend driver generates url, it need to add the version
number into the url.
Before: /proton/net-l3vpn/ports/<id>
After: /proton/net-v3vpn/v1.0/ports/<id>

Change-Id: I4ccccc0312ad8613d55abb0daadf8160f704ed17
2017-08-25 17:25:38 -07:00
JinLi ecd29999cb Policies in yaml
Implement functions allowing to define object_level policies in
model's yaml file

Change-Id: I4a4b70edf95c56d8dba7ee669d5ccc8bd387c4d8
2017-08-25 16:09:57 -07:00
Jenkins 4925187f65 Merge "Function delete_port() takes exactly 3 arguments (4 given) in handle_port_delete()" 2017-08-24 14:26:17 +00:00
zhaojingjing0067370 83ed959007 Function delete_port() takes exactly 3 arguments (4 given) in handle_port_delete()
When deleting net-l3vpn port, TypeError: delete_port() takes exactly 3 arguments (4 given).
delete_port() is called in File "/usr/lib/python2.7/site-packages/gluon/shim/api_models/net_l3vpn.py",
line 229, in handle_port_delete self.backend.delete_port(key, self.model, deleted_obj).

Change-Id: I1cb080104cfa1decdc3b8f45d102636d3d1e6af7
2017-08-24 14:48:01 +08:00
Jenkins e43336b05c Merge "Gluon object-level authorization" 2017-08-23 18:29:08 +00:00
JinLi 69c47a7d4b Gluon object-level authorization
Implements object-level authorization. e.g. create-port, list-port

Change-Id: I70c022108dd7019cd169dca02bdb3d47d48b6717
2017-08-23 10:55:35 -07:00
Jenkins d8b4fa5a56 Merge "Resolve warnings in Sphinx documentation" 2017-08-18 22:51:52 +00:00
Jenkins 04e39bfb95 Merge "The para into "add_model()“ should be changed to model in function ”build_api()“." 2017-08-16 18:43:24 +00:00
Omar Tleimat 2fe5276a56 Resolve warnings in Sphinx documentation
Currently several warnings are being thrown when running
tox -e docs, this is an attempt to fix those warnings

Change-Id: I26f3e1d83f2bfc7c5d5cd2a9393b24c992ff1122
2017-08-16 09:36:34 -07:00
zhaojingjing0067370 32b6ba1803 The para into "add_model()“ should be changed to model in function ”build_api()“.
There is "model = load_model_for_service(service)" in function ”build_api()“.
And ”model“ can be used more reasonably in the function.

Change-Id: I26ed5314d0c27e8ddf0c32a2f38b91648de5e577
2017-08-09 11:03:10 +08:00
Nir Magnezi 056b07ea71 Stop using deprecated CORS.set_latent()
As a follow up to Icd44684b3d05ff6a07665348c08adff8245f2523
Use cors.set_defaults instead of app.set_latent.

Change-Id: I0dfe41ecb95182ce9a66d247f7120dadf3ae4b9f
2017-08-01 13:03:22 +03:00
Jenkins cdf947e48e Merge "Add configuration option for policy.json file path For user authorizations, oslo_policy need to load the rules and policies defined in the policy.json file. When the oslo_policy enforcer is initializing it will look for the path of this file in cfg.CONF. Gluon needs to add this configuration option to its configuration." 2017-07-26 22:36:13 +00:00
JinLi e1b0fdaad1 Add configuration option for policy.json file path
For user authorizations, oslo_policy need to load the rules and policies defined in the policy.json file. When the oslo_policy
enforcer is initializing it will look for the path of this file in
cfg.CONF. Gluon needs to add this configuration option to its
configuration.

Change-Id: I248d5c00a7259bb62bacf20d3ea2975293500c5e
2017-07-26 12:37:24 -07:00
JinLi 8fefd47b22 Rule to code
This patch only moves rule definitions from policy.json to code.
Policies definitions e.g. "create_ports" or "get_ports" will
still be defined in the policy.json file.

In the future, policy definitions will be auto generated from model's
yaml files[1]. Then policy definitions will be removed from the
policy.json file.

[1] https://github.com/openstack/gluon/blob/master/doc/source/devref/gluon-auth.rst#defining-authorization-rules

Change-Id: I266ea81d1df198e775a93902984d9865fc6201a0
2017-07-13 17:07:51 -07:00
Jenkins 81d1dbe31e Merge "Moving hardcoded constants to config file" 2017-06-14 18:14:47 +00:00
JinLi 9c8902cc26 Moving hardcoded constants to config file
This is the first commit that starts the process of moving hardcoded
constants into config files. There will be more commits in future
as we identify more hardcoded constants in our code.

Change-Id: I0605567c8fa34cb0e809525b4b9194ebd02751eb
2017-06-13 12:21:14 -07:00
Jenkins b27d384d4d Merge "Proton Version Management" 2017-05-31 21:21:15 +00:00
Tin Lam 5fff618917 Fix doc gate failure
This patch set fixes the blocking documentation gate failure for Gluon.

Change-Id: Ic1e1b2ea8c65ba9d29940d1e9034857bfc78d0c6
2017-05-31 03:42:37 -05:00
JinLi 618e637f8a Proton Version Management
This patch impletements the Proton Version Management specifications
located here: https://review.openstack.org/#/c/456772/

Change-Id: I7581b55dbaac170439ac9274454a5e2c553fa7ca
2017-05-23 15:53:24 -07:00
Jenkins b82abe1579 Merge "Replace six.iteritems() with .items()" 2017-05-23 17:41:29 +00:00
Tin Lam 2ce4b26667 Remove sqlite_db parameter from set_defaults
oslo.db removed the deprecated sqlite_db option in its set_defaults()
method in [0].  This patch set updates the code and fixes the gating error.

[0] cc64f70105

Change-Id: If31a15fe594243162315cd75f561d11e20fc3241
2017-05-22 21:21:38 -05:00
Jenkins 98a7264bd3 Merge "Adding initial version of the SFC to Gluon" 2017-05-01 23:45:44 +00:00
Georg Kunz 0ca4eaa01d Adding initial version of the SFC to Gluon
This is an initial version of a Gluon API model for the IETF SFC
model.

Note: This is is a simplified version targeting the Gluon demo at the
Boston OpenStack summit. It does not fully represent the IETF SFC model.
The model is supposed to be extended in future releases.

Change-Id: I243f10be4f39baa6bce767283070e2a4915ef93a
Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
2017-04-30 22:06:17 +02:00
loooosy 373d7f0721 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using
six.iteritems to achieve iterators. We can
use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys
will more readable.
2.In py2, the performance
about list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Ida473d702a89e067c350c5cfde6c1982fb466577
2017-04-15 15:11:53 +08:00
Jenkins 629fd57ac5 Merge "Extending L3VPN model to configure BGP peerings" 2017-04-12 18:47:48 +00:00
Georg Kunz 4eee5af002 Extending L3VPN model to configure BGP peerings
This patchset extends the existing L3VPN model with additional
objects which allow to configure BGP peerings between SDN controllers
or data center gateways.

Change-Id: Id4d8e572f75e7246e9fa7006c792df31b13cea2f
Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
2017-04-12 20:33:05 +02:00
Bin Hu 4630cc62d1 Support all API YAML Models by default
Service API Models are defined in gluon/models directory, where each
sub-directory is a model of NFV networking service. An exemplary structure
looks like:

    gluon/models/net-l3vpn/api.yaml

A more generic example looks like:

    gluon/models/<service>/<name>.yaml

Currently, in gluon/cmd/config.py, service model is net-l3vpn only by
default. When a new service model is added, we need to add the new
service model in "service_list" of proton.conf, and restart the service
by something like:

    proton-server --config-file proton.conf

If some user forgets to add it to proton.conf, even if new service model
is defined appropriately, Proton Server only loads net-l3vpn by default.

This patch changes the default model to be all models under gluon/models
directory. This means that if a user adds a service model definition, he
does not have to change proton.conf. By simply restarting proton-server,
all models will be loaded by default. The user needs to change proton.conf
ONLY IF he has specific needs of supporting specific service(s).

So this patch improves usability of adding / removing new service models
on-demand.

The original work is credited to Thomas Hambleton.

Change-Id: If2e5b7225105ca0dbbda4bb85090ce3c86e0e7f8
Signed-off-by: Bin Hu <bh526r@att.com>
2017-04-12 09:49:01 -07:00
Jenkins b7b7bc331a Merge "Base URI return values" 2017-04-12 14:32:29 +00:00
JinLi a19c4befdc Base URI return values
Add the status attribute to version

Change-Id: I9115848e9d9b7b7191a85bb83840ee9f5ab3782a
2017-04-10 12:25:57 -07:00
Tin Lam 25a8b1634d Remove translation of log messages from gluon
The i18n team has decided not to translate the logs because it's not
very helpful.  See [1] and [2].  This removes the uses of _LE, _LI,
and _LW translation markers to simplify logging.  Currently these
markers are causing the gate to fail for gluon.

[1] http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
[2] http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I2ed70abf5d9cd6a762b724113c10bc6ca70b5188
2017-04-05 23:01:31 -05:00
Jenkins d78f72a61c Merge "Fixing broken import statement" 2017-04-01 01:13:48 +00:00
Georg Kunz c99134524a Fixing broken import statement
Uncommenting a previously commented import statement. This import
statement is needed to load the configuration options of the
proton server.

Change-Id: I507070825d9e3d9064d0924eaea4d6e610590c48
Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
2017-03-30 23:46:56 +02:00
Georg Kunz 1b7b3c9474 Fixing DB test after sqlite_db config option was removed
The sqlite_db config option was deprecated and has now been
removed from oslo.db which breaks this basic test. We use a
simple hardcoded database name instead.

Change-Id: I164f3523d3561340bdc85433075f49e551a6a3da
Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
2017-03-30 23:42:01 +02:00
Jin Li 458c177871 Remove unused import statements
Romove unused import statements from unitest files.
Also comment out unused import statements from non-test files,
keep them there in case they are needed in the future.

Change-Id: Id2d900839ec364c0b9108ef1c81e71ffe51207ff
2017-03-16 23:23:49 +00:00
Jenkins 09b6f244d9 Merge "Remove unused logging import" 2017-03-01 19:17:48 +00:00
Bin Hu 6fca42af21 Bug fix: Update the descripton of Base URL Access
When accessing Base URL, a description text will be shown.
Current description text is out of date. This patch updates
the description text to match current Gluon design.

Change-Id: I19613f43a29d66d36168f7bef037bdce541123b8
Signed-off-by: Bin Hu <bh526r@att.com>
2017-02-27 21:43:45 +00:00
Jenkins 0a1af7432b Merge "Return the correct verion in RootController's get method" 2017-02-21 18:19:15 +00:00
Anh Tran 25c00d3902 Remove unused logging import
Change-Id: Ic71ea287803f792d70105ec24012ee812b078401
2017-02-16 15:28:54 +07:00
Georg Kunz 617efa3616 Updating the ODL shim layer to port binding model
This patch modifies the ODl shim layer to comply with the revised
port and interface binding model in Gluon.

Change-Id: Ib4c7800203165474b4b72ac40ab5ef363d831d0c
Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
2017-02-13 17:55:48 +01:00
Georg Kunz ade1ed78e2 Using config option to bind to etcd server
In OPNFV Apex deployments, the etcd server listens only at a
specific host IP address, not localhost. As a result, the Gluon
plugin cannot talk to etcd in such deployments.

This fix (mis-)uses the Neutron bind_host configuration option
to allow the Gluon ML2 plugin wrapper to idenify the IP etcd
is listening on. This should be replaced by a proper config
option later on.

Change-Id: Ib9d958c267d0364889e1213f9fc7c93b4fd04d89
Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
2017-02-13 17:28:49 +01:00