C# 클래스 RightScale.netClient.Core.APIClientBase

Singleton instance API Client manages HTTP connections, authentication caching and all REST calls to the RightScale API
상속: IDisposable
파일 보기 프로젝트 열기: rs-services/RightScaleNetAPI

공개 메소드들

메소드 설명
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