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

PATCH option for resource azapi_update_resource #693

Open
randy-coburn-zeam opened this issue Dec 12, 2024 · 3 comments
Open

PATCH option for resource azapi_update_resource #693

randy-coburn-zeam opened this issue Dec 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@randy-coburn-zeam
Copy link

I know after dumpster diving in closed issues that azapi_resource_action is available.

However it seems documented pretty obscurely when you also have azapi_update_resource available. The example doesn't represent the same features that you would use update_resource for.

The name of the resource is important since when you first arrive you see update and think thats what I want. Then spend an a few hours battling why it doesn't work and tries to change everything. resource_action doesn't really sign "I change things" when you first read it.

That is how I interpreted whats going on in docs.

Is it possible that azapi_update_resource could just have a http_method option that is defaulted to "PUT" but at least allows the user to change it to match what the documentation requires.

@ms-henglu ms-henglu added the enhancement New feature or request label Dec 18, 2024
@ms-henglu
Copy link
Member

Hi @randy-coburn-zeam ,

Thank you for taking time to report this issue.

I'll work on improving the documents and investigate the feasibility of supporting Patch method in the azapi_update_resource.

Would you please also share the user-case that you need to use Patch method to update an existing resource?

@randy-coburn-zeam
Copy link
Author

In my case I was trying to update the open telemetry settings for a container app environment.

Using patch I can selectively update parts of the config. Using put I need to supply a complete config with my updated changes.

@ms-henglu
Copy link
Member

Actually the azapi_update_resource will call GET request to retrieve the current status of the existing resource, then combine with the configuration defined in the body, finally removes the read-only fields and send the PUT request. If so, will it solve your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants