Conf’o’rama
Retrieving Authentication Token
To work with files mounted using Conf’o’rama, you will need to use an authentication token to call the Conf’o’rama API. This token is stored in a secret named saagie-common-conf-upload-token
.
-
Verify the presence of the token by running the following command line:
kubectl -n <installationId> get secret saagie-common-conf-upload-token
Where:
-
<installationId>
must be replaced with your installation ID. It must match the prefix you have determined for your DNS entry.
-
-
Retrieve the token by running the following command line:
TOKEN=$(kubectl -n <installationId> get secret saagie-common-conf-upload-token -o jsonpath='{@.data.token}' | base64 -d)
Where:
-
<installationId>
must be replaced with your installation ID. It must match the prefix you have determined for your DNS entry.
-
Troubleshooting
If the secret saagie-common-conf-upload-token
does not exist, choose one of the two following options:
-
Generate a token.
-
Create a secret named
saagie-common-conf-upload-token
that contains the token you generated. -
Reboot the Conf’o’rama pod.
Your token is ready to use.
If the secret saagie-common-conf-upload-token
does not exist, Conf’o’rama automatically generates a token. You can recover this token by searching the pod’s logs. It should look like the following code lines:
2020-05-25 07:16:21.050 [main] INFO io.saagie.conforama.infra.Main - Authentication token generated :
Token : whtIwteJEptSXoIKogqP974bnzPgtUPWWIsiZabaFWbVVxc68OY3Nsj1FBJdE84x7LDl1K9qunDocFMEb3avTAgHLAQboymzvjZufBN1kbjYJFwejtvQpQflJE80P4mp (1)
1 | This token will not function. Your token will be unique. |
Once recovered, you can use it immediately. No need to reboot the pod.
Using Conf’o’rama
Once files have been mounted using Conf’o’rama, you will be able to create, delete, and list files, and retrieve file content.
You can create a file on a platform by running the following cURL:
curl -X POST https://<saagie_host>/conf/upload/<customer>/<platform_id>/<my/file/path/mounted/in/jobs.xml> -T my-file.xml -H "Authorization: Bearer $TOKEN"
Where:
-
<saagie_host>
must be replaced with your value. -
<customer>
must be replaced with your value. -
<platform_id>
must be replaced with your value. -
<my/file/path/mounted/in/jobs.xml>
must be replaced with your value, which is the path to the location where your file will be saved.
You can delete a file from a platform by running the following cURL:
curl -X DELETE https://<saagie_host>/conf/<customer>/<platform_id>/<my/file/path/mounted/in/jobs.xml> -H "Authorization: Bearer $TOKEN"
Where:
-
<saagie_host>
must be replaced with your value. -
<customer>
must be replaced with your value. -
<platform_id>
must be replaced with your value. -
<my/file/path/mounted/in/jobs.xml>
must be replaced with your value, which is the path to the location where your file will be saved.
You can list files mounted to a platform.
-
Connect to service via the Conf’o’rama port by running the following
kubectl
command line:kubectl port-forward service/saagie-common-conforama 8080:80
-
List the mounted files by running the following cURL:
curl http://localhost:8080/configuration/<customer>/<platform_id>?path=/
Where:
-
<customer>
must be replaced with your value. -
<platform_id>
must be replaced with your value.
-
You can retrieve the contents of a file.
-
Connect to service via the Conf’o’rama port by running the following
kubectl
command line:kubectl port-forward service/saagie-common-conforama 8080:80
-
Retrieve the contents of file by running the following cURL:
curl http://localhost:8080/configuration/<customer>/<platform_id>/<my/file/path/mounted/in/jobs.xml>
Where:
-
<customer>
must be replaced with your value. -
<platform_id>
must be replaced with your value. -
<my/file/path/mounted/in/jobs.xml>
must be replaced with your value, which is the path to the location where your file will be saved.
-