agent

package
v0.1.58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

README

This package contains the system management agent client written in the Go programming language.
The system management agent client is used by Go services or other Go code to communicate with the EdgeX support-agent microservice (regardless of underlying implementation type) by sending REST requests to the service's API endpoints.

How To Use

To use the management agent client package you first need to import the library into your project:

import "github.com/edgexfoundry/go-mod-core-contracts/clients/agent"

As an example of use, to find the health of a service using the management agent client:

ac := NewAgentClient("localhost:48082")

And then use the client to get all value descriptors

res, err := ac.Health(context.Background(), []string{"edgex-core-data"})
// check err (not shown)
fmt.Printf("health for core-data service: %s\n", res)

Documentation

Overview

agent provides a client for integrating with the system management agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgentClient

func NewAgentClient(urlClient interfaces.URLClient) *restClient

NewAgentClient creates an instance of AgentClient

Types

type AgentClient

type AgentClient interface {
	// Operation issues start/stop/restart operation requests.
	Operation(ctx context.Context, operation models.Operation) (string, error)
	// Configuration obtains configuration information from the target service.
	Configuration(ctx context.Context, services []string) (string, error)
	// SetConfiguration issues a set configuration request.
	SetConfiguration(ctx context.Context, services []string, request configuration.SetConfigRequest) (string, error)
	// Metrics obtains metrics information from the target service.
	Metrics(ctx context.Context, services []string) (string, error)
	// Health issues requests to get service health status
	Health(ctx context.Context, services []string) (string, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL