Creating and managing Wazi as a Service target environments with REST APIs

You can call REST APIs to create and manage Wazi as a Service target environments.

About this task

You can create a Wazi as a Service target environment with a UUID contained in the response by using the REST API. This UUID represents the Wazi as a Service target environment that you create. You can manage the target environment by using the UUID.

To create or manage Wazi as a Service target environments by calling REST APIs, you need to use your own setup variables to replace the italic text in the examples. For more information about the descriptions and available values of each field, see the REST API specification at the following URL:

https://<your-tools-server-host-name>:9443/api/explorer/

Procedure

  1. Use the following REST API to create a Wazi as a Service target environment. After a Wazi as a Service target environment is created, the response contains a UUID that represents the target environment.
    curl -X POST -k -u wibadmin:password 
    'https://your_tools_server_host_name:9443/wibrest/zdtrs/target-environment-services/v1/waziaas'
    -H "accept: application/json;charset=utf-8" 
    -D '{
       "url": "cloud.ibm.com",
       "resource-group-id": "your_resource_group_id", 
       "cos-bucket-name": "your_bucket_name", 
       "cos-region-id": "global", 
       "cos-id": "your_cos_id_crn:v1:bluemix:public:cloud-object-storage:global:a/4094bc65badadaasd016f4651f0788bc:1959c2a4-1212-4edd-1212-2ad591b37c46::", 
       "api-token": "your_API_token",
       "label": "sampleLabel", 
       "description": "sampleDescription", 
       "concurrent-transfers": 4, 
       "vpc-region": "ca-tor", 
       "vpc-region-endpoint": "ca-tor.iaas.cloud.ibm.com", 
       "public-domain": true
       }'
  2. After a Wazi as a Service target environment is created, you can use the following REST APIs to get, update, or delete the target environment.
    Getting a Wazi as a Service target environment
    UUID is required to get a Wazi as a Service target environment. To get a target environment, use the following REST API.
    curl -X GET -k -u wibadmin:password
    'https://your_tools_server_host_name:9443/wibrest/zdtrs/target-environment-services/v1/waziaas/your-target-system-uuid' 
    -H 'accept: application/json;charset=utf-8'
    Updating a Wazi as a Service target environment
    UUID is required to update a Wazi as a Service target environment. To update a target environment, use the following REST API.
    curl -X PUT -k -u wibadmin:password
    'https://<hostname>:9443/wibrest/zdtrs/target-environment-services/v1/waziaas' \
    -H 'accept: application/json;charset=utf-8'  \
    -H 'Content-Type: application/json;charset=utf-8'  \
    -D {
      "label": "updatedLabel",
      "uuid": "your_target_system_uuid"
    }'
    Deleting a Wazi as a Service target environment
    UUID is required to delete a Wazi as a Service target environment. To delete a target environment, use the following REST API. After a target environment is deleted, the response displays 200 (OK) status code.
    curl -X DELETE -k -u wibadmin:password
    'https://<hostname>:9443/wibrest/zdtrs/target-environment-services/v1/waziaas/<UUID>' \
    -H 'accept: application/json;charset=utf-8'  \
    -H 'Content-Type: application/json;charset=utf-8'