Passing Data Source Connection value through URL in Cognos 10.x - datasource

I have a data source with multiple connections.I need to pass Data source connection as a parameter in the URL to select the connection at run time. Currently I get a prompt page for choosing the connection value. I don't want the prompt page to appear, Instead it should take the connection value from URL and continue running the report.
My current connection format as below.
http://cognos.server/cognos/cgi-bin/cognos.cgi?b_action=cognosViewer&
ui.action=run&ui.object=ui_object&p_credential:dataSourcename:password=<credential><dataSourceConnection>CAMID(":")/dataSource[#name='datasourcename']/dataSourceConnection[#name='datasourceconnectionname']</dataSourceConnection><dataSourceSignon/><username>xxxx</username><password>yyy</password></credential>&run.outputFormat=&run.prompt=false
I would appreciate if any help on this?

You are on the right track.. you just need to encode your <, >, ", [, ], and '.
http://cognos.server/cognos/cgi-bin/cognos.cgi?b_action=cognosViewer&ui.action=run&ui.object=ui_object&run.outputFormat=&run.prompt=false&p_credential:dataSourcename:password=%3Ccredential%3E%3CdataSourceConnection%3ECAMID(%22:%22)/dataSource%5B#name=%27datasourcename%27%5D/dataSourceConnection%5B#name=%27datasourceconnectionname%27%5D%3C/dataSourceConnection%3E%3CdataSourceSignon/%3E%3Cusername%3Exxxx%3C/username%3E%3Cpassword%3Eyyy%3C/password%3E%3C/credential%3E
or with variables
http://cognos.server/cognos/cgi-bin/cognos.cgi?b_action=cognosViewer&ui.action=run&ui.object=ui_object&run.outputFormat=&run.prompt=false&p_credential:" + dataSourcename + ":password=%3Ccredential%3E%3CdataSourceConnection%3ECAMID(%22:%22)/dataSource%5B#name=%27" + datasourcename + "%27%5D/dataSourceConnection%5B#name=%27" + datasourceconnectionname + "%27%5D%3C/dataSourceConnection%3E%3CdataSourceSignon/%3E%3Cusername%3E" + username + "%3C/username%3E%3Cpassword%3E" + password +"%3C/password%3E%3C/credential%3E

Related

How to right the path in app.get function on rest api when my sql query has to select by two elements from the table?

i'am very new in android apps developping,
I am trying to do an authentification on my app using rest api but i could'nt wright the right path on my function "app.get"
app.get('/getPatient2/:id_patient/',function(req,res){
var query = "select * from Patient where id_patient = " + req.params.id_patient ;
connection.query(query,function(error,results){
if (error) throw error;
res.send(results);
})
});
Well, when i test on my browser using the path :
http://localhost:8082/getPatient2/1
it shows the results normally but that's not what i need in the authetification, it shoud be by phone number and passsword which means :
app.get('/xxxxx',function(req,res){
var query = "select * from Patient where phone_patient =" + req.params.tel + "and paasword=" +
req.params.pass;
connection.query(query,function(error,results){
if (error) throw error;
res.send(results);
})
});
i tried many pathes but i get always an error , i searched a lot for documentation but i didn't find any example having a query with "and"
I really hope that you can help me
thank you in advance
The path should provide these 2 params, for instance any of these should work:
/get-patient/:tel/:pass
/get-patient/tel/:tel/pass/:pass
Also, you have a typo in your SQL query: paasword.
On a side note, consider having at least HTTPS to pass the password over the network, and use your DB connection library's parameterized queries capabilities. Also, ensure you hash the password in the DB.

Need to pass a string with single \ character in python

I have looked at various solutions and am familiar with using the \ as an escape character. Im in a situation where I need to pass credentials over pyodbc and in making my connection string I need to pass credentials, unfortunately my username is in the format domain\username . I am continually getting errors because the literal string passed to SQL server is domain\username. I have seen a similar question on here trying to figure this out for url requests. I tried implementing it and I end up with the same error once the actual credentials are decoded. I've tried all kinds of string and raw string tricks best I can get is either '\ ' (with space behind it) or '\\' being literally passed to SQL Server. Any ideas?
#username and password is an argument passed from the console, lets just focus on username issue
username = bytes(sys.argv, 'utf8')
credentials = base64.b64encode(usename, altchars = bytes('\ ', 'utf8') )
cnxnstrng = f'''Driver={SQL Server};
Server=server;
Database=database};
UID={base64.b64decode(credentials)};
PWD=password'''

You must use an API key to authenticate each request to Google Maps Platform APIs error when directly entering into address bar

I get an error like so:
{
"error_message" : "This API project is not authorized to use this API.",
"results" : [],
"status" : "REQUEST_DENIED"
}
whenver I run this: https://maps.googleapis.com/maps/api/geocode/json?address=Winnetka&key=AIzaSyCKyVbBzwtgkyuut7P5mxK9vcOWMygCfp0
In the sample video that I am following, he gets a result like so:
in my case i had # in address link input=City Clinical # 89so i had to remove it
You need an API key. Otherwise it won't work.
To get an API Key you have to go to this webpage https://cloud.google.com/maps-platform/#get-started and pick the products you need. Also select or create a project and finally you have to set up a billing account. Unfortunately it isn't for free as far as I know.
Post Values like below:
String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
// Destination of route
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
// Sensor enabled
String sensor = "sensor=true";
String mode = "mode=driving";
String key = "key="+getResources().getString(R.string.google_maps_key);
// Building the parameters to the web service
String parameters = str_origin + "&" + str_dest + "&" + sensor + "&" + mode + "&" + key;
// Output format
String output = "json";
// Building the url to the web service
String url = "https://maps.googleapis.com/maps/api/directions/" + output + "?" + parameters;
Read Google's developer page instructions on the Required parameters, might help.
Google states
"As of June 11, 2018, you must enable billing with a credit card and have a valid API key for all of your projects."
https://cloud.google.com/maps-platform/user-guide/?hl=en
and
"You must have a valid API key and a billing account to access our APIs. When you enable billing, you will get $200 free usage every month for Maps, Routes, or Places."
https://cloud.google.com/maps-platform/user-guide/account-changes/?hl=en

SoftLayer API unable to get networkComponents in time after createObject

In the past, Using getObject method to get networkComponents(PrimaryBackendNetworkComponent, PrimaryNetworkComponent) in time after createObject.
The curl URL is below with appropriate object mask.
$ curl 'https://{username}:{api_key}#api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/{vid}.json?objectMask=mask%5Bid%2C+globalIdentifier%2C+hostname%2C+domain%2C+fullyQualifiedDomainName%2C+status.name%2C+powerState.name%2C+activeTransaction%2C+datacenter.name%2C+operatingSystem%5BsoftwareLicense%5BsoftwareDescription%5Bname%2Cversion%5D%5D%2Cpasswords%5Busername%2Cpassword%5D%5D%2C++maxCpu%2C+maxMemory%2C+primaryIpAddress%2C+primaryBackendIpAddress%2C+privateNetworkOnlyFlag%2C+dedicatedAccountHostOnlyFlag%2C+createDate%2C+modifyDate%2C+billingItem%5BnextInvoiceTotalRecurringAmount%2C+children%5BnextInvoiceTotalRecurringAmount%5D%5D%2C+notes%2C+tagReferences.tag.name%2C+networkVlans%5Bid%2CvlanNumber%2CnetworkSpace%5D%2C+primaryBackendNetworkComponent%5BprimaryIpAddress%2C+networkVlan%5Bid%2Cname%2CvlanNumber%2CprimaryRouter%5D%2C+subnets%5Bnetmask%2CnetworkIdentifier%5D%5D%2C+primaryNetworkComponent%5BprimaryIpAddress%2C+networkVlan%5Bid%2Cname%2CvlanNumber%2CprimaryRouter%5D%2C+subnets%5Bnetmask%2CnetworkIdentifier%5D%5D%5D'
And readable object mask is below:
INSTANCE_DETAIL_MASK = "id, globalIdentifier, hostname, domain, fullyQualifiedDomainName, status.name, " +
"powerState.name, activeTransaction, datacenter.name, " +
"operatingSystem[softwareLicense[softwareDescription[name,version]],passwords[username,password]], " +
" maxCpu, maxMemory, primaryIpAddress, primaryBackendIpAddress, " +
"privateNetworkOnlyFlag, dedicatedAccountHostOnlyFlag, createDate, modifyDate, " +
"billingItem[nextInvoiceTotalRecurringAmount, children[nextInvoiceTotalRecurringAmount]], notes, tagReferences.tag.name, networkVlans[id,vlanNumber,networkSpace], " +
"primaryBackendNetworkComponent[primaryIpAddress, networkVlan[id,name,vlanNumber,primaryRouter], subnets[netmask,networkIdentifier]], primaryNetworkComponent[primaryIpAddress, networkVlan[id,name,vlanNumber,primaryRouter], subnets[netmask,networkIdentifier]]"
But about 18 hours ago, This way is not working because two primary network components stay null. And I have to wait about 30 seconds to call in the workaround.
The question is that I want to know that this situation is temporary or permanent change. We programmatically request these API requests. So it is risky if not to find the root cause.
Please tell me if anyone knows the details of Softlayer.
the createObject method does not create a Virtual server immediately, you need to check first if the server has been provisioned properly, for that propourse you can see the provisionDate property as it is detailed here: https://sldn.softlayer.com/blog/phil/simplified-cci-creation Once the server has been provisioned properly you should be able to see all the information that you want to

Parse-Server Cloud code issues accessing req.params

Maybe I'm doing this wrong but how would I access query parameters of Cloud functions?
When I do a POST here (as cloud functions work) and add my query parameter of "q" it says it is undefined.
Here's the URL I am POST'ing to
http://localhost:1337/api/v1/functions/get_untappd?q=45566
From the url I build up you can see at the end I'm using the typical Express.js / Node accessing of parameters.
var untappdURL = "https://api.untappd.com/v" +
untappdApiVersion +
"/search/beer?client_id=" +
untappdClientId +
"&client_secret=" +
untappdClientSecret +
"&q=" + request.params.q;
Anything I'm doing wrong?
Sorry I should of closed this out. It was a bug and they eventually fixed it =]