Jira API returned Gitlab issue link -> extract more data about the Gitlab issue - api

When using the Jira API to return issues from a project, there is a JSON field called "customfield_12900" that contains a Gitlab issue link. I presume this is because we have Jira integration with Gitlab. However, the link is not in a valid format to use the Gitlab API to extract data from it.
An example of a URL can be "https://gitlab.gildeskagerak.com/ram/ram-platform/main/-/issues/65
My question is: how can I take the given Gitlab URL and extract data about the given issue? In this case, with ID 65.

Query the Gitlab API with the repository name and go from there
curl "https://gitlab.foo.bar/api/v4/projects/?private_token=xxxxx&search=ram-platform"
and you should get something like
[
{
"path_with_namespace" : "ram/ram-platform",
"web_url" : "https://gitlab.foo.bar/ram/ram-platform",
"path" : "ram-platform",
"service_desk_address" : null,
"operations_access_level" : "enabled",
"issues_enabled" : true,
"readme_url" : null,
"shared_with_groups" : [],
"namespace" : {
"id" : 433,
"kind" : "group",
"name" : "ram-platform",
"full_path" : "ram-platform",
"avatar_url" : null,
"web_url" : "https://gitlab.foo.bar/groups/ram-platform",
"parent_id" : null,
"path" : "ram-platform"
},
...
]
Get your ID from there.

Related

Xray- json return empty array - No jira creation

I've created my client_id and secret on Jira and can get a proper Bearer token to communicate to Xray
I've got a return 200 code, but Nothing is created in Jira; why?
Can someone indicate to me what I've missed out
(was able to import the robot test but not JSON, as I would like to integrate Gatling result in Xray)
POST https://xray.cloud.getxray.app/api/v2/import/execution/
{
"testExecutionKey": "DP-12284",
"info" : {
"summary" : "Execution of automated tests for release v1.3",
"description" : "This execution is automatically created when importing execution results from an external source",
"version" : "v1.3",
"user" : "admin",
"revision" : "1.0.42134",
"startDate" : "2014-08-30T11:47:35+01:00",
"finishDate" : "2014-08-30T11:53:00+01:00",
"testPlanKey" : "DP-12272",
"testEnvironments": ["iOS", "Android"]
},
"tests" : [
{
"testKey" : "DP-12271",
"start" : "2014-08-30T11:47:35+01:00",
"finish" : "2014-08-30T11:50:56+01:00",
"comment" : "Successful execution",
"status" : "PASSED"
}
]
}xray.png
enter image description here
enter image description here
doc read: https://docs.getxray.app/display/XRAYCLOUD/Import+Execution+Results+-+REST+v2#ImportExecutionResultsRESTv2-XrayJSONresults

Google Places API key - The provided API key is invalid [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I am trying to set up a routine to get some data from the Google Places API. I followed the instructions here: Google and requested an api key.
When I'm trying to receive some information through my web browser I get the following error message: "The provided API key is invalid."
On the API console under 'Dashboard' there is an entry named
'Google Places API Web Service'.
Please help, I have no idea why I get this response from the api...
The way you URL-encode your query is not correct.
My query: https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=MY_KEY&location=41.3851,%202.1734&radius=750
Returns the following response:
{
"html_attributions" : [],
"next_page_token" : "CpQCDwEAAJttcEn3BV8j9t-k-
nxrwZ_ZcPaIK6Am17AlBzr1GbRDtfNa0jWA__st6OoMF1XuaLEhRns1Crd-
IdRHg5Nt2_kjaPS25f-
nYVrOxgzZwnDUn8_2_RpTfRTG3ri_QwmpwdGEmFJ6wkHp4qHIlsd4hfYe-
6Uzm8_yxEhp9bvY8eC7YvBHW3DKyldx5WTGip0Xa2xdBZ-
O78rt_Ourr0mwXHPumixsiMgwuJe3hyKj9FjbG-J1PId5T6-
u1ApmR599_wT2l7B47xDcSWsW5efZgrUFR-
4FeIkxmMmDZhlijaHwvcdasFSEXDbZsjPDg4C08v2WEdhsm7bCZjFdlCpCLcjlLPfW3vGN8Z0-
37Pk4xGVEhBqIEy2LGaOBDW6dxNOFMoZGhR3d9diXuJ64VDfHxexhWldtG-oZg",
"results" : [
{
"geometry" : {
"location" : {
"lat" : 41.38506389999999,
"lng" : 2.1734035
},
"viewport" : {
"northeast" : {
"lat" : 41.4695761,
"lng" : 2.2280099
},
"southwest" : {
"lat" : 41.320004,
"lng" : 2.0695258
}
}
},
"icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",
"id" : "5695851cee37adbcea7305c0473a15906dbcab8f",
"name" : "Barcelona",
"photos" : [
Etc, etc.
Read this article on URL-encoding and change the ? in your string leaving only one after json

opentok - archiving to AWS folder fails

I simply call the startArchive / stopArchive methods opentok.
Then I check the AWS folder to see if the files are successfully recorded.
However, for some cases, the JSON created for the archive is not complete, and there is no video file saved at all.
Any idea how to pinpoint the reason for this issue?
Example JSON - a successful one;
"createdAt" : 1494502861651,
"files" : [
{
"connectionData" : "",
"filename" : "xxxx.webm",
"size" : 204288,
"startTimeOffset" : 571,
"stopTimeOffset" : 15469,
"streamId" : "xxxxx-5944-43cd-85ff-1904a54e04ca",
"videoType" : "camera"
}
],
"id" : "1xxxx1-3c75-48dc-b2e5-19714b911967",
"name" : "Shamaleyte",
"sessionId" : "2_MX40NTYwMjxxxx-
MTQ5MzkwNDMzNTg3NX5XUWRxxxxBVjYrUE5DTUZwUzhCNnFwdi9-fg"
}
Example JSON - a broken one; as you can observe, there is no filename, size, and stopTimeOffset parameters in this JSON.
"createdAt" : 1494502861651,
"files" : [
{
"connectionData" : "",
"startTimeOffset" : 571,
"streamId" : "xxxxx-5944-43cd-85ff-1904a54e04ca",
"videoType" : "camera"
}
],
"id" : "1xxxx1-3c75-48dc-b2e5-19714b911967",
"name" : "Shamaleyte",
"sessionId" : "2_MX40NTYwMjxxxx-
MTQ5MzkwNDMzNTg3NX5XUWRxxxxBVjYrUE5DTUZwUzhCNnFwdi9-fg"
}
So it seems like that the stopArchiving somehow fails to upload the webm file because of a reason. How could I debug it?
PS : I checked the opentok UI in order to see the status of the archiving and it says "uploaded" but the weird thing is that the details are as the following;
Length Size
00:00:00 0.00MB
Why so?
This looks identical to a known issue in Opentok platform that should be fixed on our next release, currently just about to be deployed. This should not reproduce once TB next deployment is complete.

Sony Camera API - Content URL get request 500, malformed URL?

With the latest Sony Camera API, I'm able to get a list of the contents on the memory card. When I'm trying to download the images using a GET request, I'm getting a 500 error without any descriptive error messages.
I believe there might be something wrong with the URL I'm using for the get request.
This is the first result part of the JSON response from getContentList
{ "id" : 12, "result" : [
[
{
"isPlayable" : "false",
"content" : {
"thumbnailUrl" : "http:\/\/192.168.122.1:8080\/contentstransfer\/thumb\/index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000",
"original" : [
{
"stillObject" : "raw",
"url" : "http:\/\/192.168.122.1:8080\/contentstransfer\/orgraw\/index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000",
"fileName" : "_DSC7790.ARW"
}
],
"smallUrl" : "http:\/\/192.168.122.1:8080\/contentstransfer\/vga\/index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000",
"largeUrl" : "http:\/\/192.168.122.1:8080\/contentstransfer\/scn\/index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000"
},
"fileNo" : "7790",
"isBrowsable" : "false",
"isProtected" : "",
"title" : "",
"contentKind" : "still",
"createdTime" : "2017-01-12T13:49:00-08:00",
"folderNo" : "100",
"uri" : "image:content?contentId=index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000"
},
The url is encoded, but when I decode it I'm getting this for the thumbnailUrl:
http://192.168.122.1:8080/contentstransfer/thumb/index://1000/00000001-default/00000043-00000AF0_67_1_1000
Of course that is giving me a 500 error, but I believe the characters after thumb must be some URL for the camera to internally parse. So instead I'm just removing the back slashes to get this:
http://192.168.122.1:8080/contentstransfer/thumb/index%3A%2F%2F1000%2F00000001-default%2F00000043-00000AF0_67_1_1000
This still also gives me a 500 error. I'm not sure how else I'm supposed to use this URL. All the API documentation and references just say do a GET request, but the URL that comes in the JSON is not working.
I can only spoke for me: I want video-data instead of thumbnail-data and I just used the url as given through their "result" JSON-Object and I got no problems. For me this looks like this:
http://192.168.122.1:8080/contentstransfer/org/index%3A%2F%2F1000%2F00000100-default%2F00000047-00000C3D_71_256_1000

apache nutch to index to solr via REST

newbie in apache nutch - writing a client to use it via REST.
succeed in all the steps (INJECT, FETCH...) - in the last step - when trying to index to solr - it fails to pass the parameter.
The Request (I formatted it in some website)
{
"args": {
"batch": "1463743197862",
"crawlId": "sample-crawl-01",
"solr.server.url": "http:\/\/x.x.x.x:8081\/solr\/"
},
"confId": "default",
"type": "INDEX",
"crawlId": "sample-crawl-01"
}
The Nutch logs:
java.lang.Exception: java.lang.RuntimeException: Missing SOLR URL. Should be set via -D solr.server.url
SOLRIndexWriter
solr.server.url : URL of the SOLR instance (mandatory)
solr.commit.size : buffer size when sending to SOLR (default 1000)
solr.mapping.file : name of the mapping file for fields (default solrindex-mapping.xml)
solr.auth : use authentication (default false)
solr.auth.username : username for authentication
solr.auth.password : password for authentication
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
Was that implemented? the param passing to solr plugin?
You need to create/update a configuration using the /config/create/ endpoint, with a POST request and a payload similar to:
{
"configId":"solr-config",
"force":"true",
"params":{"solr.server.url":"http://127.0.0.1:8983/solr/"}
}
In this case I'm creating a new configuration and specifying the solr.server.url parameter. You can verify this is working with a GET request to /config/solr-config (solr-config is the previously specified configId), the output should contain all the default parameters see https://gist.github.com/jorgelbg/689b1d66d116fa55a1ee14d7193d71b4 for an example/default output. If everything worked fine in the returned JSON you should see the solr.server.url option with the desired value https://gist.github.com/jorgelbg/689b1d66d116fa55a1ee14d7193d71b4#file-nutch-solr-config-json-L464.
After this just hit the /job/create endpoint to create a new INDEX Job, the payload should be something like:
{
"type":"INDEX",
"confId":"solr-config",
"crawlId":"crawl01",
"args": {}
}
The idea is that need to you pass the configId that you created with the solr.server.url specified along with the crawlId and other args. This should return something similar to:
{
"id": "crawl01-solr-config-INDEX-1252914231",
"type": "INDEX",
"confId": "solr-config",
"args": {},
"result": null,
"state": "RUNNING",
"msg": "OK",
"crawlId": "crawl01"
}
Bottom line you need to create a new configuration with the solr.server.url setted instead of specifying it through the args key in the JSON payload.