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

feat: introduce new api client based on netbox-community/go-netbox #600

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yoo
Copy link

@yoo yoo commented May 20, 2024

This is the followup PR for #591.

The NetBox API client setup is moved to netbox/client to keep the provider setup code clean. The Config struct is passed to the provider functions containing both the legacy- and new API client.
The version check in the provider setup is the only API call moved to the new client.
The only thing changed in the existing resources is the type assertion to access the legacy client.

The NetBox API client setup is moved to netbox/client to
keep the provider setup code clean. The `Config` struct
is passed to the provider functions containing both the
legacy- and new API client.
The version check in the provider setup is the only API
call move to the new client.
The only thing changed in the existing resources is
the type assertion to access the legacy client.
trimmed := false

// This is Go's poor man's while loop
for strings.HasSuffix(serverURL, "/") {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The for loop is not required. TrimRight already removes all instances of /.

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

Successfully merging this pull request may close these issues.

1 participant