API usage
Prerequisites:
- Download Helm binaries (helm-v3.6.3-linux-amd64.tar.gz) from the [Helm GitHub Repo](https://github.com/helm/helm/releases/tag/v3.6.3).
- Upload the Helm binaries and the helm chart to the file server by uploading a file to the test folder.
**POST** https://dtias_ip/v1/tenants/default/fs/files/upload/{FolderPath}
helm-v3.6.3-linux-amd64.tar.gz
flask-api-server-0.1.0.tgz
blueprints_helm_examples.tgz - Upload the flask image to the registry.
docker load -i image/flask-api-server.tar
docker push flask-api-server:latest <customer hosted docker/harbor registry path>
docker push flask-api-server:latest overcloudregistry.io:5113/flcm/ - To run the blueprints, you must upload a copy of the Kubernetes configuration file and upload it to the Orchestrator. Edit the IP address if needed. Use the 'create a list of secrets' API:
**POST** https://dtias_ip/v1/tenants/{Tenant}/secrets
Add a blueprint and running a deployment
Upload the blueprint tar file blueprints_helm_examples.tgz
using the upload a blueprint API:
**POST** https://dtias_ip/v1/tenants/default/blueprints/{BlueprintId}
The blueprints that are found in the default blueprints_helm_examples.tgz
works as is. If a user wants to modify the Helm chart values then they can do so by modifying the set_values
section of the blueprint YAML file.
# set_values:
# - name: service.port
# value: 5200
# - name: namespace
# value: my_namespace
Create a .zip or tgz file with the proper directory hierarchy with the blueprints and reupload to the file server.
To modify the blueprint inputs, users can modify the corresponding input YAML files flask-bp-input.yaml
and nginx-bp-inputs.yaml
and pass the files when uploading the blueprint.
Create a deployment using the uploaded blueprint by the DTIAS REST API. For more information about the API usage and syntax usage, see the Dell Telecom Infrastructure Automation Suite API Guides. The following is the API for creating a deployment.
**POST** https://dtias_ip/v1/tenants/{Tenant}/deployments
This runs the Helm chart.
Finish installing the application in the cluster by creating a job.
**POST** https://dtias_ip/v1/tenants/{Tenant}/job
Use the application
Verify that the pod and service are running properly:
kubectl get pods
kubectl get svc
Use the port forward
command to expose the service:
kubectl port-forward service/dtias-flask-api-service 5000:5000
From your local machine, you can perform a curl
command:
curl -I http//127.0.0.1:5000/flcm-gui
Expected Response:
HTTP/1.1 200 OK
Server: Werkzeug/3.0.1 Python/3.9.18
Date: Tue, 16 Jan 2024 16:59:13 GMT
Content-Type: application/json
Content-Length: 4
Connection: close
The application makes a simple GET request to http://flcm-ui-service:80/gui/
Test a GET request to google:
curl -I http://127.0.0.1:5000/google
These are the only two valid requests for this basic application.
From a browser, navigate to http//127.0.0.1:5000/flcm-gui
.
A valid response outputs a 200 message.
Uninstall the application by running an uninstall job.
**POST** https://dtias_ip/v1/tenants/{Tenant}/job