Commit Graph

31 Commits

Author SHA1 Message Date
Michal Nasiadka bc79012f46 Drop Swarm support
Label validator function has been left behind, although it's not
checking for anything right now - might be useful in future.

Change-Id: I74c744dc957d73aef7556aff00837611dadbada7
2024-01-24 13:20:21 +13:00
Felipe Reyes a8bce0bfee Add validator for fixed_subnet
Validate the existance of the subnet referenced by fixed_subnet. It's
not checked if the subnet is associated to the fixed_network.

Closes-Bug: #2038109
Change-Id: Ia75f0ae525b768ad5b965d22b522cca6f80dcab2
2023-11-28 11:14:44 -03:00
Felipe Reyes 753baadbb8 Add validator for fixed_network.
The validate_fixed_network() validator looks for an available network
matching the id or name, if no networks match a FixedNetworkNotFound
exception is raised, if more than one networks match then the Conflict
exception is raised.

Partial-Bug: #2038109
Change-Id: I7fb0122889feb4f8fa039be5752e8ac3fbc23b94
2023-10-06 08:25:40 -03:00
guilhermesteinmuller 6e8657912c Drop Mesos code
The coe mesos has not been maintained for quite some
time and hasn't got much attention from the community
in general. As discussed in the mailing list [1] we
are dropping for now.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2021-December/026230.html

Co-Authored-By: jake.yip@ardc.edu.au

Change-Id: Ie7de9a37bfad6214f52d0605409e74d62a51df47
2023-03-07 14:02:05 +11:00
Ionuț Bîru acc7084889 Fix validation for master_lb_enabled
Currently master_lb_enabled can be enabled at cluster creation but validation
is only done for cluster_template.

We need to validate in cluster.

Fix testing

task: 41535
story: 2007634
story: 2008487
Change-Id: Icf32de2b803aa160dc3b7993e128deff11d02fcb
2021-01-05 16:28:10 +00:00
Erik Olof Gunnar Andersson daf34d9df8 Use oslo_serialization instead of the json module directly
* Always use oslo jsonutils.
* Consistently import jsonutils as-is.
* Use dump_as_bytes instead of dumps.
https://wiki.openstack.org/wiki/Python3#Serialization:_base64.2C_JSON.2C_etc.

Change-Id: I2b65faa7df43a1d58205e8ff106ff62f73d78198
2019-01-21 16:28:03 -08:00
Jim Bach 8f4643d85c Make providing a keypair optional
A user may not rely on nova-keypairs to access their cluster
such as a preconfigured SSSD.

story: 2004402
task: 28035

Change-Id: I77fbdc174d3dddfd312fb8dac20516314d4c182e
2018-11-21 16:17:46 +00:00
Clenimar Filemon ec950be894 federation api: api endpoints
this commit introduces a new '/federations'
endpoint to Magnum API, as well as its controllers,
entities and conductor handlers.

this corresponds to the first phase of the
federation-api spec. please refer to [1] for more
details.

[1] https://review.openstack.org/#/c/489609/

Change-Id: I662ac2d6ddec07b50712109541486fd26c5d21de
Partially-Implements: blueprint federation-api
2018-02-09 00:59:31 -03:00
Ricardo Rocha 84006f63d7 Allow flavor_id on cluster create
Add flavor_id as an option during cluster create. If not given,
the default is taken from the cluster template.

Add flavor_id in the Cluster object and use that instead
of the one from ClusterTemplate.

Update both magnum and magnum cli documentation to reflect the above changes.

Partial-Bug: #1699245
Change-Id: Ib60c05cce1cf2639ca4740abdd264403033433f9
2017-12-15 16:32:40 +00:00
yuhui_inspur 5cbb881c50 Fix some typos
Change-Id: Ic68dcbb8c2d850b3b42c73db8774637068c94645
2017-02-16 00:20:01 -08:00
yatin 2d160ecfcb Support scheduler strategy for swarm cluster
Swarm cluster can be created by specifying any of the scheduler
strategy supported by swarm. The strategy can be specified
while creating cluster template using labels parameter, Ex:-
--labels swarm_strategy=spread
Supported values for swarm_strategy=spread, binpack, random

