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

add support for custom collectors #307

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

rajagopalans
Copy link
Collaborator

As previously discussed, this breaks out the Collectors as their own independent objects, hides some of the complexity of dealing with the API, giving a consistent CRUD interface.

There are some renaming and follow-up commits coming, but this outlines the logic that will be used.

@rajagopalans rajagopalans self-assigned this Aug 2, 2024
apstra/api_custom_collector.go Outdated Show resolved Hide resolved
apstra/api_custom_collector.go Outdated Show resolved Hide resolved
apstra/api_custom_collector.go Outdated Show resolved Hide resolved
apstra/api_custom_collector.go Outdated Show resolved Hide resolved
apstra/api_custom_collector.go Outdated Show resolved Hide resolved
apstra/api_custom_collector.go Outdated Show resolved Hide resolved
apstra/api_custom_collector.go Outdated Show resolved Hide resolved
apstra/enum.go Outdated Show resolved Hide resolved

cs, err := o.GetCollectorsByServiceName(ctx, in.ServiceName)
if err != nil {
return convertTtaeToAceWherePossible(err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

There shouldn't be any harm in invoking convertTtaeToAceWherePossible here, but it shouldn't be necessary. This code invoked a Client method, rather than talkToApstra(), so any error should already have been converted to a ClientErr.

@@ -474,6 +547,5 @@ func (o *RoutingZoneConstraintMode) FromString(s string) error {
if t == nil {
return fmt.Errorf("failed to parse RoutingZoneConstraintMode %q", s)
}
o.Value = t.Value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like a line was deleted by mistake?

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.

2 participants