Click or drag to resize

IWsJelasticGetJelasticAccounts Method

Get a list of all active Jelastic accounts associated to the authenticated user.

Namespace:  Aruba.Cloud.WsJelastic
Assembly:  WsJelastic (in WsJelastic.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<List<JelasticAccount>> GetJelasticAccounts()

Return Value

Type: WsResultListJelasticAccount
List of JelasticAccount objects containing accounts informations.
Examples
The following example retrieve the logged user's Jelastic accounts list. The user is passed by client.ClientCredentials object.
public ArubaWsJelastic.JelasticAccount[] GetJelasticAccounts()
{
    using (var client = this.WsJelasticClient)
    {
        var result = client.GetJelasticAccounts();

        //result.Success is true on Success, false on failure
        if (result.Success)
            return result.Value;
        else
        {
            this.LogError("GetJelasticAccounts", result);
            throw new CodedException(this.GetErrorCode(result.ResultCode), result.ResultMessage);
        }
    }
}

//the definition of WsJelasticClient:
private WsJelasticClient WsJelasticClient
{
    get
    {
        var client = Wrappers.WsJelasticClientFactory.CreateClientWithBehavior();
        //this credentials will specify wich list of account will be retreived:
        client.ClientCredentials.UserName.UserName = this.AuthCredentials.UserName;
        client.ClientCredentials.UserName.Password = this.AuthCredentials.Password;

        return client;
    }
}
See Also