I am using this command to delete service from ambari:
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.168.24.226:8080/api/v1/clusters/zwlbs/services/Zookeeper
response:
{
"status" : 404,
"message" : "org.apache.ambari.server.controller.spi.NoSuchResourceException: The specified resource doesn't exist: Service not found, clusterName=zwlbs, serviceName=ZOOKEEPER_SERVER"
}
I've aready tried:
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.168.24.226:8080/api/v1/clusters/zwlbs/services/Zookeeper_Service
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.168.24.226:8080/api/v1/clusters/zwlbs/services/ZOOKEEPER
What can i do to delete ZooKeeper service?The service is aready installed.
the service name is UPPERCASE:
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.16824.226:8080/api/v1/clusters/zwlbs/services/ZOOKEEPER
Related
Under Geoserver, How do we create the WMTSLayer once the WMTSStore is establish via REST API ?
Trying to follow the swagger documentation under here,
https://docs.geoserver.org/latest/en/api/#1.0.0/layers.yaml
But can't find the correct url to work for it. Get 404 when I try this using curl
curl -v -u admin:geoserver -X POST http://localhost:8085/geoserver-cloud/rest/workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers -H "accept: application/json" -H "content-type: application/json" -d "{\"featureType\":{\"name\":\"World_Imagery\"}}"
Also looked under here,
https://docs.geoserver.org/latest/en/api/#1.0.0/wmtslayers.yaml
And tried below url for it. Get 500 when I try this using curl
curl -v -u admin:geoserver -X POST http://localhost:8085/geoserver-cloud/rest/workspaces/{workspace}/wmtsstores/{wmtsstore}/layers -H "accept: application/json" -H "content-type: application/json" -d "{\"featureType\":{\"name\":\"World_Imagery\"}}"
Found it, need to pass wmtsLayer
curl -v -u admin:geoserver -X POST http://localhost:8085/geoserver-cloud/rest/workspaces/{workspace}/wmtsstores/{wmtsstore}/layers -H "accept: application/json" -H "content-type: application/json" -d "{ \"wmtsLayer\": { \"name\": \"NatGeo_World_Map\" } }"
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 delete grafana dashboard using curl command, but it is not deleting, the below curl command I tried to delete the dashboard,
curl -XPOST -d '{"name":"mydashboard"}' http://localhost:3000/api/dashboards/db -u admin:admin -H "Content-Type: application/json"
Run the below command,
curl -k -X DELETE -u admin:admin http://localhost:3000/api/dashboards/db/dashboardslug_name
where dashboardslug_name is the name while save the dashboard and not the dashboard title displaying in the web url.
Is there a way to POST to an ActiveMQ topic without requiring body= ?
e.g. instead of this:
curl -u test:test -d "body=message" http://server:8161/api/message/testtopic?type=topic
use this:
curl -u test:test -d "message" http://server:8161/api/message/testtopic?type=topic
It turns out that specifying the Content-Type allows you to omit body=
curl -u test:test -d "message" -H "Content-Type: text/plain" http://server:8161/api/message/testtopic?type=topic
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