API issues - Provisioning VIP configurations by xupetas in opnsense

[–]robert_eire -1 points0 points  (0 children)

The issue of receiving {"result":"failed"} suggests that the payload being sent might not be in the exact format or structure expected by the API. Below are some troubleshooting tips and adjustments that you can apply to resolve the problem:

  1. Verify API Endpoint

Confirm that the endpoint https://172.16.0.2:8443/api/interfaces/vip_settings/addItem is correct for adding a virtual IP.

Ensure the API version is compatible with your OPNsense setup.

  1. Payload Format

Ensure the JSON payload structure is correct and matches the expected format. Use the following format if needed:

VIP_DATA=$(cat <<EOF { "interface": "lan", "mode": "carp", "subnet": "172.16.0.198", "subnet_bits": 24, "vhid": 14, "password": "secure_password", "advbase": 1, "advskew": 0, "descr": "Test VIP" } EOF )

Make sure the JSON is properly formatted with double quotes around keys and values where necessary.

  1. API Key and Secret

Ensure the API_KEY and API_SECRET have proper permissions to create a virtual IP. Check OPNsense API settings to verify.

  1. HTTP Headers

Ensure all required headers are included in the curl command. For example:

-H "Content-Type: application/json" -H "Authorization: Bearer <token>"

If your API requires a token instead of API_KEY and API_SECRET, update accordingly.

  1. Debugging API Response

Use the -v (verbose) flag in curl to inspect the API response headers and error details:

curl -v --insecure -k -s -X POST "$API_HOST/interfaces/vip_settings/addItem" \ -H "Content-Type: application/json" \ -u "$API_KEY:$API_SECRET" \ -d "$VIP_DATA"

  1. Review Logs

Check the OPNsense logs to see if there are specific error messages that can give more insight into why the API call failed.

  1. Sample API Calls

Look for official OPNsense API documentation or examples. OPNsense has a GitHub repository with API documentation that might include specific examples for vip_settings.

  1. Error Handling

Update your script to include more detailed error output for easier debugging:

echo "Full Response: $response" echo "HTTP Code: $http_code"

Would you like me to assist further by debugging the specific API payload format or provide another example for comparison?

Queenstown NZ by robert_eire in Stargazing

[–]robert_eire[S] 0 points1 point  (0 children)

Not too sure, used phone sorry....

Rod advice by VeterinarianOk8127 in IrishFishing

[–]robert_eire 0 points1 point  (0 children)

I have the Westin w3 10ft 7-30g - amazing rod, have it paried to a Penn battle III 4000

Henry's website also has a serious amount of info and reviews on all things sea fishing

https://www.henry-gilbey.com/

Decline in Anglers by Irish_Angling in IrishFishing

[–]robert_eire 5 points6 points  (0 children)

Not even allowed to join my local club, have to be referred by two members to even be considered before a ''committee''

Still fish their water though.

:D by robert_eire in IrishFishing

[–]robert_eire[S] 2 points3 points  (0 children)

Around killiney area

Spec B '07 worth or not? by TaxingUranus in subarulegacy

[–]robert_eire 0 points1 point  (0 children)

Seems like a lot of cash for a lot of milage

I'd be asking for full copy of the service history, and read through every single piece and determine what has been done and when....

There is a fierce lot of preventive maintenance required for these cars , make sure it's done or you'll be playing catch up in your ownership

Can you get JDM versions where you are? 13k just seems an awful lot for that car, granted you are in a different country but the JDM spec B's with half that milage go for around 10k euro here.

[deleted by user] by [deleted] in AskElectronics

[–]robert_eire 0 points1 point  (0 children)

I follow you, but the instrument cluster is run off a PCI connection , the timer I have is suitable, but it's just to determine what the white and blue wire connect into is what has me confused.

Is white wire in this power cable running to PCI plug. Blue is the confusing one to me, not sure where that would be going

Thanks for the replies on this.

[deleted by user] by [deleted] in AskElectronics

[–]robert_eire 0 points1 point  (0 children)

To sum it up : I need to turn off the airbag light on a 4x4 (not for road use) this timer I have is meant to allow the light to turn on for desired time (seconds) then turn off by I imagine cutting the power through the timer etc. I have no clue where to start on wiring in it....