I'm trying to create a hash index in ArangoDB via its HTTP API via CURL.
Within my ArangoDB I have several databases like:
production
staging
test
As mentioned in the docs in https://docs.arangodb.com/3.4/HTTP/Indexes/Hash.html one should call the "Index API" with an URL scheme as follows:
http://localhost:8529/_api/index?collection=products
Applied to my use case I have the following URL:
http://localhost:8529/_api/index?colletion=NodesElectric
Executing the CURL command always returns with an error like:
{
"error": true,
"errorMessage": "collection or view not found",
"code": 404,
"errorNum": 1203
}
I suppose that the problem is caused by having the collection "NodesElectric" in all databases "production", "staging",...
My question is how do I specify the according database for the mentioned collection?
Have not found an hint in the docs herein.
Thanks for any help!
Any operation triggered via ArangoDB's HTTP REST API is executed in the context
of exactly one database. To explicitly specify the database in a
request, the request URI must contain the database name in front of
the actual path:
http://localhost:8529/_db/mydb/... where ... is the actual path to the
accessed resource. In the example, the resource will be accessed in
the context of the database mydb. Actual URLs in the context of mydb
could look like this:
http://localhost:8529/_db/mydb/_api/version
This information can be found in the documentation:
https://docs.arangodb.com/3.4/HTTP/Database/
If no database is specified in the request URL, the _system database is used by default.
To create a hash index on collection NodesElectric in your database production the following URL has to be used:
http://localhost:8529/_db/production/_api/index?collection=NodesElectric
Related
Trying to read REST API endpoints through Synapse pipeline and sinking it in a JSON format. The API response is XML and the run ends up erroring out.
--------Error---------
{
"errorCode": "2200",
"message": "Failure happened on 'Source' side. ErrorCode=JsonInvalidDataFormat,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Error occurred when deserializing source JSON file ''. Check if the data is in valid JSON object format.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=Newtonsoft.Json.JsonReaderException,Message=Unexpected character encountered while parsing value: <. Path '', line 0, position 0.,Source=Newtonsoft.Json,'",
"failureType": "UserError",
"target": "Copy REST API Data",
"details": []
}
--------Error---------
Do not want to go back and use existing C# script-based code which is currently run through SSIS packages.
Any assistance will be appreciated.
I tried to repro this using Rest connector in ADF and got the same error. Rest connector supports only JSON file. Refer this Microsoft Document on Supported capabilities of REST connector.
Instead use HTTP connector and select XML dataset. Below is the approach to do it.
Select HTTP in linked service.
Enter Base URL and authentication type and then click create.
Create new dataset for HTTP linked service. Select HTTP and then continue.
Select XML format and then select continue.
Give the linked service and relative url and then click OK.
Use this dataset as source dataset in copy activity. Once pipeline is run, data will be copied to sink.
My ASP.NET Core Rest API is returning a 500 Internal Server Error on post method while adding a new customer. I am able to get data from my development database, but myDbContext.SaveChanges(); failed saying my development user doesn't have access to the main database, but my connection string refers to my development database only.
My database name : MyappDbDev
My database user : AppUserDev
Error:
The server principal "AppUserDev" is not able to access the database "MyappDbDev" under the current security context
I have another database in production with following credentials:
Database name : MyappDb
Database user : AppUser
I didn't find any useful suggestions after researching for days, at last I found that I had a trigger for the table that I am adding new record.
which the trigger had insert command to old database.
It was a silly mistake , but I hope this may help someone someday.
I just want to use number from my server to change tile number, such as using URL http://10.59.XXX.100:8080/Map/dynamicTileOnlyNo
In SCN blog, they use /sap/fiori/employees/destinations/northwind/V3/Northwind/Northwind.svc/Employees/$count to set dynamic data
which stand for
/<fiori proxy>/<application id>/destinations/<destination name>/<path to OData service>/<OData collection>/<query string>
But I tried http://services.odata.org/Northwind/Northwind.svc/Employees/$count , returned:
Failed to update data via service /sap/fiori/realtimealerthttp://10.59.172.100:8080/Map/dynamicTileOnlyNo: HTTP request failed - 404 Not Found - sap.ushell.components.tiles.applauncherdynamic.DynamicTile
Why HCP add /sap/fiori/realtimealert in front? Should I set something in Destinations?
I tried add destinations in "Configure Portal Service ":
Name: northwind
URL: http://services.odata.org/
Still returned:
GET
https://flpportal-iXXXXXXtrial.dispatcher.hanatrial.ondemand.com/sap/fiori/alert/destinations/northwind/Northwind/Northwind.svc/Employees/$count
404 (Not Found)
Must I use odata or something?
As mentioned in the SCN blog, you need to use relative paths in the URL in combination with odata.
It also seems like your destinations are not configured properly.
Please check HCP documentation on this.
I'm trying to retrieve projects metrics using the REST Api. Therefore I first query the projects using "/api/projects/index". Afterwards I retrieve the metrics using "/api/metrics/search". Both works fine. And I result with:
[id:35476, k:com.test:TestProject, nm:TestProject, qu:TRK, sc:PRJ]
[custom:false, description:Cyclomatic complexity, direction:-1, domain:Complexity, hidden:false, id:10019, key:complexity, name:Complexity, qualitative:false, type:INT]
Now I wanted to retrieve a projects metrics. Therefore I use the following URL:
https://MYHOST/sonarqube/api/timemachine/index?resource=35476&metric=10019&fromDateTime=2010-12-25T23:59:59+0100&toDateTime=2018-12-25T23:59:59+0100
There the server retruns only: [{"cols":[],"cells":[]}]
This surprices me, because when I enter the WebInterface of sonar for the project, I can see numbers. I tried some other metrics, however all ended with the same result. What am I doing wrong?
You didn't mention server version, so I'll assume the latest: 5.2.
I got the same result for a bare query (http://nemo.sonarqube.org/api/timemachine/index), and for a query which specified resource but not metrics (http://nemo.sonarqube.org/api/timemachine/index?resource=org.sonarsource.sonarqube%3Asonarqube).
So I'm guessing there's a problem with either your resource or metric id. Try using the keys (com.test&%3ATestProject, and complexity) instead.
And yes, the ids you got back from the other web services should work here, but what's meant by "id" can be a little... ah... variable from service to service to service.
I have a canned database running like this
I have the request and the canned database server on the same system.
starting canned on port 3000 for ./
request: get /home/abc/def/canned/example/comment/any.get.json not found
request: get /home/abc/Desktop/hello not found
request: get /home/abc/Desktop/hello.json not found
My GET request looks like this (on the same system)
GET http://10.0.x.xx:3000/home/abc/Desktop/hello.json
Am I missing something?
You cannot use the absolute path, you must use a path which is relative to the HTTP server's document root. For example, if your server is using /home/abc/ as the document root you would use the URL http://10.0.x.xx:3000/Desktop/hello.json