Giter Club home page Giter Club logo

Comments (5)

DRuggeri avatar DRuggeri commented on July 20, 2024 1

I misunderstood the intent - reopening.

I think it would help most to understand the workflow that your API server uses. Can you please describe it in more detail?

What I understand so far:

  • Objects live under /webhooks
  • To create an object, you use PUT to /webhooks/<some ID fetched by a datasource> per your config
  • The provider returns a result in JSON and the ID of the object is in result.id
  • You override what the API server responds with and force the internal ID to be update_result_webhook1
  • On the second run, the provider asks /webhooks/update_result_webhook1 for info, but gets a 404
  • You're no longer talking about the Infoblox API, but rather some other API

What is particularly confusing, though, is why you reference a datasource (data.restapi_object.get_webhook1.id) from the resource that should be managing that object. There shouldn't be a datasource in play here that I know of.

I think you need to...

  • Remove the datasource since you should create the object in the resource, not out of band
  • stop setting id_attribute and let the create action get the ID from the result

I strongly encourage following the readme to produce debug logs. If you understand the API you're working with a bit, seeing how the provider interacts with it through the debug logs should provide a lot of insight into how the configuration values come into play.

from terraform-provider-restapi.

DRuggeri avatar DRuggeri commented on July 20, 2024

Let's continue the conversation in #46 - it looks config related.

from terraform-provider-restapi.

cnguyenp avatar cnguyenp commented on July 20, 2024

My intention is to update the object with ID, and I need to set update_method and create_method to PUT for the provider and use create_path on resource to update the object.

Is that setup required?

from terraform-provider-restapi.

DRuggeri avatar DRuggeri commented on July 20, 2024

Sorry for the slow reply, @cnguyenp, I missed your message. I'm afraid I don't fully understand. I think it would be best to enable debug logging and see what the API is saying in response to your creation attempt and compare that to the values used in the configuration. Hopefully that provides some breadcrumbs to follow in order to locate the misconfiguration.

from terraform-provider-restapi.

DRuggeri avatar DRuggeri commented on July 20, 2024

Closing this issue since it's been a while. Feel free to reopen with more information.

from terraform-provider-restapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.