Change-Id: If471f10a3b1f955638a77d5afe462aebdeb4277c
Implements: blueprint add-support-different-strategy-in-swarmbay
2016-11-03 12:00:57 +05:30
Jaycen Grant 06f056f606 Allow keypair to be added during cluster create
Keypair can now be added during Cluster create command. This allows
Clusters to be created from the same ClusterTemplate but have
different keypair values when created. If not specified on create
then the value from the ClusterTemplate will be used. Adds keypair_id
to Cluster object and uses of keypair_id will use the value from Cluster
instead of ClusterTemplate.

Added release note for new features in magnum and magnum CLI.

Change-Id: I177a5aa06f881156944a9f74c9ccc3cd2abac492
Implements: blueprint keypair-override-on-create
2016-10-06 17:25:09 +00:00
Jenkins e7413d102a Merge "Revert "Update mesos slave to mesos agent"" 2016-08-31 15:23:37 +00:00
yatin 272903ff9e Revert "Update mesos slave to mesos agent"
This reverts commit 15162ce33a.

Mesos services were not working, so reverted the patch
which renamed slave to agent.

Change-Id: I94a9a36e649f48f8e31386226226261ef459ce25
Closes-Bug: #1617407
2016-08-30 08:49:45 +05:30
Jaycen Grant 4a3578101c Bay to Cluster api cleanup
This patch fixes a few missed changes.  It also updates Cluster
and ClusterTemplate with a few changes that were merged while the
main patch was a WIP. Updates changes from patches:
Idd02769f98078702404a11dc9f7a3339ce4e22eb and
I1abc5626f39958351935f4c711c19588651d2bc6

Change-Id: I509520d1af0f0e2c04d53359705973d6a6f97a26
Implements: blueprint rename-bay-to-cluster
2016-08-23 15:55:22 -07:00
Rajiv Kumar 15162ce33a Update mesos slave to mesos agent
Mesos community has renamed slave to agent. This change reflect
this renaming in the code.

Change-Id: Ic97a827345b62f812ed63180cd1f5820e2200682
Closes-Bug: #1516188
2016-07-18 08:51:17 +05:30
Jenkins dcaa3af04e Merge "Improve validation for the external network parameter" 2016-07-12 03:17:03 +00:00
Jenkins f8fa49d144 Merge "Allow k8s cluster without LBaaS" 2016-07-08 15:50:18 +00:00
Drago Rosson 2ea72d739d Allow k8s cluster without LBaaS
This patch adds an environment file and a couple of template resources
to allow the LBaaS resources to be conditionally enabled/disabled.

Change-Id: I40ef0839dca84f398efb02022fa7c1de821fb1a3
Partially-Implements: blueprint decouple-lbaas
Partially-Implements: blueprint bay-with-no-floating-ips
2016-07-06 15:01:00 -05:00
PanFengyun ae0b77a55a Improve validation for the external network parameter
1. Check the network name to see if there is duplicate name. If so,
   advise user to use network ID.
2. External network cannot be private network, so filter the query
   for the external network with this attribute to validate.

Change-Id: Ic02add0338cef344d02ef68c8372488fbe0b8fcd
Closes-Bug: #1591018
2016-07-05 14:35:55 +08:00
PanFengyun 16d8842149 Add a explanatory text when flavor is None
Add "Use the default value from heat template when flavor is None."
at validate_flavor() to prevent misunderstanding.
See: https://review.openstack.org/#/c/282199/2/magnum/api/attr_validator.py

Change-Id: Ie9c235ccb6510485f6d6d52dbff81fbcd61492df
2016-07-04 11:22:06 +08:00
wangqun 3bd8d5eb8b Add mesos_slave_executor_env_variables validate
mesos_slave_executor_env_variables is mesos executor
environment variables, and it should be a json form.
(1) validate mesos_slave_executor_env_variables
if matching the json form.
(2) modify the mesos slave configure file
(3) unit test

