Initial configuration
To do the initial configuration, you can use 'curl' to call REST APIs.
About this task
To do the initial configuration by using 'curl' to call
REST APIs, and you need to use your own setup variables to replace
the following italic text. For more information on the descriptions
and available values of each field, refer to the REST API specification
at the following URL:
https://<your-tools-server-host-name>:9443/zdttools/apis/explorer/
.Procedure
- Configure the connection to the image storage server.
curl -k -u zdtadmin:password -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "hostname": "your_ftp_storage_server_host_name", "storageSystemType": "FTP", "baseDirectory": "/data/zdttools", "port": 21, "username": "zdttools", "password": "zdttoolspw" }' 'https://your_tools_server_host_name:9443/ZDTREST/zdtrs/imageStoreServices/FTP' - Configure the connection to the target environments if you want to deploy images to Linux
machines.
curl -k -u zdtadmin:password -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "hostname": "your_target_system_host_name", "sshPort": 22, "label":"zdtForTestingCics", "installOSPackages": true, "concurrentVolumeTransferNumber": 3, "configNetwork": true, "configUser": true, "syntax": "sudo ${command}", "syntaxForValidation": "sudo -n -l", "networkInterface": "eth1"}' 'https://your_tools_server_host_name:9443/ZDTREST/zdtrs/targetEnvServices/targetSystem' - Configure connection to the cloud platform if you want
to deploy images to an OpenStack cloud.
curl -k -u zdtadmin:password -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "endpoint": "mytarget.domain.com:5000", "domain": "ibm", "project": "myProject", "floatingip": true, "snapshot": true, "type": "OpenStack", "network": "your-network-uuid-in-cloud", "flavor": "your-flavor-id-in-cloud", "serverImage": "your-serverimage-uuid-in-cloud", "label": "My Cloud", "installOSPackages": true, "cloudUser": "your-cloud-user-name", "concurrentVolumeTransferNumber": 3, "configNetwork": true, "configUser": true, "syntax": "sudo ${command}", "syntaxForValidation": "sudo -n -l", "networkInterface": "eth1", "availabilityZone": "nova", "floatingIpPoolUuid": "your-cloud-floating-ip-pool-uuid"}}' 'https://your_tools_server_host_name:9443/ZDTREST/zdtrs/targetEnvServices/cloudPlatform' - Configure the connection to the emulator licenses. The
following examples show the configuration of the Software-based License
Server and Rational® Tokens
Server.
curl -k -u zdtadmin:password -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "softwarePrimary":{"hostname": "your_license_server_host_name"}, "softwareSecondary":{"hostname": ""}}' 'https://your_tools_server_host_name:9443/ZDTREST/zdtrs/licenseServices/licensing/software'curl -k -u zdtadmin:password -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "hostname": "your_rational_token_server_host_name", "port": 27000}' 'https://your_tools_server_host_name:9443/ZDTREST/zdtrs/licenseServices/licensing/token' - Configure the connection to z/OS®. This step is required only when you want to extract the date from z/OS systems.
curl -k -u zdtadmin:password -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "hostname": "YOUR_Z_OS_HOST_NAME", "port": 22}' 'https://your_tools_server_host_name:9443/ZDTREST/zdtrs/sourceEnvServices/sourceSystem' - Configure the connection to IBM® Application
Discovery server.
This step is required only when you want to import the data set information from the projects that are defined in IBM Application Discovery.
curl -k -u zdtadmin:password -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "hostname": "your_AD_host_name", "port": 8090,"username": "aduser", "password": "adpw"}' 'https://your_tools_server_host_name:9443/ZDTREST/zdtrs/adServices/AD'
Parent topic: REST API typical examples