feat: Add Netbox User Permission Resource #390
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This feature allows management of netbox user permissions with
terraform. It follows the pattern of testing and design similar to that
of other resources.
A unique feature of this resource is the handling of the
constraints
field. Since this field is a JSON blob in the netbox API, we had to
find a nice way to convert a JSON string into a JSON blob. And since
this field can be either a JSON list or a JSON object, we had to handle
this accordingly. By using
json.Unmarshal()
on the string, and thendoing a type switch, we could detect the correct type, and set that in
the struct for sending it to the API.
Also updated the autogenerated docs in a separate commit.
Ref: #387