Skip to content

Could not PATCH /api/v2/interface for GIF interface #536

@chocomus

Description

@chocomus

I have GIF interface in pfsense, but could not PATCH /api/v2/interface to update that interface.

With pfsense-api v1, I could update the interface, but not with pfsense-api v2.

The following is the curl CMD results of GET /api/v2/interface and PATCH /api/v2/interface.

curl -X 'GET' \
  'https://pfsense.localdomain:32250/api/v2/interface?id=opt9' \
  -H 'accept: application/json' \
  -H 'x-api-key: foobar' | jq
----
{
  "code": 200,
  "status": "ok",
  "response_id": "SUCCESS",
  "message": "",
  "data": {
    "id": "opt9",
    "if": "gif0",
    "enable": true,
    "descr": "transix",
    ...
  }
}
----
curl -X 'PATCH' \
  'https://pfsense.localdomain:32250/api/v2/interface' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -H 'x-api-key: foobar' \
  -d '{"id":"opt9","if":"gif0","enable":true}' | jq
----
{
  "code": 400,
  "status": "bad request",
  "response_id": "FIELD_INVALID_CHOICE",
  "message": "Field `if` must be one of [igb0, em0, ovpns3, ovpnc1, ovpnc2, tun_wg0, em0.10, em0.20, em0.30, em0.99]",
  "data": []
}
----

Metadata

Metadata

Assignees

No one assigned

    Labels

    parityIssues or PRs regarding feature parity between versionsv2Issues or PRs that apply to v2

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions