C# Class pi_web_api_cs_helper.PIWebAPIClient

Datei anzeigen Open project: osisoft/PI-Web-API-Samples Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Disposing the HttpClient.

GetAsync ( string uri ) : Task

Async GET request. This method makes a HTTP GET request to the uri provided and throws an exception if the response does not indicate a success.

GetDataServersWebIdAsync ( ) : string>>.Task

Get the list of PI Data Archives in "name, webId" pairs.

GetTagValueAsync ( string serverWebId, string tagName ) : Task

Get the value of a particular PI tag.

PIWebAPIClient ( string url ) : System

Initiating HttpClient using the default credentials. This can be used with Kerberos authentication for PI Web API.

PIWebAPIClient ( string url, string userName, string password ) : System

Initializing HttpClient by providing a username and password. The basic authentication header is added to the HttpClient. This can be used with Basic authentication for PI Web API.

PostAsync ( string uri, string data ) : System.Threading.Tasks.Task

Async POST request. This method makes a HTTP POST request to the uri provided and throws an exception if the response does not indicate a success.

SearchAsync ( string query, string scope, string fields, int count = 10, int start ) : Task
WriteTagValueAsync ( string serverWebId, string tagName, string valueToWrite ) : System.Threading.Tasks.Task

Write a value at current time to a particular PI tag.

Private Methods

Method Description
GetTagValueLink ( string serverWebId, string tagName ) : Task

Get the value link for a specific PI tag.

Method Details

Dispose() public method

Disposing the HttpClient.
public Dispose ( ) : void
return void

GetAsync() public method

Async GET request. This method makes a HTTP GET request to the uri provided and throws an exception if the response does not indicate a success.
public GetAsync ( string uri ) : Task
uri string Endpoint for the GET request.
return Task

GetDataServersWebIdAsync() public method

Get the list of PI Data Archives in "name, webId" pairs.
public GetDataServersWebIdAsync ( ) : string>>.Task
return string>>.Task

GetTagValueAsync() public method

Get the value of a particular PI tag.
public GetTagValueAsync ( string serverWebId, string tagName ) : Task
serverWebId string WebId of the PI Data Archive.
tagName string Name of the PI tag.
return Task

PIWebAPIClient() public method

Initiating HttpClient using the default credentials. This can be used with Kerberos authentication for PI Web API.
public PIWebAPIClient ( string url ) : System
url string
return System

PIWebAPIClient() public method

Initializing HttpClient by providing a username and password. The basic authentication header is added to the HttpClient. This can be used with Basic authentication for PI Web API.
public PIWebAPIClient ( string url, string userName, string password ) : System
url string
userName string User name for basic authentication
password string Password for basic authentication
return System

PostAsync() public method

Async POST request. This method makes a HTTP POST request to the uri provided and throws an exception if the response does not indicate a success.
public PostAsync ( string uri, string data ) : System.Threading.Tasks.Task
uri string Endpoint for the POST request.
data string Content for the POST request.
return System.Threading.Tasks.Task

SearchAsync() public method

public SearchAsync ( string query, string scope, string fields, int count = 10, int start ) : Task
query string
scope string
fields string
count int
start int
return Task

WriteTagValueAsync() public method

Write a value at current time to a particular PI tag.
public WriteTagValueAsync ( string serverWebId, string tagName, string valueToWrite ) : System.Threading.Tasks.Task
serverWebId string WebId of the PI Data Archive.
tagName string Name of the PI tag.
valueToWrite string Value to write.
return System.Threading.Tasks.Task