Partially-Implements:blueprint mesos-slave-flags
Change-Id: I35e56515f321b0df52b3ba0e8aba48d7dd421d58
2016-05-20 08:23:25 +00:00
wangqun f23be29dd7 Add mesos_slave_image_providers validate
Add the baymodel mesos_slave_image_providers labels validate and
mesos_slave_image_providers unit test

Change-Id: I63d36fb531783013d9f7762dd992a26508043448
Partially-Implements:blueprint mesos-slave-flags
2016-05-12 05:51:32 +00:00
wangqun f7f78f6b56 Add mesos_slave_isolation validate
Add the baymodel mesos-slave-isolatin labels validate and
mesos_slave_isolation unit test

Change-Id: I4826d3fec757e43da664f17226294a7caecd3508
Partially-Implements:blueprint mesos-slave-flags
2016-05-09 02:40:02 +00:00
Lin 0a7cde5fdf Cleanup some validation functions
There is no need to get the resource object in validate_flavor and
validate_external_network at all, all the things we want do to are
just validate they are there.

Change-Id: I7ab980958718ae8681a6fe36f46b97cb0ea77042
2016-04-25 13:10:51 +08:00
wangqun 4d39d8cc94 Fix baymodel with invalid parameter can created.
Now, when we create baymodel with the invalid flavor_id and
master_flavor_id parameters, the baymodel can be created
successfully.

We need to validate the flavor_id and master_flavor before
creating baymodel.

Change-Id: Id6768d8246c97d56e529cbc1cab6c8c7d28ca43a
Closed-Bug: #1547345
2016-03-02 15:44:09 -05:00
houming-wang 3086de9ed6 Replace dict.iteritems() with dict.items()
Replace dict.iteritems() which is no longer present in Python 3 with
dict.items(). Do not use six.iteritems because discussion in mail list
http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I51ac7904f9194a6c9ed72c1cb0e7afdc535f6bd4
Partially-Implements: blueprint magnum-python3
2015-12-22 20:13:54 -05:00
houming-wang 3d3eaa1269 Validate image when create a Bay
For good user experience, we should validate Baymodel's image
in Bay creation. The following 3 conditions will be checked:
1. Image not existed - 404 Not Found
2. Found multiple images with same image name - 409 Conflict
3. Image 'os_distro' field is None or empty string - 404 Not Found

Patially-Implements: blueprint api-parameter-validation

Change-Id: I54a75c005cd7dbf406e6dd31a2f27e8e46c0612c
2015-12-09 07:44:55 -05:00
houming-wang 8ab451ec39 Validate keypair when create a bay
For good user experience, we should validate if Baymodel's keypair
is existed in Bay creation. When create a Bay, a 404 NotFound will
be raised if keypair in Bay's Baymodel isn't existed.

Patially-Implements: blueprint api-parameter-validation

Change-Id: I01f06ab54c5713b91ba6d8ead0d224bbe3d570e4
2015-11-30 16:18:31 +08:00
houming-wang 6e6fcb7b6d Validate external network when create a bay
For good user experience, we should validate if Baymodel's network
is existed in Bay creation. When create a Bay, a 404 NotFound will
be raised if external_network in Bay's Baymodel isn't existed.

Change-Id: Iec2e06380ca53268b85bcdd7d1539f5d10a09181
Patially-Implements: blueprint api-parameter-validation
2015-11-27 22:20:58 -05:00
houming-wang 00add124ec Validate baymodel's flavor when create a bay
Currently when we create a Bay, the API parameter validation toward
Bay's Baymodel is not enough to prevent bay creation failure,
due to non-existed or unprivileged OpenStack resources(flavor,
image, keypair, external_network, fixted_network) can be
referenced and there're no check/validation toward them.
We should check the existence of flavor in Bay creation.
A 404 NotFound will be raised if flavor in Bay's Baymodel isn't existed.

Change-Id: I34e97e32a952c5d65dd2c37fbd99c202456f4877
Patially-Implements: blueprint api-parameter-validation
2015-11-26 09:28:06 -05:00