Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avi_api_session does not handle forcedelete paths (i.e. /api/serviceengine/<se_uuid>/forcedelete #154

Open
joeycoakleyavi opened this issue Mar 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@joeycoakleyavi
Copy link

Describe the bug

  - name: Force Delete a Service Engine
      vmware.alb.avi_api_session:
        avi_credentials: "{{ AVI_CREDENTIALS }}"
        data:
          name: foo
        http_method: post
        timeout: 30
        path: "serviceengine/{{ se_uuid }}/forcedelete"

Results in:
vmware.alb.plugins.module_utils.avi_api.APIError: ('HTTP Error: 405 Error Msg {\"detail\": \"Method \\'GET\\' not allowed.\"}', <Response [405]>)\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

It looks like we are hitting this conditional

https://github.com/vmware/ansible-collection-alb/blob/eng/plugins/modules/avi_api_session.py#L199

which should be avoided if we add 'forcedelete' to api_get_not_allowed and sub_api_get_not_allowed on lines 181 and 182, respectively.

I added the above to my local ansible collection and it allowed the post to proceed correctly.

Reproduction steps

  1. Attempt to use avi_api_session module to POST to an endpoint which includes /forcedelete

Expected behavior

Post is expected to go through unless there is an issue with se_uuid or permissions.

Additional context

No response

@joeycoakleyavi joeycoakleyavi added the bug Something isn't working label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant