When and how should DAPI and SAPI be used? - server

I`m totally new to Bloomberg and using Bloomberg api in python/flask
I tried to read all the documentation provided by the windows SDK
I understand that DAPI is only for local applications using localhost and default port
but actually I am confused about the usage of SAPI Installation and usage...
First:
after installing sapi on machine with bloomberg terminal and letting the sapi process up , I will write an application by python code that import blbapi and use the sapi
should this application be on the same machine , or it can be on another machine and give it the ip and port of the sapi process and should the other machine have bloomberg terminal too?
second:
what about the client side, any browser which open this application should the clients have bloomberg terminal too??
Excuse my naive question ..
Thanx in advance

Python application machine doesn't have to have a Bloomberg terminal installed. You will only need Bloomberg libraries installed (but not terminal) software.
You need to provide "ip of terminal pc" + "uuid" when making a connection to SAPI.
Also, the user/terminal must be logged in.
Check and be very careful with licensing. You can try asking your account manager.
Don't take this as licensing advice, but different exchanges and data sources can have different rules around the data so it depends what data you pulling. As I understand the data pulled by a user/script is for that specific terminal owner only.
Different terminal "owners" with the same access might not be allowed to see the data pulled by other scripts/users.

SAPI allows you to use BBG data off the machine where the user is logged in HOWEVER this data can not be viewed by anyone but the logged in user - for legal reasons rather than technical ones.
The typical use case for SAPI is there complicated calculatios (be it exotic pricing or realtime portfolio risk) is being performed that aren't practical on the desktop.
Be aware that all BBG data and calculations are tied to the user, the data can't be given to anyone else...

Related

How to replicate a postgresql database from local to web server

I am new in the form and also new in postgresql.
Normally I use MySQL for my project but I’ve decided to start migrating towards postgresql for some valid reasons which I found in this database.
Expanding on the problem:
I need to analyze data via some mathematical formulas but in order to do this I need to get the data from the software via the API.
The software, the API and Postgresql v. 11.4 which I installed on a desktop are running on windows. So far I’ve managed to take the data via the API and import it into Postgreql.
My problem is how to transfer this data from
the local Postgresql (on the PC ) to a web Postgresql (installed in a Web server ) which is running Linux.
For example if I take the data every five minutes from software via API and put it in local db postgresql, how can I transfer this data (automatically if possible) to the db in the web server running Linux? I rejected a data dump because importing the whole db every time is not viable.
What I would like is to import only the five-minute data which gradually adds to the previous data.
I also rejected the idea of making a master - slave architecture
because not knowing the total amount of data, on the web server I have almost 2 Tb of hard disk while on the local pc I have only one hard disk that serves only to take the data and then to send it to the web server for the analysis.
Could someone please help by giving some good advice regarding how to achieve this objective?
Thanks to all for any answers.

Installing Ravendb on the Raspberry Pi

I'm currently trying to install Ravendb 4.1.5-patch-41012 for the Raspberry Pi on my Raspberry Pi 3 Model B running Raspbian Stretch Lite. When I run the run.sh script it will give an error about not being able to open a browser even if I set the Setup.Mode in the settings to none. After that I'm able to run server commands but I'm not able to access Ravendb studio and the Ravendb server locally or using my local network. Are there extra steps I have to take and or thing I have to keep in mind when installing Ravendb on the Raspberry Pi?
Raspbian Stretch Lite doesn't equipped with local web browser, therefor you may need to give outside access before using web setup. In the following link you can find description on the Server's configuration: https://ravendb.net/docs/article-page/4.1/csharp/server/configuration/configuration-options
Modify Server/settings.json in a way it fits your security needs, as follows (Replace 10.0.0.90 with your Pie's IP)
Totally unsecured access from anywhere (ATTENTION: This will give access to the database to any one with access to this docker instance):
{
"ServerUrl": "http://0.0.0.0:8080",
"PublicServerUrl": "http://10.0.0.90:8080",
"Setup.Mode": "None",
"Security.UnsecuredAccessAllowed": "PublicNetwork",
}
Access from docker's host machine or other machines on you local LAN:
{
"ServerUrl": "http://10.0.0.90:8080",
"Setup.Mode": "None",
"PublicServerUrl": "http://10.0.0.90:8080",
"Security.UnsecuredAccessAllowed": "PrivateNetwork",
"License.Eula.Accepted": true
}
Browsing to http://10.0.0.90:8080 should work at this point.
You can use cli, read : https://ravendb.net/docs/article-page/4.1/Csharp/server/configuration/command-line-arguments
Example:
cd ~/RavenDB/Server
./Raven.Server --Security.UnsecuredAccessAllowed=PublicNetwork --ServerUrl=http://0.0.0.0:8080 --PublicServerUrl=http://10.0.0.90:8080 --Setup.Mode="None" --DataDir=/mnt/ExternalDisk/RavenDB
As a side note: I do recommend to set "DataDir" to external mounted USB disk, rather then using the default SD card data path, if this is your case.
And later on you may want to use scripts for adding RavenDB as service on your Pie (see install-daemon.sh here : https://github.com/ravendb/ravendb/tree/v4.2/scripts/linux)
The run.sh is trying to start a browser the first time you start RavenDB to give you access to it. Given that you are running the Lite version, there is no such browser, obviously.
See Adi's comment on how to access RavenDB from outside the Pi machine.
You can just call server/Raven.Server instead of the run.sh instead to start RavenDB

How can we access Bluemix hosted "Compose for MongoDB" service from "outside"?

Situation:
Have created today a new Compose for MongoDB Service instance in Bluemix
Need:
I have to access this MongoDB DIRECTLY with tools (eg. Mongo Managemant Studio Pro, mongo.exe, etc.) for bulkloading, testing, ad-hoc data fix, etc.
Problem:
I have not found any docs, samples nor a CLEAR statement that
a) gives me some confirmation that THIS is possible
b) gives me COMPLETE information (not just some technical fragments that might have worked year ago) how to do it.
Maybe I am looking to the wrong places or do not know the right people. However I am stuck on this, and before quitting Bluemix MongoDB maybe somebody has a copy/past solution or handson step by step manual.
Any help welcome. Thanks!
Connecting to MongoDB service in Bluemix from an application is possible. For this answer I have used the application "Robo3T" and here are the steps:
Access your MongoDB Service on you Bluemix account. Usually under
"Cloud Foundry Services"
Open section "Manage", from "Connection Settings" copy from "HTTPS" the connection address and port. In this example "sl-eu-lon-2-portal.5.dblayer.com" and "20651"
In Robo3T create a new connection with the connection address from previous step
In tab Authentication configure database name, username and password
. The credentials are found as in step 1
From "Connection Settings" copy the SSL Certificate into a text file and save locally.
In Robo3T Add the certificate to the connection in the "SSL" tab
Test the connection and save the settings
Answer
YES, Bluemix hosted Compose for MongoDB instances can be connected from the mongo Shell and some updated DB Managment tools.
However, you have to make sure, that in case you are running the newest DB versions, that your tools (shell and DB management GUIs) comply with the newest DB features such as encryption etc.
Origin of the Problem
My problem was due to older and therefore incompatible versions of the mongo shell and DB-managment tools running against the newest MongoDB versions with their specialities on encription and multiple servers to be handled in the URI.
At least two DB managment tools are not compatible with the newest DB version and will take their time to get fixed. The problem is, that both will not tell you about this. They just do not not connect. No logs on either side. Period.
So my advise here: look for tool providers who express dedicated compliance with the specific version of your DB.
Advise to the Bluemix Team
It might not take much time to provide some sample connection strings for the most common tools like the mongo shell, MongoBooster, etc. to take the hassle and guesswork out of interpreting the Environment variables and figuring out what is needed for specific connection strings and what is not.
For instance MongoDB Atlas hosting provides for every cluster readymade connection strings for many tools you can just copy/past and done!
Connecting to Atlas took me 5 Minutes. For Bluemix I have lost hours! Not because it is complex, but because the documentation and the generated Info is somehow incomplete and messy - at least for the ones who do not connection strings for their living!

Remote execute Power Shell scripts to collect data

I am looking to collect data snapshot on a random interval from various machines in our network that we don't own, but may get access to install an agent to collect these data.
These machines are either in a domain or work-group and kind of data i get are based on the role they play and information they have. The machines are "Windows Server 2003" and above and I do not want to install anything on those machines before i get started, so thought I can use the PowerShell scripts that I can remote invoke form my server and pass the script it has to run to return the data.
I was wondering if this is possible to do that with the PowerShell scripts and as this is supposed to run in a secure environment, is there any major security implications with this approach. i.e. do I need to do anything on the client machines that can make them vulnerable to security threats.
BTW these machines are not exposed to internet and are behind a firewall.
I would appreciate if you point me to any other alternatives that can be useful for my analysis.
Regards
Kiran

connecting from Linux to windows without logging off the current user on windows

what I'm trying to achieve is to log from linux to a windows machine which is already being used by one user who should not be logged off and the system should be working with both the users simultaneaously .I'm using krdc to connect to windows machine from linux,which logs off the user when other user logs in.Is there any other way to achieve my intension.
Thanks and Regards
You need to have the real Terminal Services installed. Usually the windows (Home,Professional, etc) can be enabled to have Terminal services but only for a 1 single session. If you install Terminal Services you will need to pay the license for users.
To allow multiple connection you should use VNC/teamviewer (is the most simple way to achieve what you want).