C# Класс RightScale.netClient.Core.APIClientBase

Singleton instance API Client manages HTTP connections, authentication caching and all REST calls to the RightScale API
Наследование: IDisposable
Показать файл Открыть проект

Открытые методы

Метод Описание
Authenticate ( ) : bool

Default and base authentication call which pulls authentication data from the app.config or web.config for the specified keys. OAuth2 token is prioritized in front of username/password/accountid if specified.

Authenticate ( string oAuthRefreshToken ) : bool

Authentication method for http client that uses oAuth2 process for authenticating to RightScale API

Authenticate ( string oAuthRefreshToken, string accountID ) : bool

Authentication method for http client that uses oAuth2 process for authenticating to RightScale API

Authenticate ( string userName, string password, string accountID ) : bool

Legacy authentication method using username, password and accountID for authenticating to RightScale API

Authenticate ( string userName, string password, string accountID, string baseUrl ) : bool

Legacy authentication method using username, password and accountID for authenticating to RightScale API

Authenticate_Instance ( string api_instance_token ) : bool

Authentication process for instance-based RSAPI authentication

Delete ( string apiHref ) : bool

API Method to Delete a record within the RightScale system

Dispose ( ) : void

Dispose handles dispose of custom objects before disposing of the remainder of the object

InitWebClient ( ) : void

internal method to init web client

InitWebClient ( string shardBaseUrl ) : void

Public method to initialize the API caller specifically for an account that's on a distinct RightScale shard

setAPIBaseAddress ( string apiBaseUrl ) : void

Public method resets the API base address (shard) If it is changing, this will reinitialize the web client and force authentication again

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

IDisposable implementation guts

setAPIVersion ( string apiVer ) : void

Protected helper method for setting api version of the client

Приватные методы

Метод Описание
CheckAuthenticationStatus ( ) : bool

Private method used to validate authentication status of singletion instance of API class

Delete ( string apiHref, string queryStringValue ) : bool

API Method to Delete a record within the RightScale system

Get ( string apiHref ) : string

Public GET process to hit RightScale API

Get ( string apiHref, string queryStringValue ) : string

GET process to hit RightScale API

InitAuthTimer ( ) : void

Method manages centralized logic for initializing the proactive authentication timeout process

Post ( string apiHref, string>.List parameterset, string returnHeaderName ) : List

Override to Post method without an output string

Post ( string postHref, string>.List postData, string returnHeaderName, string &contentOutput ) : List

Centralized method to handle post calls to RightScale API

Post ( string apiHref ) : bool

API method to perform a POST request to the RightScale API

Post ( string apiHref, string>.List postData ) : bool

API method to perform a POST request to the RightScale API

Post ( string apiHref, string headerName, string &outString ) : bool

API method to perform a POST request to the RightScale API

Put ( string putHref, string>.List putData ) : bool

PUT wrapper to make calls via HTTP to the RightScale API

SetOauthBearerToken ( string bearerToken ) : bool

Public method takes in oauth bearer token and authenticates the object if a bearer token is passed in. Ths process assumes that the bearer token is currently valid.

authTimer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void

Tick method for AuthTimer resets authentication state of singleton api caller

getOauthHrefPath ( ) : string

Private helper method gets proper Oauth api href path

Описание методов

Authenticate() публичный Метод

Default and base authentication call which pulls authentication data from the app.config or web.config for the specified keys. OAuth2 token is prioritized in front of username/password/accountid if specified.
public Authenticate ( ) : bool
Результат bool

Authenticate() публичный Метод

Authentication method for http client that uses oAuth2 process for authenticating to RightScale API
public Authenticate ( string oAuthRefreshToken ) : bool
oAuthRefreshToken string OAuth2 Token taken from RightScale Dashboard
Результат bool

Authenticate() публичный Метод

Authentication method for http client that uses oAuth2 process for authenticating to RightScale API
public Authenticate ( string oAuthRefreshToken, string accountID ) : bool
oAuthRefreshToken string OAuth2 Token taken from RightScale Dashboard
accountID string Account ID used for API 1.0 calls
Результат bool

Authenticate() публичный Метод

Legacy authentication method using username, password and accountID for authenticating to RightScale API
public Authenticate ( string userName, string password, string accountID ) : bool
userName string RightScale login user name
password string RightScale login password
accountID string RightScale Account ID to be programmatically accessed
Результат bool

Authenticate() публичный Метод

Legacy authentication method using username, password and accountID for authenticating to RightScale API
public Authenticate ( string userName, string password, string accountID, string baseUrl ) : bool
userName string RightScale login user name
password string RightScale login password
accountID string RightScale Account ID to be programmatically accessed
baseUrl string Distinct base URL for calling RightScale API
Результат bool

Authenticate_Instance() публичный Метод

Authentication process for instance-based RSAPI authentication
public Authenticate_Instance ( string api_instance_token ) : bool
api_instance_token string $env:RS_API_TOKEN value
Результат bool

Delete() публичный Метод

API Method to Delete a record within the RightScale system
public Delete ( string apiHref ) : bool
apiHref string API Href fragment corresponding to the API root
Результат bool

Dispose() публичный Метод

Dispose handles dispose of custom objects before disposing of the remainder of the object
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

IDisposable implementation guts
protected Dispose ( bool disposing ) : void
disposing bool determines that call is to dispose of resources
Результат void

InitWebClient() публичный Метод

internal method to init web client
public InitWebClient ( ) : void
Результат void

InitWebClient() публичный Метод

Public method to initialize the API caller specifically for an account that's on a distinct RightScale shard
public InitWebClient ( string shardBaseUrl ) : void
shardBaseUrl string base url of the shard the account is associated with
Результат void

setAPIBaseAddress() публичный Метод

Public method resets the API base address (shard) If it is changing, this will reinitialize the web client and force authentication again
public setAPIBaseAddress ( string apiBaseUrl ) : void
apiBaseUrl string Base URL to use for accessing RightScale API
Результат void

setAPIVersion() защищенный Метод

Protected helper method for setting api version of the client
protected setAPIVersion ( string apiVer ) : void
apiVer string String representing the API version to be used
Результат void