The Neutron API requires that the content_type and accept headers
are correcty set in the request. This commit permit to fix this
issue.
It has been successfully tested with Tox.
Closes-Bug: 1754096
Change-Id: I977f97cd0692a86bac1d817fa1c4de27889f2675
Implemented as an alias of org.openstack.flavor.ephemeral so both can be
used.
Change-Id: I8764af5778d73b3a9e112cfff97be7efdda6af33
Related-Bug: 1687943
Updates in compute with correct mixin will produce a VM resize. The
resize will not be confirmed automatically unless the
resize_confirm_window is configured in nova.
Change-Id: I8b868a8a4fb403e337d3fe6c08b7d3f65736e545
Some tests used incorrect order of arguments in
assertEqual(observed, expected). The correct order expected
by testtool is assertEqual(expected, observed).
Change-Id: I9ef01d5aef1610830a4d89ecea3c5b128c9fa6ed
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: Icfc0998c77b4d9c2112af331d21ec5b41fd7de50
We need to use the same environment (with the token, etc.) for making
the neutron calls, instead of just trying to obtain the token from the
headers (whose key lookup in the dictionary, by the way, was wrong). We
need to remove some keys from the environ, so that the new request is
created properly.
Change-Id: I86bedab940449a07780e288c03d4de789b8e695a
Change d5ad90a fixed the publication of OCCI/1.1 as the supported OCCI
version, but it introduced a new bug that prevented users from passing
OCCI/1.1 in the user agent, forcing them to be OCCI/1.2. Even if the
OCCI spec says that: "The 'User-Agent' header MUST include the same
value (OCCI/X.Y) as advertised by the server" we should continue
accepting OCCI/1.1 as a valid version.
Change-Id: Iabcd8fda367876568b6f221d0ecc5ab2ffa06c90
Closes-Bug: #1683317
Use block_device_mapping instead of block_device_mapping_v2 that seems
to not attach properly volumes on creation. This legacy option is enough
to support the requested use case (attaching volumes on boot).
Change-Id: I39f17faec6a48e90740e5e4757c1278df0b9830c
Closes-bug: #1679498
This is a complete change in which we have add the OCCI IPRESERVATION
class with the features provided by CESNET. We include: the controller,
the occi class, middleware changes, and tests to control it.
In addition, we have modified networklink to support this feature,
now networklink is identified by using only compute id and ipreservation
ip. Last, we add the documentation relate to its usage.
Change-Id: I52f80a9a7a39e00d1d7487001863586a551edf5f
To check if the user was providing a scoped token we were relying on the
"HTTP_X_PROJECT_ID" environment variable, relying on a KeyError
exception when accessing the dictionary. However, the variable can be
empty, resulting in a dictionary key "HTTP_X_PROJECT_ID":None. As a
consequence, we were using None as the project ID, resulting in
misleading errors.
Closes-bug: #1678060
Change-Id: I1956fd99be5771371b1d3401e335528c5cc6455e
OCCI1.2 creates new actions on compute resources, "save" creates
an snapshot of an existing image and includes that snapshot as
a valid OS Template.
Implements: blueprint snapshot-support
Change-Id: Ic416d3c5fd9757af4f949158a0a15c83775ea801
ooi needs to return URLs of objects matching the URL scheme used
for serving the application even if ooi is behind a SSL termination
proxy.
A new configuration variable "ooi_secure_proxy_ssl_header" that
defines the HTTP header that can be used to update the wsgi.url_scheme
environment variable. Typical value for this variable is
'HTTP_X_FORWARDED_PROTO'.
Change-Id: I7ce7583f64778f667a7ea310d493390d9e19f1e2
Closes-Bug: #1676844
We have implemented the API and helpers for Nova and Neutron for
the Security Group Resource and Link. Security Group is working
just by using json requests.
Change-Id: I15ce76a42caa75f158ac1a792aa44d2da8c7e404
Sometimes OpenStack does not return any device in the attached volumes, this
change avoids a KeyError when not defined.
Change-Id: If96fa02a7d6fd93e31667b2481943c6294173f72
Closes-Bug: #1663491
Text rendering of OCCI includes the category of the link associated to a
resource. This helps clients to select the links based on their kinds.
Change-Id: Ibd803cb26566e40b5fc589cdea6d111eaec36e03
Closes-Bug: #1656844
List the routers of the tenant and use the first router with external
gateway, thus It is linked to the public network.
In case no router with those features is found, a new one is created.
Change-Id: I696ebe04426fab7e210d86f30084c4fee64cbce8
Closes-bug: #1637497
Introduces two new mixins defined in the OCCI 1.2 spec for handling
contextualization: user_data and ssh_key. Functionality is similar to
the already existing OpenStack mixins, which may be deprecated in the
future.
Partially-Implements: blueprint occi-1-2-core
Change-Id: Ibb6624e3e15bf7b9f3ad39786dcefb36b1a9a797
Change the link structure returned by the parser to better follow the
OCCI 1.2 standard. The parser returns a dictionary where keys are the
link target kind type and values are lists with dictionaries for each
of the links of the links defined for that kind type. Those dictionaries
contain the target location (occi.core.target), the link id if defined,
and a dictionary with any extra attributes defined.
Change-Id: I24205044a6e2b670ceb98f3a0e9224637bf9fcf4
Parses JSON OCCI structures as defined in the current OCCI 1.2 draft and
populates the internal structure used in ooi for managing input from
users.
Change-Id: I687f38420a0f4290f1ee0cffdae22c9b5fade43d
Every time we need to return more than one object a collection should
be used instead of a list of those objects. This allows to render the
objects taking into account their context. If returning a single
object controllers must return the object instead of a list.
Change-Id: I0caa3334dbd14374f39bf41acf45528fc7befa45
Collection with only one type of objects are rendered as X-OCCI-Location,
as when returned when performing a GET to a resource location.
For collections with more than one type, render each of the individual
objects.
Change-Id: I4978e5f8eacbb3db0e6f0bc2ddf02ac3c6d9ac54
Render OCCI objects as json as defined in the current draft of
the OCCI 1.2 standard.
Partially-Implements: blueprint json-rendering
Change-Id: I472e452a7cb1fda70ebd991df6cf64e2e1d5cc7b
In order to do proper JSON rendering, ooi needs to to further refine
the Object attribute type into numbers, bools and strings. All
attributes are updated to include the type. Object attribute type is
only used now for source and targets in links. Handling of attributes
in network is simplified thanks to this change.
Change-Id: If1c0e6b1e08139b369b3c68c4a12ff7244c3445f
skip B104:hardcoded_bind_all_interfaces since we are an API, so we need
to bind to all interfaces, skip this test for now.
Change-Id: I2ce3eccb28872b81c04f79e2434833f8c038af3f