Package: lusid-scheduler-sdk
lusid-scheduler-sdkFINBOURNE TechnologyThis Python package is automatically generated by theOpenAPI Generatorproject:API version: 0.0.856Package version: 2.0.13Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visithttps://www.finbourne.comRequirements.Python 3.7+Installation & Usagepip installIf the python package is hosted on a repository, you can install directly using:pipinstallgit+https://github.com/finbourne/scheduler-sdk-python.git(you may need to runpipwith root permission:sudo pip install git+https://github.com/finbourne/scheduler-sdk-python.git)Then import the package:importlusid_schedulerSetuptoolsInstall viaSetuptools.pythonsetup.pyinstall--user(orsudo python setup.py installto install the package for all users)Then import the package:importlusid_schedulerTestsExecutepytestto run the tests.Getting StartedYou'll need to provide some configuration to connect to the lusid_scheduler application.
These can be provided using a secrets file or environment variables.Environment variablesIn order to useshort lived access tokensyou will need to have appropriate values set for the following environment variables:FBN_TOKEN_URL,
FBN_LUSID_SCHEDULER_API_URL,
FBN_USERNAME,
FBN_PASSWORD,
FBN_CLIENT_ID,
FBN_CLIENT_SECRET,
FBN_ACCESS_TOKENTo use a long lived Personal Access Token, you must provide the following environment variables:FBN_LUSID_SCHEDULER_API_URL,
FBN_ACCESS_TOKENYou can send your requests to lusid_scheduler via a proxy, by settingFBN_PROXY_ADDRESS.
If your proxy has basic auth enabled, you must akso supplyFBN_PROXY_USERNAMEandFBN_PROXY_PASSWORDSecrets fileIn order to useshort lived access tokensyou will need to have appropriate values set in asecrets.jsonfile in the same folder as your script.{
    "api":
    {
        "tokenUrl":"<your-token-url>",
        "lusid_schedulerUrl":"<FINBOURNE-application-url>",
        "username":"<your-username>",
        "password":"<your-password>",
        "clientId":"<your-client-id>",
        "clientSecret":"<your-client-secret>",
    }
}To use a long lived Personal Access Token, you must provide asecrets.jsonwith the following variables:{
    "api":
    {
        "lusid_schedulerUrl":"<FINBOURNE-application-url>",
        "accessToken":"<your-access-token>"
    }
}You can send your requests to lusid_scheduler via a proxy, by adding a proxy section to yoursecrets.json.
If your proxy has basic auth enabled, you must also supply ausernameandpasswordin this section.{
    "api":
    {
        "lusid_schedulerUrl":"<FINBOURNE-application-url>",
        "accessToken":"<your-access-token>"
    },
    "proxy":
    {
        "address":"<your-proxy-address>",
        "username":"<your-proxy-username>",
        "password":"<your-proxy-password>"
    }
}Using the SDKPlease follow theinstallation procedureand then run the following:importtimeimportlusid_schedulerfromlusid_scheduler.exceptionsimportApiExceptionfrompprintimportpprintimportosfromlusid_schedulerimport(ApiClientFactory,ApplicationMetadataApi,EnvironmentVariablesConfigurationLoader,SecretsFileConfigurationLoader,ArgsConfigurationLoader)# Use the lusid_scheduler ApiClientFactory to build Api instances with a configured api client# By default this will read config from environment variables# Then from a secrets.json file found in the current working directoryapi_client_factory=ApiClientFactory()# The ApiClientFactory can be passed an iterable of configuration loaders to read configuration fromapi_url="https://fbn-prd.lusid.com/scheduler2"# Path to a secrets.json file containing authentication credentials# See https://support.lusid.com/knowledgebase/article/KA-01667/en-us# for a detailed guide to setting up the SDK make authenticated calls to LUSID APIssecrets_path=os.getenv("FBN_SECRETS_PATH")app_name="LusidJupyterNotebook"config_loaders=[EnvironmentVariablesConfigurationLoader(),SecretsFileConfigurationLoader(api_secrets_file=secrets_path),ArgsConfigurationLoader(api_url=api_url,app_name=app_name)]api_client_factory=ApiClientFactory(config_loaders=config_loaders)# The client must configure the authentication and authorization parameters# in accordance with the API server security policy.# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after useasyncwithapi_client_factory:# Create an instance of the API classapi_instance=api_client_factory.build(ApplicationMetadataApi)try:# [EXPERIMENTAL] ListAccessControlledResources: Get resources available for access controlapi_response=awaitapi_instance.list_access_controlled_resources()print("The response of ApplicationMetadataApi->list_access_controlled_resources:\n")pprint(api_response)exceptApiExceptionase:print("Exception when calling ApplicationMetadataApi->list_access_controlled_resources:%s\n"%e)Documentation for API EndpointsAll URIs are relative tohttps://fbn-prd.lusid.com/scheduler2ClassMethodHTTP requestDescriptionApplicationMetadataApilist_access_controlled_resourcesGET/api/metadata/access/resources[EXPERIMENTAL] ListAccessControlledResources: Get resources available for access controlImagesApidelete_imageDELETE/api/images/{name}[EXPERIMENTAL] DeleteImage: Delete a Docker ImageImagesApidownload_imageGET/api/images/{name}/contents[EXPERIMENTAL] DownloadImage: Download Docker ImageImagesApiget_imageGET/api/images/{name}[EXPERIMENTAL] GetImage: Get metadata of a Docker ImageImagesApilist_imagesGET/api/images/repository/{name}[EXPERIMENTAL] ListImages: List all images under same image repositoryImagesApilist_repositoriesGET/api/images/repository[EXPERIMENTAL] ListRepositories: List all Docker image repositoriesImagesApiupload_imagePOST/api/images[EXPERIMENTAL] UploadImage: Upload a Docker Image used for Scheduler jobsJobsApicreate_jobPOST/api/jobs[EXPERIMENTAL] CreateJob: Create a new jobJobsApidelete_jobDELETE/api/jobs/{scope}/{code}[EXPERIMENTAL] DeleteJob: Delete a jobJobsApiget_historyGET/api/jobs/history[EXPERIMENTAL] GetHistory: Get the history of job runsJobsApiget_job_console_outputGET/api/jobs/history/{runId}/console[EXPERIMENTAL] GetJobConsoleOutput: Gets the console output of a specific job runJobsApiget_run_historyGET/api/jobs/history/{runId}[EXPERIMENTAL] GetRunHistory: Get the history for a single job runJobsApiget_schedules_for_a_jobGET/api/jobs/{scope}/{code}/schedules[EXPERIMENTAL] GetSchedulesForAJob: Get all the schedules for a single jobJobsApilist_jobsGET/api/jobs[EXPERIMENTAL] ListJobs: List the available jobsJobsApirun_jobPOST/api/jobs/{scope}/{code}/$run[EXPERIMENTAL] RunJob: Run a job immediatelyJobsApiupdate_jobPUT/api/jobs/{scope}/{code}[EXPERIMENTAL] UpdateJob: Update a JobDefinitionSchedulesApicreate_schedulePOST/api/schedules[EXPERIMENTAL] CreateSchedule: Create a Schedule for a jobSchedulesApidelete_scheduleDELETE/api/schedules/{scope}/{code}[EXPERIMENTAL] DeleteSchedule: Delete a scheduleSchedulesApienabled_schedulePUT/api/schedules/{scope}/{code}/enabled[EXPERIMENTAL] EnabledSchedule: Enable/disable a scheduleSchedulesApiget_scheduleGET/api/schedules/{scope}/{code}[EXPERIMENTAL] GetSchedule: Get a single ScheduleSchedulesApilist_schedulesGET/api/schedules[EXPERIMENTAL] ListSchedules: List the available SchedulesSchedulesApirun_schedulePOST/api/schedules/{scope}/{code}/$run[EXPERIMENTAL] RunSchedule: Run a schedule immediatelySchedulesApiupdate_schedulePUT/api/schedules/{scope}/{code}[EXPERIMENTAL] UpdateSchedule: Update a schedule.Documentation For ModelsAccessControlledActionAccessControlledResourceActionIdArgumentDefinitionCreateJobRequestCreateScheduleRequestIdSelectorDefinitionIdentifierPartSchemaImageImageSummaryJobDefinitionJobHistoryJobRunResultLinkLusidProblemDetailsLusidValidationProblemDetailsNotificationRepositoryRequiredResourcesResourceIdResourceListOfAccessControlledResourceResourceListOfImageSummaryResourceListOfJobDefinitionResourceListOfJobHistoryResourceListOfRepositoryResourceListOfScheduleDefinitionScanReportScanSummaryScheduleDefinitionStartJobRequestStartJobResponseStartScheduleResponseTagTimeTriggerTriggerUpdateJobRequestUpdateScheduleRequestUploadImageInstructionsUploadImageRequestVulnerabilityDocumentation For AuthorizationAuthentication schemes defined for the API:oauth2Type: OAuthFlow: implicitAuthorization URL:https://lusid.okta.com/oauth2/default/v1/authorizeScopes: N/AAuthorinfo@finbourne.com