Project

General

Profile

Bug #28068

Use existing aliases in network interface API instead of creating new ones

Added by Vladimir Vinogradenko over 1 year ago. Updated about 1 year ago.

Status:
Done
Priority:
Blocks Until Resolved
Assignee:
Vladimir Vinogradenko
Category:
Middleware
Target version:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

The following request fails:

PUT /api/v1.0/network/interface/1/

{
    "int_aliases": [
        "192.168.0.199/24",
        "192.168.0.198/24" 
    ],
    "int_dhcp": true,
    "int_interface": "em0",
    "int_ipv4address": "",
    "int_ipv6address": "",
    "int_ipv6auto": false,
    "int_media_status": "Active",
    "int_name": "em0",
    "int_options": "",
    "int_v4netmaskbit": "",
    "int_v6netmaskbit": "",
    "ipv4_addresses": [],
    "ipv6_addresses": []
}

with

{"alias_v4address": ["You cannot configure multiple interfaces with the same IP address (192.168.0.198)"]

When alias 192.168.0.198 is already configured on em0.

Associated revisions

Revision 5b8205f2 (diff)
Added by Vladimir Vinogradenko over 1 year ago

fix(api): Use existing aliases in InterfacesResourceMixin instead of creating new ones

Ticket: #28068

Revision 48bb0632 (diff)
Added by Vladimir Vinogradenko over 1 year ago

fix(api): Use existing aliases in InterfacesResourceMixin instead of creating new ones

Ticket: #28068

Revision 7357ed68 (diff)
Added by Vladimir Vinogradenko over 1 year ago

fix(api): Use existing aliases in InterfacesResourceMixin instead of creating new ones

Ticket: #28068

History

#1 Updated by Vladimir Vinogradenko over 1 year ago

  • Status changed from In Progress to Done
  • Target version set to 11.2-RC2

#2 Updated by Dru Lavigne over 1 year ago

  • Subject changed from PUT /api/v1.0/network/interface/1/ with int_aliases specified does not behave as intended to Use existing aliases in network interface API instead of creating new ones
  • Target version changed from 11.2-RC2 to 11.2-BETA1
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#3 Updated by ChenTao Wang over 1 year ago

Thanks

#4 Updated by ChenTao Wang over 1 year ago

One issue:

I can't detect alias pairs(ipv4 and ipv6) from init_aliases.

#5 Updated by Dru Lavigne about 1 year ago

  • Status changed from Done to Ready for Testing

#6 Updated by Eric Turgeon about 1 year ago

  • Severity set to New
  • Needs QA changed from Yes to No

Looks fine now it is working.

Out[16]: '{"id": 1, "int_aliases": ["192.168.2.232/24"], "int_dhcp": true, "int_interface": "vtnet0", "int_ipv4address": "", "int_ipv6address": "", "int_ipv6auto": false, "int_media_status": "Active", "int_name": "ext", "int_options": "", "int_v4netmaskbit": "", "int_v6netmaskbit": "", "ipv4_addresses": ["192.168.2.232/24"], "ipv6_addresses": [], "pk": "1"}'

In [17]: results = PUT("/network/interface/1/", {"int_aliases": ['192.168.2.232/24', '192.168.2.233/24']}, api='1')

In [18]: results.text
Out[18]: '{"id": 1, "int_aliases": ["192.168.2.232/24", "192.168.2.233/24"], "int_dhcp": true, "int_interface": "vtnet0", "int_ipv4address": "", "int_ipv6address": "", "int_ipv6auto": false, "int_media_status": "Active", "int_name": "ext", "int_options": "", "int_v4netmaskbit": "", "int_v6netmaskbit": "", "ipv4_addresses": ["192.168.2.232/24", "192.168.2.233/24"], "ipv6_addresses": [], "pk": "1"}'

In [19]: results
Out[19]: <Response [200]>

#7 Updated by Dru Lavigne about 1 year ago

  • Status changed from Ready for Testing to Done

Also available in: Atom PDF