Documentation ¶
Index ¶
- type Client
- type V2Client
- func (client *V2Client) BatchUpdateDUTs(ctx context.Context, req *fleet.BatchUpdateDutsRequest, writer io.Writer) error
- func (client *V2Client) DeleteDUTs(ctx context.Context, hostnames []string, authFlags *authcli.Flags, ...) (modified bool, err error)
- func (client *V2Client) FilterDUTHostnames(ctx context.Context, hostnames []string) ([]string, error)
- func (client *V2Client) GetDutInfo(ctx context.Context, id string, byHostname bool) (*inventory.DeviceUnderTest, error)
- func (client *V2Client) UpdateDUT(ctx context.Context, newSpecs *inventory.CommonDeviceSpecs) error
- func (client *V2Client) UpdateLabstations(ctx context.Context, hostname, servosToDelete, dutToAdd string) (*invV2Api.UpdateLabstationsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { GetDutInfo(context.Context, string, bool) (*inventory.DeviceUnderTest, error) DeleteDUTs(context.Context, []string, *authcli.Flags, rem.RemovalReason, io.Writer) (bool, error) BatchUpdateDUTs(context.Context, *invV1Api.BatchUpdateDutsRequest, io.Writer) error FilterDUTHostnames(context.Context, []string) ([]string, error) UpdateLabstations(context.Context, string, string, string) (*invV2Api.UpdateLabstationsResponse, error) UpdateDUT(context.Context, *inventory.CommonDeviceSpecs) error }
Client defines the common interface for the inventory client used by various command line tools.
type V2Client ¶
type V2Client struct {
// contains filtered or unexported fields
}
V2Client is an API client for the inventory V2 service.
func NewInventoryClient ¶
func NewInventoryClient(hc *http.Client, inventoryService string, options *prpc.Options, ) *V2Client
NewInventoryClient creates a new instance of inventory client.
func (*V2Client) BatchUpdateDUTs ¶
func (client *V2Client) BatchUpdateDUTs(ctx context.Context, req *fleet.BatchUpdateDutsRequest, writer io.Writer) error
BatchUpdateDUTs updates many DUTs.
func (*V2Client) DeleteDUTs ¶
func (client *V2Client) DeleteDUTs(ctx context.Context, hostnames []string, authFlags *authcli.Flags, rr rem.RemovalReason, stdout io.Writer) (modified bool, err error)
DeleteDUTs deletes DUTs from the inventory and tracks the reason for the removal.
func (*V2Client) FilterDUTHostnames ¶
func (client *V2Client) FilterDUTHostnames(ctx context.Context, hostnames []string) ([]string, error)
FilterDUTHostnames produces a list of only the DUT hostnames that exist.
func (*V2Client) GetDutInfo ¶
func (client *V2Client) GetDutInfo(ctx context.Context, id string, byHostname bool) (*inventory.DeviceUnderTest, error)
GetDutInfo gets the dut information from inventory v2 service.
func (*V2Client) UpdateDUT ¶
UpdateDUT takes the device specifications for a DUT and updates its entry in the inventory.
func (*V2Client) UpdateLabstations ¶
func (client *V2Client) UpdateLabstations(ctx context.Context, hostname, servosToDelete, dutToAdd string) (*invV2Api.UpdateLabstationsResponse, error)
UpdateLabstations is similar to UpdateDUT but updates a labstation instead. Since labstations manage devices like servos and DUTs, updating a labstation potentially involves modifying multiple tracked by the inventory in a way that can't be done as a sequence of individual steps without breaking invariants.