C# Class Rally.RestApi.RallyRestApi

The main interface to the Rally REST API
Mostra file Open project: RallyTools/RallyRestToolkitFor.NET Class Usage Examples

Private Properties

Property Type Description
AuthenticateWithConnectionInfo AuthenticationResult
AuthenticateWithConnectionInfoBaseMethod AuthenticationResult
CreateIdpAuthentication void
DecodeArrayList IEnumerable
DoDelete DynamicJsonObject
DoGet DynamicJsonObject
DoGetAsPost DynamicJsonObject
DoGetCacheable DynamicJsonObject
DoPost DynamicJsonObject
FormatCreateUri System.Uri
FormatUpdateCollectionUri System.Uri
FormatUpdateUri System.Uri
GetFullyQualifiedRef string
GetFullyQualifiedUri System.Uri
GetFullyQualifiedV2xSchemaUri System.Uri
GetProcessedHeaders string>.Dictionary
GetSecuredUri System.Uri
GetSecurityToken string
ToQueryString string
UpdateCollection Rally.RestApi.Response.OperationResult

Public Methods

Method Description
AddToCollection ( string itemRef, string collectionName, List items, NameValueCollection parameters ) : OperationResult

Add items to a collection

Authenticate ( string username, string password, Uri serverUrl, WebProxy proxy = null, bool allowSSO = true ) : AuthenticationResult

Authenticates against Rally with the specified credentials

Authenticate ( string username, string password, string rallyServer = DEFAULT_SERVER, WebProxy proxy = null, bool allowSSO = true ) : AuthenticationResult

Authenticates against Rally with the specified credentials

AuthenticateWithApiKey ( string apiKey, Uri serverUrl, WebProxy proxy = null ) : AuthenticationResult

Authenticates against Rally with the specified credentials

AuthenticateWithApiKey ( string apiKey, string rallyServer = DEFAULT_SERVER, WebProxy proxy = null ) : AuthenticationResult

Authenticates against Rally with the specified credentials

AuthenticateWithZSessionID ( string userName, string zSessionID, string rallyServer = DEFAULT_SERVER, WebProxy proxy = null, bool allowSSO = true ) : AuthenticationResult

Authenticates against Rally with the specified credentials

Create ( string typePath, DynamicJsonObject obj ) : Rally.RestApi.Response.CreateResult

Create an object of the specified type from the specified object

Create ( string typePath, DynamicJsonObject obj, NameValueCollection parameters ) : Rally.RestApi.Response.CreateResult

Create an object of the specified type from the specified object

Create ( string workspaceRef, string typePath, DynamicJsonObject obj ) : Rally.RestApi.Response.CreateResult

Create an object of the specified type from the specified object

Delete ( string aRef ) : OperationResult

Delete the object described by the specified reference.

Delete ( string typePath, long oid ) : OperationResult

Delete the object described by the specified type and object id.

Delete ( string workspaceRef, string aRef ) : OperationResult

Delete the object described by the specified reference.

Delete ( string workspaceRef, string typePath, long oid ) : OperationResult

Delete the object described by the specified type and object id.

DownloadAttachment ( string relativeUrl ) : Rally.RestApi.Response.AttachmentResult

Downloads an attachment from Rally.

GetAllowedAttributeValues ( string typePath, string attributeName ) : QueryResult

Get the allowed values for the specified type and attribute

GetAttributesByType ( string type ) : QueryResult

Get the attribute definitions for the specified type

GetByReference ( string aRef ) : dynamic

Get the object described by the specified reference.

GetByReference ( string typePath, long oid ) : dynamic

Get the object described by the specified type and object id.

GetByReferenceAndWorkspace ( string aRef, string workspaceRef ) : dynamic

Get the object described by the specified reference scoped to the provided workspace.

GetCurrentUser ( ) : dynamic

Get the current user

GetSubscription ( ) : dynamic

Get the current subscription

GetTypes ( string queryString ) : Rally.RestApi.Response.CacheableQueryResult

Unsupported - DO NOT USE

Get the attribute definitions for the specified project or workspace (part of the query string). This uses an unpublished/unsupported endpoint and should NOT be used by non-Rally applications. This endpoint may alter behavior at any point in time.

Logout ( ) : void

Logs this API out from any connection to Rally and clears the authentication configuration.

Post ( String relativeUri, DynamicJsonObject data ) : DynamicJsonObject

Performs a post of data to the provided URI.

Query ( Request request ) : QueryResult

Perform a read against the WSAPI operation based on the data in the specified request

RallyRestApi ( ApiAuthManager authManger = null, string webServiceVersion = DEFAULT_WSAPI_VERSION, int maxRetries = 3, TraceFieldEnum traceInfo = RallyRestApi.DEFAULT_TRACE_FIELDS ) : System

Construct a new RallyRestApi configured to work with the specified WSAPI version

RemoveFromCollection ( string itemRef, string collectionName, List items, NameValueCollection parameters ) : OperationResult

Remove items from a collection

SetDefaultConnectionLimit ( ushort maxConnections ) : void

Sets the default maximum concurrent connection limit for this application. This will affect all connections that use Service Point.

Update ( string reference, DynamicJsonObject obj ) : OperationResult

Update the item described by the specified reference with the fields of the specified object

Update ( string reference, DynamicJsonObject obj, NameValueCollection parameters ) : OperationResult

Update the item described by the specified reference with the fields of the specified object

Update ( string typePath, string oid, DynamicJsonObject obj ) : OperationResult

Update the item described by the specified type and object id with the fields of the specified object

Update ( string typePath, string oid, DynamicJsonObject obj, NameValueCollection parameters ) : OperationResult

Update the item described by the specified type and object id with the fields of the specified object

Private Methods

Method Description
AuthenticateWithConnectionInfo ( ConnectionInfo connectionInfo, bool allowSSO ) : AuthenticationResult

Authenticates against Rally with the specified credentials

AuthenticateWithConnectionInfoBaseMethod ( ConnectionInfo connectionInfo, bool allowSSO, string &exceptionMessage ) : AuthenticationResult
CreateIdpAuthentication ( Uri idpServer, WebProxy proxy = null ) : void

Configures authentication to run against an IDP.

DecodeArrayList ( IEnumerable list ) : IEnumerable
DoDelete ( Uri uri, bool retry = true ) : DynamicJsonObject

Performs a delete action.

DoGet ( Uri uri, bool retry = true, int retryCounter = 1 ) : DynamicJsonObject

Performs a get action.

DoGetAsPost ( Request request, bool retry = true, int retryCounter = 1 ) : DynamicJsonObject

Performs get as a post action.

DoGetCacheable ( Uri uri, bool &isCachedResult ) : DynamicJsonObject

Gets a cacheable response.

DoPost ( Uri uri, DynamicJsonObject data, bool retry = true, int retryCounter = 1 ) : DynamicJsonObject

Performs a post action. If first action fails there will occur up to 10 retries each backing off an incrementing number of seconds (wait 1 second, retry, wait 2 seconds, retry, etc).

FormatCreateUri ( string typePath, NameValueCollection parameters ) : Uri
FormatUpdateCollectionUri ( bool isAdding, string itemRef, string collectionName, NameValueCollection parameters ) : Uri
FormatUpdateUri ( string typePath, string objectId, NameValueCollection parameters ) : Uri
GetFullyQualifiedRef ( string aRef ) : string

Ensure the specified ref is fully qualified with the full WSAPI URL

GetFullyQualifiedUri ( string aRef ) : Uri

Ensure the specified ref is fully qualified with the full WSAPI URL

GetFullyQualifiedV2xSchemaUri ( string aRef ) : Uri

Ensure the specified ref is fully qualified with the full WSAPI URL

GetProcessedHeaders ( ) : string>.Dictionary
GetSecuredUri ( Uri uri ) : Uri
GetSecurityToken ( ) : string

Gets a security token from Rally.

ToQueryString ( NameValueCollection parameters ) : string
UpdateCollection ( string itemRef, string collectionName, List items, NameValueCollection parameters, bool adding ) : OperationResult

Method Details

AddToCollection() public method

Add items to a collection
public AddToCollection ( string itemRef, string collectionName, List items, NameValueCollection parameters ) : OperationResult
itemRef string The ref of the object to update e.g. /defect/12345
collectionName string The name of the collection to be updated e.g. Tasks
items List The items to add. These can be references to existing objects or new objects to be created.
parameters System.Collections.Specialized.NameValueCollection additional query string parameters to be included on the request
return Rally.RestApi.Response.OperationResult

Authenticate() public method

Authenticates against Rally with the specified credentials
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Authenticate ( string username, string password, Uri serverUrl, WebProxy proxy = null, bool allowSSO = true ) : AuthenticationResult
username string The user name to be used for access
password string The password to be used for access
serverUrl System.Uri The Rally server to use (defaults to DEFAULT_SERVER)
proxy System.Net.WebProxy Optional proxy configuration
allowSSO bool Is SSO authentication allowed for this call? It can be useful to disable this during startup processes.
return AuthenticationResult

Authenticate() public method

Authenticates against Rally with the specified credentials
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Authenticate ( string username, string password, string rallyServer = DEFAULT_SERVER, WebProxy proxy = null, bool allowSSO = true ) : AuthenticationResult
username string The user name to be used for access
password string The password to be used for access
rallyServer string The Rally server to use (defaults to DEFAULT_SERVER)
proxy System.Net.WebProxy Optional proxy configuration
allowSSO bool Is SSO authentication allowed for this call? It can be useful to disable this during startup processes.
return AuthenticationResult

AuthenticateWithApiKey() public method

Authenticates against Rally with the specified credentials
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public AuthenticateWithApiKey ( string apiKey, Uri serverUrl, WebProxy proxy = null ) : AuthenticationResult
apiKey string The API key to be used for access
serverUrl System.Uri The Rally server to use (defaults to DEFAULT_SERVER)
proxy System.Net.WebProxy Optional proxy configuration
return AuthenticationResult

AuthenticateWithApiKey() public method

Authenticates against Rally with the specified credentials
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public AuthenticateWithApiKey ( string apiKey, string rallyServer = DEFAULT_SERVER, WebProxy proxy = null ) : AuthenticationResult
apiKey string The API key to be used for access
rallyServer string The Rally server to use (defaults to DEFAULT_SERVER)
proxy System.Net.WebProxy Optional proxy configuration
return AuthenticationResult

AuthenticateWithZSessionID() public method

Authenticates against Rally with the specified credentials
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public AuthenticateWithZSessionID ( string userName, string zSessionID, string rallyServer = DEFAULT_SERVER, WebProxy proxy = null, bool allowSSO = true ) : AuthenticationResult
userName string The user name to be used for access
zSessionID string The ZSessionID to be used for access. This would have been provided by Rally on a previous call.
rallyServer string The Rally server to use (defaults to DEFAULT_SERVER)
proxy System.Net.WebProxy Optional proxy configuration
allowSSO bool Is SSO authentication allowed for this call? It can be useful to disable this during startup processes.
return AuthenticationResult

Create() public method

Create an object of the specified type from the specified object
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Create ( string typePath, DynamicJsonObject obj ) : Rally.RestApi.Response.CreateResult
typePath string the type to be created
obj DynamicJsonObject the object to be created
return Rally.RestApi.Response.CreateResult

Create() public method

Create an object of the specified type from the specified object
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Create ( string typePath, DynamicJsonObject obj, NameValueCollection parameters ) : Rally.RestApi.Response.CreateResult
typePath string the type to be created
obj DynamicJsonObject the object to be created
parameters System.Collections.Specialized.NameValueCollection additional parameters to include in the create request
return Rally.RestApi.Response.CreateResult

Create() public method

Create an object of the specified type from the specified object
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Create ( string workspaceRef, string typePath, DynamicJsonObject obj ) : Rally.RestApi.Response.CreateResult
workspaceRef string the workspace into which the object should be created. Null means that the server will pick a workspace.
typePath string the type to be created
obj DynamicJsonObject the object to be created
return Rally.RestApi.Response.CreateResult

Delete() public method

Delete the object described by the specified reference.
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Delete ( string aRef ) : OperationResult
aRef string the reference
return Rally.RestApi.Response.OperationResult

Delete() public method

Delete the object described by the specified type and object id.
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Delete ( string typePath, long oid ) : OperationResult
typePath string the type
oid long the object id
return Rally.RestApi.Response.OperationResult

Delete() public method

Delete the object described by the specified reference.
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Delete ( string workspaceRef, string aRef ) : OperationResult
workspaceRef string the workspace from which the object will be deleted. Null means that the server will pick a workspace.
aRef string the reference
return Rally.RestApi.Response.OperationResult

Delete() public method

Delete the object described by the specified type and object id.
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Delete ( string workspaceRef, string typePath, long oid ) : OperationResult
workspaceRef string the workspace from which the object will be deleted. Null means that the server will pick a workspace.
typePath string the type
oid long the object id
return Rally.RestApi.Response.OperationResult

DownloadAttachment() public method

Downloads an attachment from Rally.
public DownloadAttachment ( string relativeUrl ) : Rally.RestApi.Response.AttachmentResult
relativeUrl string The relative URL to the attachment.
return Rally.RestApi.Response.AttachmentResult

GetAllowedAttributeValues() public method

Get the allowed values for the specified type and attribute
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public GetAllowedAttributeValues ( string typePath, string attributeName ) : QueryResult
typePath string the type
attributeName string the attribute to retrieve allowed values for
return QueryResult

GetAttributesByType() public method

Get the attribute definitions for the specified type
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public GetAttributesByType ( string type ) : QueryResult
type string The type to get attributes for
return QueryResult

GetByReference() public method

Get the object described by the specified reference.
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally. Occurs if authentication is not completed prior to calling this method. Occurs if the passed in aRef parameter is null.
public GetByReference ( string aRef ) : dynamic
aRef string the reference
return dynamic

GetByReference() public method

