Bug #1404073 “type should be required for v2.0 service create” : Bugs : python-openstackclient
For v2.0, the API says the following, but is unclear about what is required vs. optional
http://
{
"OS-
"id": "123",
"name": "nova",
"type": "compute",
}
}
Based on the v3 API, type should be the only argument that is required.
However, looking at what is implemented, there is very little validation going on. 'id' is assigned set at the controller level:
https:/
And 'enabled' which is missing from the API is set at the manager level:
https:/
There is no validation performed at any level, leaving it up to the backends, for the SQL backend for instance, only 'enabled' is required:
https:/
class Service(
__tablename__ = 'service'
attributes = ['id', 'type', 'enabled']
id = sql.Column(
type = sql.Column(
enabled = sql.Column(
extra = sql.Column(
endpoints = sqlalchemy.
Which means the following call works, and is very useless:
$ http post http://
{
"OS-KSADM:
"type": null,
"enabled": true,
"id": "fe937fd1152f49
}
}
Keystoneclient requires name, type and description.
https:/
It should probably at least default some of those to None.
Lastly OpenstackClient has only 'name' as a required argument.
$ openstack service create --type service_type_1
usage: openstack service create [-h] [-f {html,json,
openstack service create: error: too few arguments
We should probably make this similar to v3, where the only required argument is 'type', and name/description are optional.