The API reference http://developer.openstack.org/api-ref/networking/v2/index.html doesn't reflect the fact a Qos Policy linked to an existing network can be updated:
$ curl -s -H "X-Auth-Token: $OS_TOKEN" http://${OS_HOST}:9696/v2.0/qos/policies | python -mjson.tool{
"policies": [
{
"description": "This policy limits the ports to 10Mbit max.",
"id": "c4e80891-5d77-480f-8970-a7223fd72f4b",
"name": "10Mbit",
"rules": [],
"shared": false,
"tenant_id": "5a23535b5dda4770bccc856d0167e53f"
}
]
}
$ curl -s -H "X-Auth-Token: $OS_TOKEN" -H "Content-Type: application/json" http://${OS_HOST}:9696/v2.0/networks/b18d3079-fcaa-41b7-8aec-0d009789fff8| python -mjson.tool
{
"network": {
"admin_state_up": false,
"id": "b18d3079-fcaa-41b7-8aec-0d009789fff8",
"mtu": 0,
"name": "cristalnet",
"port_security_enabled": true,
"provider:network_type": "vxlan",
"provider:physical_network": null,
"provider:segmentation_id": 39,
"qos_policy_id": null,
"router:external": false,
"shared": true,
"status": "ACTIVE",
"subnets": [],
"tenant_id": "5a23535b5dda4770bccc856d0167e53f",
"vlan_transparent": null
}
}
$ curl -s \
> -X PUT \
> -H "X-Auth-Token: $OS_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{"network": { "qos_policy_id": "c4e80891-5d77-480f-8970-a7223fd72f4b" } }' \
> http://${OS_HOST}:9696/v2.0/networks/b18d3079-fcaa-41b7-8aec-0d009789fff8 | python -mjson.tool
{
"network": {
"admin_state_up": false,
"id": "b18d3079-fcaa-41b7-8aec-0d009789fff8",
"mtu": 0,
"name": "cristalnet",
"port_security_enabled": true,
"provider:network_type": "vxlan",
"provider:physical_network": null,
"provider:segmentation_id": 39,
"qos_policy_id": "c4e80891-5d77-480f-8970-a7223fd72f4b",
"router:external": false,
"shared": true,
"status": "ACTIVE",
"subnets": [],
"tenant_id": "5a23535b5dda4770bccc856d0167e53f",
"vlan_transparent": null
}
}
As per [1] and [2] , it seems that this is not an issue with Neutron, but in fact with the API reference doc.
[1]: https:/ /github. com/openstack/ neutron/ blob/b9e7611373 ad1eac4e4df6185 96ebb32b677ce45 /neutron/ extensions/ qos.py# L125
[2] :
[- -description DESCRIPTION]
[- -qos-policy QOS_POLICY | --no-qos-policy]
[- -dns-domain DNS_DOMAIN | --no-dns-domain]
NETWORK
usage: neutron net-update [-h] [--request-format {json}] [--name NAME]