Get the object described by the specified type and object id.
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally. Occurs if authentication is not completed prior to calling this method.
public GetByReference ( string typePath, long oid ) : dynamic
typePath string the type
oid long the object id
return dynamic

GetByReferenceAndWorkspace() public method

Get the object described by the specified reference scoped to the provided workspace.
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public GetByReferenceAndWorkspace ( string aRef, string workspaceRef ) : dynamic
aRef string the reference
workspaceRef string workspace scope
return dynamic

GetCurrentUser() public method

Get the current user
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public GetCurrentUser ( ) : dynamic
return dynamic

GetSubscription() public method

Get the current subscription
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public GetSubscription ( ) : dynamic
return dynamic

GetTypes() public method

Unsupported - DO NOT USE

Get the attribute definitions for the specified project or workspace (part of the query string). This uses an unpublished/unsupported endpoint and should NOT be used by non-Rally applications. This endpoint may alter behavior at any point in time.
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public GetTypes ( string queryString ) : Rally.RestApi.Response.CacheableQueryResult
queryString string The query string to get types for
return Rally.RestApi.Response.CacheableQueryResult

Logout() public method

Logs this API out from any connection to Rally and clears the authentication configuration.
public Logout ( ) : void
return void

Post() public method

Performs a post of data to the provided URI.
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Post ( String relativeUri, DynamicJsonObject data ) : DynamicJsonObject
relativeUri String The relative URI to post the data to.
data DynamicJsonObject The data to submit to Rally.
return DynamicJsonObject

Query() public method

Perform a read against the WSAPI operation based on the data in the specified request
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Query ( Request request ) : QueryResult
request Request The request configuration
return QueryResult

RallyRestApi() public method

Construct a new RallyRestApi configured to work with the specified WSAPI version
public RallyRestApi ( ApiAuthManager authManger = null, string webServiceVersion = DEFAULT_WSAPI_VERSION, int maxRetries = 3, TraceFieldEnum traceInfo = RallyRestApi.DEFAULT_TRACE_FIELDS ) : System
authManger Rally.RestApi.Auth.ApiAuthManager The authorization manager to use when authentication requires it. If no driver is /// provided a console authentication manager will be used which does not allow SSO authentication.
webServiceVersion string The WSAPI version to use (defaults to DEFAULT_WSAPI_VERSION)
maxRetries int Requests will be attempted a number of times (defaults to 3)
traceInfo TraceFieldEnum Controls diagnostic trace information being logged
return System

RemoveFromCollection() public method

Remove items from a collection
public RemoveFromCollection ( string itemRef, string collectionName, List items, NameValueCollection parameters ) : OperationResult
itemRef string The ref of the object to update e.g. /defect/12345
collectionName string The name of the collection to be updated e.g. Tasks
items List The items to remove.
parameters System.Collections.Specialized.NameValueCollection additional query string parameters to be included on the request
return Rally.RestApi.Response.OperationResult

SetDefaultConnectionLimit() public static method

Sets the default maximum concurrent connection limit for this application. This will affect all connections that use Service Point.
public static SetDefaultConnectionLimit ( ushort maxConnections ) : void
maxConnections ushort The maximum number of concurrent connections. Allowed values are between 1 and 25.
return void

Update() public method

Update the item described by the specified reference with the fields of the specified object
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Update ( string reference, DynamicJsonObject obj ) : OperationResult
reference string the reference to be updated
obj DynamicJsonObject the object fields to update
return Rally.RestApi.Response.OperationResult

Update() public method

Update the item described by the specified reference with the fields of the specified object
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Update ( string reference, DynamicJsonObject obj, NameValueCollection parameters ) : OperationResult
reference string the reference to be updated
obj DynamicJsonObject the object fields to update
parameters System.Collections.Specialized.NameValueCollection additional query string parameters to be included on the request
return Rally.RestApi.Response.OperationResult

Update() public method

Update the item described by the specified type and object id with the fields of the specified object
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Update ( string typePath, string oid, DynamicJsonObject obj ) : OperationResult
typePath string the type of the item to be updated
oid string the object id of the item to be updated
obj DynamicJsonObject the object fields to update
return Rally.RestApi.Response.OperationResult

Update() public method

Update the item described by the specified type and object id with the fields of the specified object
Rally returned an HTML page. This usually occurs when Rally is off-line. Please check the ErrorMessage property for more information. The JSON returned by Rally was not able to be deserialized. Please check the JsonData property for what was returned by Rally.
public Update ( string typePath, string oid, DynamicJsonObject obj, NameValueCollection parameters ) : OperationResult
typePath string the type of the item to be updated
oid string the object id of the item to be updated
obj DynamicJsonObject the object fields to update
parameters System.Collections.Specialized.NameValueCollection additional query string parameters to be include on the request
return Rally.RestApi.Response.OperationResult