Class KepwareApiClient
Client for interacting with the Kepware server Configuration API. Using the KepwareApiClient class provides the ability to create, read, update and delete configuration of a Kepware server instance.
All handlers are defined in the Kepware.Api.ClientHandler namespace.
public class KepwareApiClient : IKepwareDefaultValueProvider
- Inheritance
-
KepwareApiClient
- Implements
- Inherited Members
Constructors
- KepwareApiClient(KepwareApiClientOptions, ILoggerFactory, HttpClient)
Initializes a new instance of the KepwareApiClient class. This class represents a connection to an instance of Kepware. An instance of this is used in all configuration calls done.
Fields
- UNKNOWN
The value for an unknown client or hostname.
Properties
- Admin
Gets the admin handlers.
- ApiServices
Gets the services handlers.
- ClientHostName
Gets the hostname of the Kepware server the client is connecting to.
- ClientName
Gets the name of the client instance.
- ClientOptions
Gets the client options for the Kepware server connection.
- GenericConfig
Gets the generic configuration handlers.
- Logger
Gets the logger instance used for logging operations.
- ProductInfo
Gets the product information of the connected Kepware server, which includes product name and version information. This caches the value during TestConnectionAsync(CancellationToken) and GetProductInfoAsync(CancellationToken) and cached for future use. It will return null if there is no cached value.
- Project
Gets the project handlers.
Methods
- GetProductInfoAsync(CancellationToken)
Gets the product information from the Kepware server which includes product name and version information. Will update the client's product info property, which can be used in other calls to avoid calling the API multiple times for the same information. Uses the /config/v1/about endpoint
- TestConnectionAsync(CancellationToken)
Tests the connection to the Kepware server and checks if the server runtime is healthy. Also validates authentication credentials. Uses the /config/v1/status endpoint for health verification. Uses the /config/v1/doc endpoint to verify credentials.