Deploying images to a Wazi as a Service target environment with REST APIs

You can deploy an image from an emulated IBM Z® hardware to a specific Wazi as a Service target environment by using the UUID.

About this task

After a Wazi as a Service target environment is created by using REST APIs, the response contains a UUID that represents the Wazi as a Service target environment. You can use this UUID to deploy images to the target environment.

Procedure

  1. Create a deployment to a Wazi as a Service target environment by using the following REST API. In this example, optional fields are added to specify the IPL parameters or to specify the z/OS® user credential that is required to deploy a created image.
    curl -X POST -k -u wibadmin:password 
    'https://your_tools_server_host_name:9443/wibrest/zdtrs/deploy-services/v1/waziaas/zdt-image' 
    -H 'accept: application/json;charset=utf-8' 
    -H 'Content-Type: application/json;charset=utf-8'
    -d '{
       "general": {
       "label": "sampleLabel", 
       "description": "sampleDescription", 
       "target-uuid": "your_target_system_UUID", 
       "resume": false, 
       "update": false, 
       "image-uuid": "your_image_UUID"}
    }'
  2. After you create a deployment, you can use the following REST API to monitor the progress.
    curl -N --http2 -H 'accept:text/event-stream" -k -u wibadmin:password 
    'https://your_tools_server_host_name:9443/wibrest/zdtrs/monitor-services/v1/provision-status/{your_provision_uuid}'
    If the response is "status": "SUCCEEDED", the deployment is completed. To resume a failed deployment, use the following REST API:
    curl -k -u wibadmin:password -X POST 
    -H 'accept: application/json;charset=utf-8' 
    -H 'Content-Type: application/json;charset=utf-8' 
    -d '{
       "emulator": {"cp":1,"ram":3,"ziip":0},"ipl":{"device-address":"a80","iodfaddress":"0a82","load-suffix":"au"},
       "general": {"label":"docker1","provision-uuid":"11111111-aaaa-bbbb-cccc-222222222222","resume":true},
       "zoscreds": {"username":"zosUsername","password":"zosPassword","private-key":"privateKey"}' 'https://your_tools_server_host_name:9443/wibrest/zdtrs/deploy-services/v1/waziaas/zdtimage'
    
  3. If you need to delete deployment from a Wazi as a Service target environment, use the following REST API. After the deletion is completed, the response displays 200 (OK) status code.
    curl -X DELETE -k -u wibadmin:password 
    'https://your_tools_server_host_name:9443/wibrest/zdtrs/deploy-services/v1/waziaas/zdt-image/your_provision_uuid?force=false&resume=false&preserve=false' 
    -H 'accept: application/json;charset=utf-8'