type should be required for v2.0 service create
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Won't Fix
|
Undecided
|
Unassigned | ||
python-keystoneclient |
Fix Released
|
Low
|
Lin Hua Cheng | ||
python-openstackclient |
Fix Released
|
Undecided
|
Lin Hua Cheng |
Bug Description
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.
Changed in python-openstackclient: | |
assignee: | nobody → Lin Hua Cheng (lin-hua-cheng) |
summary: |
- name should be optional for service-create + type should be required for v2.0 service create |
Changed in python-keystoneclient: | |
assignee: | nobody → Lin Hua Cheng (lin-hua-cheng) |
Changed in python-openstackclient: | |
milestone: | none → m7 |
Changed in python-openstackclient: | |
status: | Fix Committed → Fix Released |
Changed in python-keystoneclient: | |
milestone: | none → 1.1.0 |
importance: | Undecided → Low |
Changed in python-keystoneclient: | |
status: | Fix Committed → Fix Released |
You are looking at the v2.0 code. /github. com/openstack/ python- openstackclient /blob/master/ openstackclient /identity/ v2_0/service. py#L36- L54
https:/
Compared to the v3 code, which seems to agree with the API /github. com/openstack/ python- openstackclient /blob/master/ openstackclient /identity/ v3/service. py#L34- L57
https:/
Try setting: API_VERSION= 3 localhost: 5000/v3
$ export OS_IDENTITY_
$ export OS_AUTH_URL=http://
And adding: DOMAIN_ ID=default DOMAIN_ ID=default
$ export OS_PROJECT_
$ export OS_USER_
To get the actual v3 command for service create.