C# Class pi_web_api_cs_helper.PIWebAPIClient

Afficher le fichier Open project: osisoft/PI-Web-API-Samples Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
GetTagValueLink ( string serverWebId, string tagName ) : Task

Get the value link for a specific PI tag.

Method Details

Dispose() public méthode

Disposing the HttpClient.
public Dispose ( ) : void
Résultat void

GetAsync() public méthode

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.
Résultat Task

GetDataServersWebIdAsync() public méthode

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

GetTagValueAsync() public méthode

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.
Résultat Task

PIWebAPIClient() public méthode

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

PIWebAPIClient() public méthode

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
Résultat System

PostAsync() public méthode

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.
Résultat System.Threading.Tasks.Task

SearchAsync() public méthode

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

WriteTagValueAsync() public méthode

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.
Résultat System.Threading.Tasks.Task