i try to get servers status of distributed version of OrientDB via http rest :
curl --user admin:admin --header "Accept: text/csv" -d "list servers " "http://localhost:2480/command/GratefulDeadConcerts/sql"
doesnt works :
{
"errors": [
{
"code": 500,
"reason": 500,
"content": "com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException: Cannot find a command executor for the command request: sql.list servers\u000d\u000a\u0009DB name=\"GratefulDeadConcerts\""
}
you're sending a list servers command to the sql interpreter while that's not a sql command but a console one.
UPDATE
you can use this
curl --user root:root --header "Accept: text/csv" -d "HA STATUS -servers -output=text" "http://localhost:2480/command/GratefulDeadConcerts/sql"
Run this command to get the results as JSON that contains all servers (nodes) with detailed status and info per server:
curl -X POST --user {{user}}:{{password}} --header "Accept: application/json" \
-d "HA STATUS -servers -db" "{{orientdb-url}}:2480/command/{{database-name}}/sql"
Related
I'm trying out the IBM Db2 REST Service but I get an Error during the activation of the Rest Service:
I followed the Documentation
I have pulled and run db2rest from IBM container registry, started it and could
do a rest call to get a token:
curl -k -X POST \
https://127.0.0.1:50050/v1/auth \
-H "content-type: application/json" \
-d '{
"dbParms": {
"dbHost": "172.17.0.2",
"dbName": "TESTDB",
"dbPort": 50000,
"isSSLConnection": false,
"username": "db2inst1",
"password": "db2inst1"
},
"expiryTime": "30m" }'
Then i wanted to activate the rest capability:
curl -k -X POST \
https://127.0.0.1:50050/v1/metadata/setup \
-H "authorization: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6dHJ1ZSwiY2xpZW50X2lkIjoiMjMxMTAzODgtZmM4OC00NzIwLTg2NTQtNTk5OWM2MjRkMGE0IiwiZXhwIjoxNjAxODI1ODYzLCJpc3MiOiJkYjJpbnN0MSJ9.ZHtsviWUbApw6y-72o5ey7LFf3ys2KEP2jAf7u_36Vq5ASnhKISeIzLXIN5a-OrIasZsQkVjAI5D-9o8Hlilk3mnMVF6XBu5VU7mHZb7k8fnQh75Fk770uCZwlPpgUqcluz6TIcPzUVEmzY5k9uTxWw2-F7Aqi0ruEMV2CBf8iU7KoG1b9apaeqQkY2MI7eSkKiupwkoRCxhF2LMSUUCDZUPMlspN80B5aZ5bUov4o1-j1fS7-_Scm24C4tm6jkwNdNj2CIN7xv6moUjU1oIxzHwbIKLJs6VJARFqLlLLnk9VoINSA1q6X6T9di7tfyqouxPGFagnjtphadNpCfXfg" \
-H "content-type: application/json" \
-d '{
"schema": "DB2REST"
}'
And i got the Error:
{"errors":[{"code":"internal_server_error","message":"[Db2 REST] Setup metadata failed.","more_info":"SQLExecute: {42601} [IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token "#" was found following ".RESTLISTSERVICES(IN". Expected tokens may include: ",". LINE NUMBER=1. SQLSTATE=42601\n"}],"trace":null}
I get the same Error with:
docker exec db2rest /opt/ibm/dbrest/scripts/db2rest-setup.sh 127.0.0.2 testdb 50000 N DB2REST db2inst1 db2inst1
Any Ideas where the Problem could be ?
I am trying to import existing json file using HTTP API, but the 'curl' command throwing the error.
I am using the below command to import existing json file,
curl --user admin:admin "http://localhost:3000/api/dashboards/db" -X POST -H "Content-Type:application/json;charset=UTF-8" --data-binary #/u04/sys_monitor/my_Metrics.json
If i run the above command, it is throwing the error like "[{"fieldNames":["Dashboard"],"classification":"RequiredError","message":"Required"}]"
I tried to run the below command,
curl --fail --insecure --user admin:admin --request "POST" "http://localhost:3000/api/dashboards/db" --header "Content-Type: application/json" --data-binary #/u04/sys_monitor/my_Metrics.json
For the above command execution i am getting the error like,
curl: (22) The requested URL returned error: 422 Unprocessable Entity
Where i am doing wrong, kindly assist me,
The below comment is working but not updated the dashboard in grafana,
curl --user admin:admin -vvv "http://localhost:3000/api/dashboards/db" -X POST -d #My_Metrics.json -H 'Content-Type: application/json'
I'm trying to find a way to add a label to a GitHub issue using the API. After checking the API documentation I tried the following curl request:
curl -X POST -H "Authorization: token OOOOOOOOOOOOOOOO" -H \
"Accept: application/vnd.github.symmetra-preview+json" \
-d #label.json https://api.github.com/repos/CHSUNSONG/star-platform/issues/11
label.json contains:
["submitted"]
However, I got the following response:
{
"message": "Invalid request.\n\nFor 'links/1/schema', [\"submitted\"] is not an object.",
"documentation_url": "https://developer.github.com/v3/issues/#edit-an-issue"
}
Why isn't this working and how can I fix it?
You're POSTing to the wrong URL. Add /labels onto the end:
curl -X POST -H "Authorization: token OOOOOOOOOOOOOOOO" -H \
"Accept: application/vnd.github.symmetra-preview+json" \
-d #label.json \
https://api.github.com/repos/CHSUNSONG/star-platform/issues/11/labels
I'm very new to Wildfly but I need to set up automated monitoring of individual deployment status via the API.
In the same way that I can view the server state with curl, eg:
curl --insecure --digest 'https://admin:password#localhost:9993/management' --header "Content-Type: application/json" -d '{"operation":"read-attribute","name":"server-state","json.pretty":1}'
Will return:
{
"outcome" => "success",
"result" => "running"
}
In the same way the from the jboss-cli, I issue:
:read-attribute(name=server-state)
And get the same result.
So, from the CLI, if I issue the following command to get the status of a specific deployment:
/deployment=bob :read-attribute(name=status)
I get the following result:
{
"outcome" => "success",
"result" => "OK"
}
But I can't work out what curl command will give me that result. I've read through a tonne of documentation and either it doesn't exist or I'm looking in the wrong spot. I've tried:
curl --insecure --digest 'https://password#localhost:9993/management' --header "Content-Type: application/json" -d '{"deployment":"bob","operation":"read-attribute","name":"status","json.pretty":1}'
but that didn't work. Any ideas?
Thanks,
Mark J.
You need to add an array for the address attribute and move the "deployment":"bob" in the array.
curl --insecure --digest 'https://password#localhost:9993/management' --header "Content-Type: application/json" -d '{"operation":"read-attribute", "address":[{"deployment":"bob"}],"name":"status","json.pretty":1}'
The address is a name/value pair object for the path the attribute you want to read. For example if you wanted to see the all the handlers associated with the root logger you could execute the following.
curl --insecure --digest 'https://password#localhost:9993/management' --header "Content-Type: application/json" -d '{"operation":"read-attribute","address":[{"subsystem":"logging"},{"root-logger":"ROOT"}],"name":"handlers","json.pretty":1}
For a remote administration of multiple Glassfish 3.1.2.2 instances I want to configure resource adapter connection pool and connector resources. These configuration can only be done after the resource adapter deployment.
All works if I do things with asadmin.
Get Access via REST works as expected.
Example:
curl --user admin:pwd -X GET -H "Accept: application/JSON"
http://localhost:4848/management/domain/resources/connector-connection-pool
Now I want to create a connection pool using the following command with REST
asadmin create-connector-connection-pool --raname MulticastDNS-connector
--connectiondefinition multicastdns.outbound.MulticastDNSRegistry multicastdns/pool
I followed some of the Oracle examples http://docs.oracle.com/cd/E18930_01/html/821-2416/gjipx.html#gjijx or http://docs.oracle.com/cd/E19798-01/821-1751/gjijx/index.html
But all things I tried got 400 Bad Requests.
Example:
curl --user admin:pwd -X POST -H "Accept: application/JSON" -H "Content-Type: application/json"
-d '{"id":"multicastdn%2fspool","connectiondefinitionname":"multicastdns.outbound.MulticastDNSRegistry","resourceAdapterName":"MulticastDNS-connector"}'\
http://localhost:4848/management/domain/resources/connector-connection-pool -v
# other check
curl --user admin:pwd -X POST -H "Accept: application/JSON" \
-d id=multicastdns%2fpool \
-d connectiondefinitionname=multicastdns.outbound.MulticastDNSRegistry \
-d resourceAdapterName=MulticastDNS-connector \
http://localhost:4848/management/domain/resources/connector-connection-pool -v
Simular results if I want to delete a existing resource.
curl --user admin:pwd -X DELETE -H "Accept: application/JSON" \
http://localhost:4848/management/domain/resources/connector-connection-pool/multicastdns%2fpool -v
# other try
curl --user admin:pwd -X DELETE -H "Accept: application/JSON" \
-d id=multicastdns%2fpool \
http://localhost:4848/management/domain/resources/connector-connection-pool -v
Same issue if try the second step with connector resource
asadmin create-connector-resource --poolname multicastdns/pool jca/multicastdns
Get via REST works but add and delete an entry won't work.
Thanx florian