When Cryostat is deployed in the supported scenario by using the Cryostat Operator, users can bypass the POST /api/v1/recordings HTTP handler and copy their .jfr binary data directly into the Cryostat archives in the OpenShift PVC.
Use `oc project` to determine the deployment namespace, `oc get pods` to determine the Cryostat pod name, and `oc get cryostats` to determine the Cryostat container name.
oc exec -i -n $MYNAMESPACE -c $CRYOSTAT_CONTAINER_NAME $CRYOSTAT_POD_NAME – mkdir /opt/cryostat.d/recordings.d/unlabelled # this may fail if the required "unlabelled" directory already exists. If so, proceed regardless
oc cp vertx-fib-demo-6f4775cdbf-82dvl_150mb_20211006T152006Z.jfr $CRYOSTAT_POD_NAME:/opt/cryostat.d/recordings.d/unlabelled/vertx-fib-demo-6f4775cdbf-82dvl_150mb_20211006T152006Z.jfr -c $CRYOSTAT_CONTAINER_NAME
After copying the recording directly into the PVC archives location, we can verify that Cryostat is aware of the uploaded file using httpie, curl, or wget:
$ https GET https://cryostat-sample-myproject.apps-crc.testing/api/v1/recordings Authorization:"Bearer $(oc whoami -t)"
HTTP/1.1 200 OK
Set-Cookie: ac6fe4a79b8104f3ee178c2547bbced6=b010120f48b63047a41c7183900059fc; path=/; HttpOnly; Secure; SameSite=None
cache-control: private
content-encoding: gzip
content-length: 182
content-type: text/plain
set-cookie: ac6fe4a79b8104f3ee178c2547bbced6=b010120f48b63047a41c7183900059fc; path=/; HttpOnly; Secure; SameSite=None
[
{
"downloadUrl": "https://cryostat-sample-myproject.apps-crc.testing:443/api/v1/recordings/vertx-fib-demo-6f4775cdbf-82dvl_150mb_20211006T152006Z.jfr",
"name": "vertx-fib-demo-6f4775cdbf-82dvl_150mb_20211006T152006Z.jfr",
"reportUrl": "https://cryostat-sample-myproject.apps-crc.testing:443/api/v1/reports/vertx-fib-demo-6f4775cdbf-82dvl_150mb_20211006T152006Z.jfr"
}
]