Skip to content

Instantly share code, notes, and snippets.

@galderz
Created October 24, 2019 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save galderz/a98a5dd42ed77a0be798ab8e3239053c to your computer and use it in GitHub Desktop.
Save galderz/a98a5dd42ed77a0be798ab8e3239053c to your computer and use it in GitHub Desktop.
$ make create-cache
minikube profile SiteA
✅ minikube profile was successfully set to SiteA
curl --fail -v -d '<infinispan><cache-container><distributed-cache name="example" mode="SYNC"><backups><backup site="SiteB" strategy="ASYNC" timeout="30000"/></backups></distributed-cache></cache-container></infinispan>' -H "Content-Type: application/xml" -u developer:$(kubectl get secret example-infinispan-generated-secret -o jsonpath="{.data.identities\.yaml}" | base64 -D | yq -r .credentials[0].password) -X POST $(minikube service example-infinispan-external --url --namespace local-operators)/rest/v2/caches/example
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 192.168.99.147...
* TCP_NODELAY set
* Connected to 192.168.99.147 (192.168.99.147) port 30222 (#0)
* Server auth using Basic with user 'developer'
> POST /rest/v2/caches/example HTTP/1.1
> Host: 192.168.99.147:30222
> Authorization: Basic ZGV2ZWxvcGVyOlY2YWtvYUxSTVZjRTlCQWI=
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/xml
> Content-Length: 200
>
* upload completely sent off: 200 out of 200 bytes
< HTTP/1.1 200 OK
< connection: keep-alive
< content-length: 0
<
* Connection #0 to host 192.168.99.147 left intact
minikube profile SiteB
✅ minikube profile was successfully set to SiteB
curl --fail -v -d '<infinispan><cache-container><distributed-cache name="example" mode="SYNC"><backups><backup site="SiteA" strategy="ASYNC" timeout="30000"/></backups></distributed-cache></cache-container></infinispan>' -H "Content-Type: application/xml" -u developer:$(kubectl get secret example-infinispan-generated-secret -o jsonpath="{.data.identities\.yaml}" | base64 -D | yq -r .credentials[0].password) -X POST $(minikube service example-infinispan-external --url --namespace local-operators)/rest/v2/caches/example
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 192.168.99.148...
* TCP_NODELAY set
* Connected to 192.168.99.148 (192.168.99.148) port 30222 (#0)
* Server auth using Basic with user 'developer'
> POST /rest/v2/caches/example HTTP/1.1
> Host: 192.168.99.148:30222
> Authorization: Basic ZGV2ZWxvcGVyOlBOdHFGcGdsTnhnaEF5eEY=
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/xml
> Content-Length: 200
>
* upload completely sent off: 200 out of 200 bytes
< HTTP/1.1 200 OK
< connection: keep-alive
< content-length: 0
<
* Connection #0 to host 192.168.99.148 left intact
@g ~/.../manual/xsite-minikube (t_xsite_v3) $ make put
minikube profile SiteA
✅ minikube profile was successfully set to SiteA
curl --fail -v \
-d 'test-value' \
-H "Content-Type: text/plain" \
-u developer:$(kubectl get secret example-infinispan-generated-secret -o jsonpath="{.data.identities\.yaml}" | base64 -D | yq -r .credentials[0].password) \
-X POST \
$(minikube service example-infinispan-external --url --namespace local-operators)/rest/v2/caches/example/test-key
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 192.168.99.147...
* TCP_NODELAY set
* Connected to 192.168.99.147 (192.168.99.147) port 30222 (#0)
* Server auth using Basic with user 'developer'
> POST /rest/v2/caches/example/test-key HTTP/1.1
> Host: 192.168.99.147:30222
> Authorization: Basic ZGV2ZWxvcGVyOlY2YWtvYUxSTVZjRTlCQWI=
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: text/plain
> Content-Length: 10
>
* upload completely sent off: 10 out of 10 bytes
* The requested URL returned error: 404 Not Found
* stopped the pause stream!
* Closing connection 0
curl: (22) The requested URL returned error: 404 Not Found
make: *** [put] Error 22
@(2) g ~/.../manual/xsite-minikube (t_xsite_v3) $ make put
minikube profile SiteA
✅ minikube profile was successfully set to SiteA
curl --fail -v \
-d 'test-value' \
-H "Content-Type: text/plain" \
-u developer:$(kubectl get secret example-infinispan-generated-secret -o jsonpath="{.data.identities\.yaml}" | base64 -D | yq -r .credentials[0].password) \
-X POST \
$(minikube service example-infinispan-external --url --namespace local-operators)/rest/v2/caches/example/test-key
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 192.168.99.147...
* TCP_NODELAY set
* Connected to 192.168.99.147 (192.168.99.147) port 30222 (#0)
* Server auth using Basic with user 'developer'
> POST /rest/v2/caches/example/test-key HTTP/1.1
> Host: 192.168.99.147:30222
> Authorization: Basic ZGV2ZWxvcGVyOlY2YWtvYUxSTVZjRTlCQWI=
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: text/plain
> Content-Length: 10
>
* upload completely sent off: 10 out of 10 bytes
* The requested URL returned error: 404 Not Found
* stopped the pause stream!
* Closing connection 0
curl: (22) The requested URL returned error: 404 Not Found
make: *** [put] Error 22
@(2) g ~/.../manual/xsite-minikube (t_xsite_v3) $ make put
minikube profile SiteA
✅ minikube profile was successfully set to SiteA
curl --fail -v \
-d 'test-value' \
-H "Content-Type: text/plain" \
-u developer:$(kubectl get secret example-infinispan-generated-secret -o jsonpath="{.data.identities\.yaml}" | base64 -D | yq -r .credentials[0].password) \
-X POST \
$(minikube service example-infinispan-external --url --namespace local-operators)/rest/v2/caches/example/test-key
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 192.168.99.147...
* TCP_NODELAY set
* Connected to 192.168.99.147 (192.168.99.147) port 30222 (#0)
* Server auth using Basic with user 'developer'
> POST /rest/v2/caches/example/test-key HTTP/1.1
> Host: 192.168.99.147:30222
> Authorization: Basic ZGV2ZWxvcGVyOlY2YWtvYUxSTVZjRTlCQWI=
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: text/plain
> Content-Length: 10
>
* upload completely sent off: 10 out of 10 bytes
< HTTP/1.1 200 OK
< etag: 28702759
< connection: keep-alive
< content-length: 0
<
* Connection #0 to host 192.168.99.147 left intact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment