Documentation
¶
Overview ¶
Package clients provides gRPC client implementations for inventory services.
Index ¶
- Constants
- Variables
- type NetInventoryClient
- func (n *NetInventoryClient) FindIPAddresses(ctx context.Context) ([]*client.ResourceTenantIDCarrier, error)
- func (n *NetInventoryClient) GetIPAddress(ctx context.Context, tenantID, resourceID string) (*network_v1.IPAddressResource, error)
- func (n *NetInventoryClient) GetIPAddressesInSite(ctx context.Context, tenantID string, ipAddress *network_v1.IPAddressResource) ([]*network_v1.IPAddressResource, error)
- func (n *NetInventoryClient) Stop()
- func (n *NetInventoryClient) UpdateIPAddressStatusAndState(ctx context.Context, tenantID, resourceID string, ...) error
- type Option
- type Options
Constants ¶
const ( // DefaultInventoryTimeout is the default timeout for inventory operations. DefaultInventoryTimeout = 5 * time.Second // ListAllDefaultTimeout is the default timeout for list all operations. ListAllDefaultTimeout = time.Minute // Longer timeout for reconciling all resources )
Variables ¶
var ( // ListAllInventoryTimeout is the timeout used for list all inventory operations. ListAllInventoryTimeout = flag.Duration( "timeoutInventoryListAll", ListAllDefaultTimeout, "Timeout used when listing all resources for a given type from Inventory", ) )
Functions ¶
This section is empty.
Types ¶
type NetInventoryClient ¶
type NetInventoryClient struct {
Client client.TenantAwareInventoryClient
Watcher chan *client.WatchEvents
}
NetInventoryClient implements the methods to interact with the inventory gRPC server for the networking manager.
func NewNetInventoryClient ¶
func NewNetInventoryClient(invClient client.TenantAwareInventoryClient, watcher chan *client.WatchEvents) ( *NetInventoryClient, error, )
NewNetInventoryClient creates a client that wraps an existing Inventory client. Mainly for testing.
func NewNetInventoryClientWithOptions ¶
func NewNetInventoryClientWithOptions(opts ...Option) (*NetInventoryClient, error)
NewNetInventoryClientWithOptions creates a client by instantiating a new Inventory client. To be used in production.
func (*NetInventoryClient) FindIPAddresses ¶
func (n *NetInventoryClient) FindIPAddresses(ctx context.Context) ([]*client.ResourceTenantIDCarrier, error)
FindIPAddresses finds existing IP addresses in Inventory.
func (*NetInventoryClient) GetIPAddress ¶
func (n *NetInventoryClient) GetIPAddress(ctx context.Context, tenantID, resourceID string) ( *network_v1.IPAddressResource, error, )
GetIPAddress retrieves the IP address from Inventory.
func (*NetInventoryClient) GetIPAddressesInSite ¶
func (n *NetInventoryClient) GetIPAddressesInSite(ctx context.Context, tenantID string, ipAddress *network_v1.IPAddressResource, ) ([]*network_v1.IPAddressResource, error)
GetIPAddressesInSite retrieves the IP address from Inventory associated to a given site. Site can be undefined; meaning a query for all addresses not yet onboarded.
func (*NetInventoryClient) UpdateIPAddressStatusAndState ¶
func (n *NetInventoryClient) UpdateIPAddressStatusAndState(ctx context.Context, tenantID, resourceID string, ipAddress *network_v1.IPAddressResource, ) error
UpdateIPAddressStatusAndState updates an existing IPAddress status, status_detail and current state in Inventory.
type Option ¶
type Option func(*Options)
Option is an Inventory client option.
func WithEnableMetrics ¶
WithEnableMetrics returns an option to enable or disable metrics collection.
func WithEnableTracing ¶
WithEnableTracing enable tracing.
func WithInventoryAddress ¶
WithInventoryAddress sets the Inventory Address.
func WithOptions ¶
WithOptions sets the Inventory client options.