Skip to content

Luminesce OpenAPI generated C# client SDK - Luminesce is a data virtualisation service (query data from and input to multiple sources, including LUSID).

License

Notifications You must be signed in to change notification settings

finbourne/luminesce-sdk-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LUSID_by_Finbourne

C# SDK for the FINBOURNE Luminesce Web API

Contents

Summary

This is the C# SDK for the FINBOURNE Luminesce Web API, part of the LUSID by FINBOURNE platform. To use it you'll need a LUSID account - sign up for free at lusid.com.

Luminesce is a SQL-based data virtualisation service (read/write data to multiple sources, including LUSID) - see https://support.lusid.com/knowledgebase/article/KA-01677/ to learn more.

For more details on other applications in the LUSID platform, see Understanding all the applications in the LUSID platform.

This sdk supports Production, Early Access, Beta and Experimental API endpoints. For more details on API endpoint categories, see What is the LUSID feature release lifecycle. To find out which category an API endpoint falls into, see the swagger page.

This code is automatically generated by the OpenAPI Generator project.

Versions

  • API version: 1.16.823
  • SDK version: 2.0.0

Requirements

  • net6.0+

Installation

The NuGet package for the FINBOURNE Luminesce Web API SDK can installed from https://www.nuget.org/packages/Finbourne.Luminesce.Sdk using the following

$ dotnet add package Finbourne.Luminesce.Sdk

Getting Started

You'll need to provide some configuration to connect to the FINBOURNE Luminesce Web API - see the articles about short-lived access tokens and a long-lived Personal Access Token. This configuration can be provided using a secrets file or environment variables.

For some configuration it is also possible to override the global configuration at the ApiFactory level, or at the request level. For the set of configuration which can be overridden, please see ConfigurationOptions. For a code illustration of this configuration being overridden, please see the example.

Environment variables

Required for a short-lived access token

FBN_TOKEN_URL
FBN_LUMINESCE_URL
FBN_USERNAME
FBN_PASSWORD
FBN_CLIENT_ID
FBN_CLIENT_SECRET

Required for a long-lived access token

FBN_LUMINESCE_URL
FBN_ACCESS_TOKEN

You can send your requests to the FINBOURNE Luminesce Web API via a proxy, by setting FBN_PROXY_ADDRESS. If your proxy has basic auth enabled, you must also set FBN_PROXY_USERNAME and FBN_PROXY_PASSWORD.

Other optional configuration

# the sdk client timeout in milliseconds, the default is 1800000 (30 minutes)
# values must be between 1 and 2147483647
# please note - the chances of seeing a network issue increases with the duration of the request
# for this reason, rather than increasing the timeout, it will be more reliable to use an alternate polling style endpoint where these exist
FBN_TIMEOUT_MS
# the retries when being rate limited, the default is 2
FBN_RATE_LIMIT_RETRIES

Secrets file

The secrets file must be in the current working directory. By default the SDK looks for a secrets file called secrets.json

Required for a short-lived access token

{
    "api":
    {
        "tokenUrl":"<your-token-url>",
        "luminesceUrl":"https://<your-domain>.lusid.com/honeycomb",
        "username":"<your-username>",
        "password":"<your-password>",
        "clientId":"<your-client-id>",
        "clientSecret":"<your-client-secret>"
    }
}

Required for a long-lived access token

{
    "api":
    {
        "luminesceUrl":"https://<your-domain>.lusid.com/honeycomb",
        "accessToken":"<your-access-token>"
    }
}

You can send your requests to the FINBOURNE Luminesce Web API via a proxy, by adding a proxy section. If your proxy has basic auth enabled, you must also supply a username and password in this section.

{
    "api":
    {
        "luminesceUrl":"https://<your-domain>.lusid.com/honeycomb",
        "accessToken":"<your-access-token>"
    },
    "proxy":
    {
        "address":"<your-proxy-address>",
        "username":"<your-proxy-username>",
        "password":"<your-proxy-password>"
    }
}

Other optional configuration

{
    "api": 
    {
        // the sdk client timeout in milliseconds, the default is 1800000 (30 minutes)
        // values must be between 1 and 2147483647
        // please note - the chances of seeing a network issue increases with the duration of the request
        // for this reason, rather than increasing the timeout, it will be more reliable to use an alternate polling style endpoint where these exist
        "timeoutMs":"<timeout-in-ms>",
        // the retries when being rate limited, the default is 2
        "rateLimitRetries":<retries-when-being-rate-limited>
    }
}

Example

using System.Collections.Generic;
using Finbourne.Luminesce.Sdk.Api;
using Finbourne.Luminesce.Sdk.Client;
using Finbourne.Luminesce.Sdk.Extensions;
using Finbourne.Luminesce.Sdk.Model;
using Newtonsoft.Json;

namespace Examples
{
    public static class Program
    {
        public static void Main()
        {
            var secretsFilename = "secrets.json";
            var path = Path.Combine(Directory.GetCurrentDirectory(), secretsFilename);
            // Replace with the relevant values
            File.WriteAllText(
                path, 
                @"{
                    ""api"": {
                        ""tokenUrl"": ""<your-token-url>"",
                        ""luminesceUrl"": ""https://<your-domain>.lusid.com/honeycomb"",
                        ""username"": ""<your-username>"",
                        ""password"": ""<your-password>"",
                        ""clientId"": ""<your-client-id>"",
                        ""clientSecret"": ""<your-client-secret>""
                    }
                }");

            // uncomment the below to use configuration overrides
            // var opts = new ConfigurationOptions();
            // opts.TimeoutMs = 30_000;

            // uncomment the below to use an api factory with overrides
            // var apiInstance = ApiFactoryBuilder.Build(secretsFilename, opts: opts).Api<ApplicationMetadataApi>();

            var apiInstance = ApiFactoryBuilder.Build(secretsFilename).Api<ApplicationMetadataApi>();

            try
            {
                // uncomment the below to set overrides at the request level
                // ResourceListOfAccessControlledResource result = apiInstance.GetServicesAsAccessControlledResources(opts: opts);

                // GetServicesAsAccessControlledResources: Get resources available for access control
                ResourceListOfAccessControlledResource result = apiInstance.GetServicesAsAccessControlledResources();
                Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));
            }
            catch (ApiException e)
            {
                Console.WriteLine("Exception when calling ApplicationMetadataApi.GetServicesAsAccessControlledResources: " + e.Message);
                Console.WriteLine("Status Code: " + e.ErrorCode);
                Console.WriteLine(e.StackTrace);
            }
        }
    }
}

Endpoints and models

About

Luminesce OpenAPI generated C# client SDK - Luminesce is a data virtualisation service (query data from and input to multiple sources, including LUSID).

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages