Skip to content

ipam/services: GET parent_object_type - wrong data type - integer #20554

@cernymi

Description

@cernymi

NetBox Edition

NetBox Community

NetBox Version

v4.3.0 and never

Python Version

3.12

Steps to Reproduce

  1. Create virtual machine (in exapmple used vm.id=361).

  2. Create service/application service for VM - POST is working fine ("parent_object_type": "string",)

curl -X 'POST' \
  'https://demo.netbox.dev/api/ipam/services/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-CSRFTOKEN: <X-CSRFTOKEN> \
  -d '{
  "parent_object_type": "virtualization.virtualmachine",
  "parent_object_id": 361,
  "name": "web_tcp_https",
  "protocol": "tcp",
  "ports": [
    443
  ],
  "ipaddresses": [
  ],
  "description": "web_tcp_https",
  "comments": "web_tcp_https",
  "tags": [
  ],
  "custom_fields": {
  }
}'
  1. Try to get query this service using parent_object_id and parent_object_type
curl -X 'GET' \
    'https://demo.netbox.dev/api/ipam/services/?parent_object_type=virtualization.virtualmachine&parent_object_id=361' \
    -H "Authorization: Token <Token>" \
    -H 'X-CSRFTOKEN: <CSRFTOKEN>'

Expected Behavior

PATH:           IPAM/SERVICES:
Method:         GET
Object:         parent_object_type
Data type:      integer -> string

Observed Behavior

Response is:

{"parent_object_type":["Select a valid choice. That choice is not one of the available choices."]}

or more detailed:

Please correct the following validation errors and try again. 
For 'parent_object_type': Value must be an integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationtype: bugA confirmed report of unexpected behavior in the application

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions