### Start IBM Tivoli Monitoring Language Pack Installer Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=agent-installing-language-packs-linux-unix-computer Navigates to the installation directory and starts the language pack installer script. The '-c install_dir' argument specifies the IBM Tivoli Monitoring installation directory. ```bash cd dir_name lpinstaller.sh -c install_dir ``` -------------------------------- ### System Command Take Action Example Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=commands-creating-custom-take-action-command This example shows how to create a 'Take Action' command to start an MQSeries queue manager using the System Command type. It provides the command syntax with a placeholder for the queue manager name. ```text STRMQM (QMgr) ``` -------------------------------- ### Python Setup Script Example with Maestro Parameters Source: https://www.ibm.com/docs/en/cloudpakw3700/2.2_topic=reference-deployment Illustrates a Python setup script (setup/setup.py) that imports the 'maestro' module to access configuration parameters and execute shell commands. It demonstrates passing parameters to a shell script for token replacement. ```python import json import os import subprocess import sys import maestro parms = maestro.parms subprocess.call('chmod +x *.sh', shell=True) rc = subprocess.call('./setup_agent.sh "%s" %d %s %s' % (parms['agent-dir'], parms['http-port'], parms['iaas-ip'], parms['iaas-port']), shell=True) maestro.check_status(rc, 'setup_agent.sh: rc == %s' % rc) ``` -------------------------------- ### Node Part Installation Script Example Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=scripts-running-lifecycle-virtual-machines Illustrates the process of installing a node part by running its 'install.py' script. It includes downloading, extracting, executing the script, and cleaning up temporary directories upon success. Parameters from the topology document are passed to the script. ```python # Example Python code snippet for install.py (conceptual) import os import shutil tmpdir = "{tmpdir}" part_name = os.path.basename(os.getcwd()) try: # 1. Download and extract part .tgz file (not shown) # os.makedirs(tmpdir, exist_ok=True) # extract_tgz("part.tgz", tmpdir) # 2. Run install.py script # Assuming parameters are passed via environment variables # subprocess.run(["python", os.path.join(tmpdir, "install.py")], check=True) print(f"Running install.py for {part_name}") # 3. Delete tmpdir if successful # shutil.rmtree(tmpdir) print(f"Successfully installed {part_name}") except Exception as e: print(f"Error installing {part_name}: {e}") # Do not delete tmpdir if debug is enabled or deployment failed # raise # Re-raise the exception to indicate failure ``` -------------------------------- ### GET /resources/virtualSystems API Response Example Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=management-classic-virtual-system-instances Example JSON response from the GET /resources/virtualSystems API. This response lists virtual system instances with details such as their creation date, current status, ID, name, owner, and associated pattern. ```json [ { "created": 1245041940730, "currentmessage": null, "currentmessage_text": null, "currentstatus": "RM01036", "currentstatus_text": "Queued", "desiredstatus": "", "desiredstatus_text": null, "id": 6, "name": "futurevs", "owner": "/resources/users/1", "pattern": "/resources/patterns/1", "updated": 1245041940730 }, { "created": 1245356439153, "currentmessage": "RM07045", "currentmessage_text": "The virtual system instance has been deployed and is ready to use", "currentstatus": "RM01006", "currentstatus_text": "Started", "desiredstatus": "", "desiredstatus_text": null, "id": 9, "name": "test virtual system instance", "owner": "/resources/users/1", "pattern": "/resources/patterns/6", "updated": 1245357249316 } ] ``` -------------------------------- ### cbscript.json Example for Application Installation Source: https://www.ibm.com/docs/en/cloudpakw3700/2.2_topic=examples-example-script-package-install-application This JSON configuration defines a script package for installing a specified application. It includes parameters for the command to execute, log file location, script location, timeout, command arguments, and keys for dynamic values like application location and installation arguments. The type is set to APPLICATION. ```json [ { "name": "Install application", "version": "1.0.0", "description": "This script package installs the specified application", "command": "/bin/sh ${WAS_PROFILE_ROOT}/bin/wsadmin.sh", "log": "${WAS_PROFILE_ROOT}/logs/wsadmin.traceout", "location": "/opt/tmp/installapp", "timeout": "0", "commandargs": "-lang jython -f /opt/tmp/installapp/install_app.jy $APP_LOCATION $INSTALL_ARGS", "type": "APPLICATION", "keys": [ { "scriptkey": "APP_LOCATION", "scriptvalue": "" }, { "scriptkey": "INSTALL_ARGS", "scriptvalue": "" } ] } ] ``` -------------------------------- ### Log Viewer Response Structure (JSON) Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=management-file-viewer-manager Example JSON response from the logViewerMgr GET endpoint. It includes TAIL_CONTENT with the log data and NEXT_CHUNK, which indicates the starting point for the next log chunk retrieval. ```json { "NEXT_CHUNK": 214, "TAIL_CONTENT": "************ Start Display Current Environment ************\n\t\t Version number is 1.0.0.1-11776\n Java Version = J2RE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260-20090215_29883 (JIT enabled,AOT enabled)" } ``` -------------------------------- ### PureApplication CLI Command Example Source: https://www.ibm.com/docs/en/cloudpakw3700/2.2_topic=interface-starting-in-interactive-mode This example demonstrates how to initiate a connection to the PureApplication System using the command-line interface. It includes essential arguments for specifying the host, user credentials, and certificate acceptance. ```shell pure -h 127.10.111.22 -u user01 -p password01 --acceptcert ``` -------------------------------- ### Start IBM Tivoli Monitoring Language Pack Installer in Console Mode Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=agent-installing-language-packs-linux-unix-computer Starts the language pack installer script in console mode, which is useful for non-GUI environments. The '-i console' parameter enables console mode. Installation options are selected by entering corresponding numbers. ```bash lpinstaller.sh -c install_dir -i console ``` -------------------------------- ### Create and Navigate to Installation Directory (Shell) Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=packs-unix-linux-systems This snippet shows the commands to create a temporary directory for the installation and then navigate into it. Ensure the directory path does not contain spaces. This is a prerequisite for running the installation script. ```shell mkdir dir_name cd dir_name ``` -------------------------------- ### GET /resources/patterns API Example Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=management-classic-virtual-system-patterns An example of the JSON response from a GET request to the /resources/patterns API endpoint. It shows a list of pattern objects, each with attributes like created, currentstatus, description, id, name, owner, updated, and virtualsystems. ```json [ { "created": 1242965374865, "currentmessage": null, "currentmessage_text": null, "currentstatus": "RM01028", "currentstatus_text": "Read-only", "description": "Single server is a WebSphere Application Server topology or part of a WebSphere Application Server Network Deployment topology. The single node can be used for a development environment, or as part of a multiple node, production environment in which the application configuration is manually duplicated.", "id": 1, "name": "WebSphere single server", "owner": "/resources/users/1", "updated": 1242965392870, "virtualsystems": [ "/resources/virtualsystems/2", "/resources/virtualsystems/4", "/resources/virtualsystems/6" ] }, { "created": 1245007619361, "currentmessage": null, "currentmessage_text": null, "currentstatus": "RM01027", "currentstatus_text": "Draft", "description": "Test pattern", "id": 5, "name": "test pattern", "owner": "/resources/users/1", "updated": 1245007620130, "virtualsystems": [ ] }, etc. ] ``` -------------------------------- ### Create Virtual System Instance (POST) Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=management-classic-virtual-system-instances This snippet demonstrates the structure for creating a classic virtual system instance using the POST method. It requires attributes like 'cloud' or 'environmentProfile', 'name', and 'pattern'. Depending on the environment profile, 'ipGroup' and 'ipAddress' may also be necessary. ```json { "name": "my_instance_name", "pattern": "/resources/patterns/my_pattern_id", "cloud": "/resources/clouds/my_cloud_id", "environmentProfile": "/resources/environmentprofiles/my_environment_profile_id", "endtime": 1678886400000, "parts": [ { "cloud": "/resources/clouds/my_cloud_id", "ipGroup": "/resources/ipgroups/my_ip_group_id", "ipAddress": "192.168.1.100", "hostname": "my_vm_hostname" } ] } ``` -------------------------------- ### Language Pack Silent Installation Response File Example Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=packs-silent-installation-language-agents A sample response file (`ITM_Agent_LP_silent.rsp`) for the silent installation of IBM Tivoli Monitoring Agent Language Packs. It includes configuration for installation mode, chosen install set, and the NLS package folder, with platform-specific path separators noted. ```properties # IBM Tivoli Monitoring Agent Language Pack Silent Installation Operation # #This is a sample response file for silent installation mode for the IBM Tivoli #Monitoring Common Language Pack Installer. #. #This file uses the IBM Tivoli Monitoring Common Agent Language Pack with the #install package as an example. #Note: #This response file is for the INSTALLATION of language packs only. #This file does not support UNINSTALLATION of language packs in silent mode. #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #To successfully complete a silent installation of the the example of Common Agent #localization pack, complete the following steps: # #1.Copy ITM_Agent_LP_silent.rsp to the directory where lpinstaller.bat or #lpinstaller.sh is located (IBM Tivoli Monitoring Agent Language Pack build #location). # #2.Modify the response file so that it is customized correctly and completely for #your site. # Complete all steps listed below in the response file. # #3.After customizing the response file, invoke the silent installation using the #following command: #For Windows: # lpinstaller.bat -f #For UNIX and Linux: # lpinstaller.sh -c -f #Note: is the IBM Tivoli Monitoring base directory. #-------------------------------------------------------------------------------- #-------------------------------------------------------------------------------- #Force silent install mode. #-------------------------------------------------------------------------------- INSTALLER_UI=silent #--------------------------------------------------------------------------------- #Run add and update actions. #--------------------------------------------------------------------------------- CHOSEN_INSTALL_SET=ADDUPD_SET #--------------------------------------------------------------------------------- #NLS Package Folder, where the NLS Packages exist. #For Windows: # Use the backslash-backslash(\\) as a file separator (for example, #C:\\zosgmv\\LCD7-3583-01\\nlspackage). #For UNIX and Linux: # Use the slash-slash (//) as a file separator (for example, #//installtivoli//lpsilenttest//nlspackage). #--------------------------------------------------------------------------------- #NLS_PACKAGE_FOLDER=C:\\zosgmv\\LCD7-3583-01\\nlspackage NLS_PACKAGE_FOLDER=//tmp//LP//nlspackage #--------------------------------------------------------------------------------- #List the packages to process; both variables are required. #Each variable requires that full paths are specified. #Separate multiple entries with a semicolon (;). #For Windows: # Use the backslash-backslash(\\) as a file separator. #For UNIX and Linux: ``` -------------------------------- ### cbscript.json Example for Application Installation Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=examples-example-script-package-install-application This cbscript.json configuration is used to install a specified application. It defines command-line arguments and parameters for the wsadmin.sh script, including the script to execute and any necessary arguments. ```json [ { "name": "Install application", "version": "1.0.0", "description": "This script package installs the specified application", "command": "/bin/sh ${WAS_PROFILE_ROOT}/bin/wsadmin.sh", "log": "${WAS_PROFILE_ROOT}/logs/wsadmin.traceout", "location": "/opt/tmp/installapp", "timeout": "0", "commandargs": "-lang jython -f /opt/tmp/installapp/install_app.jy $APP_LOCATION $INSTALL_ARGS", "type": "APPLICATION", "keys": [ { "scriptkey": "APP_LOCATION", "scriptvalue": "" }, { "scriptkey": "INSTALL_ARGS", "scriptvalue": "" } ] } ] ``` -------------------------------- ### Example `ulimit -a` Output (Bash) Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=system-managing-backup-restore This provides an example output of the `ulimit -a` command, which displays all current resource limits for the user. It highlights that 'file size' should be 'unlimited' for successful backups, and shows other relevant limits. ```bash [ ~]$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 94464 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 8192 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ``` -------------------------------- ### Start Virtual System Instance Source: https://www.ibm.com/docs/en/cloudpakw3700/2.2_topic=patterns-classic-virtual-system-instances Starts the classic virtual system instance. ```python start() ``` -------------------------------- ### Start Derby Network Server Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=server-configuring-advanced-messaging-databases This command starts the Derby network server, which is required for clustered messaging engines. The script location depends on your WebSphere Application Server installation. This command is platform-dependent. ```shell startNetworkServer.sh | .bat ``` -------------------------------- ### List of Volumes in a Volume Group (JSON Example) Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=management-backup-subcomponents This JSON snippet shows an example of how a list of volumes associated with a volume group is represented. It is typically used in GET requests to retrieve volume group details. ```json [ "/deployment/resources/volumes/0a16533e-0202-4fb4-9fc6-f36ac72064f6", "/deployment/resources/volumes/f49ee4f2-7b15-41cb-bd65-947a7ed78371" ] ``` -------------------------------- ### Example of Topology.json with License Information Source: https://www.ibm.com/docs/en/cloudpakw3700/2.2_topic=deployments-license-usage-is-not-tracked-correctly This example illustrates the structure of a 'topology.json' file after license information has been included. It showcases how the 'licenses' attribute, along with other deployment details, is represented. ```json "vm-templates":[ { "parts": [ ... ], "licenses" : [ { "wasce.ptype":"1.1" } ], "node-parts": [ ... ] "persistent":false, "update":{"type":"batch"}, "name":"Web_Application-wasce", "image": { "plugins": [ ... ], "memory":3872.0, "license" [ { "type":"PVU", "pid":"5725L29"} ], "cpu":1.0, "type":"large", "disk":5546.0, "image-id":805, "activators":[ ... ] }, "roles": [ ... ], "packages": [ ... ] ... } ], ``` -------------------------------- ### Get Organization Profiles REST API Examples Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=organizations-organization-profiles Examples for retrieving organization profiles using the REST API. The GET method can be used to fetch a list of all available profiles or a specific profile by its ID. The API expects JSON data and returns success codes 200 or error codes 403 and 500. ```json { "id" : "133b61dc-7ad0-4c6e-b7c8-5d2bd181060d", "updated" : 1452706044569, "created" : 1452706044569, "description" : "", "name" : "OP1", "uuid" : "133b61dc-7ad0-4c6e-b7c8-5d2bd181060d" } ``` -------------------------------- ### Start a Virtual Machine Source: https://www.ibm.com/docs/en/cloudpakw3700/2.2_topic=machines-virtual-start This command initiates the startup process for a virtual machine. It is a core function for managing virtualized compute resources. No specific dependencies are mentioned, and the output is the state change of the virtual machine to 'running'. ```javascript virtualmachine.start() ``` ```javascript admin.virtualmachines[0].start() ``` -------------------------------- ### GET /resources/hypervisors/{id}/certificate Example Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=management-certificates This snippet demonstrates an example response for the GET /resources/hypervisors/{id}/certificate API endpoint. It shows the structure of a hypervisor certificate, including its ID, certificate details, validity period, issuer, serial number, and signature algorithm. This data is typically used for verifying the identity and security of hypervisors within the IBM Cloud Pak W3700 environment. ```json { "id": 1, "certificates": [ "Certificate: 1", "", "Version: 3", "", "Subject: OID.1.2.840.113549.1.9.2=\"1233003790,564d7761726520496e632e\", CN=myhypervisor.mycompany.com, OU=VMware ESX Server Certificate, EMAILADDRESS=ssl-certificates@vmware.com, O=\"VMware, Inc.\", L=Palo Alto, ST=California, C=US", "", "Key: ", " IBMJCE RSA Public Key:", " modulus:", " 1339803331059169396205872003875740052553863051674618430116476617574249", " 5026411738717148849905840700453727318717943418667122434412630187079348", " 6873813288481494146160025627725751470887183385307527405440695734180966", " 8462579382022195458840146325997544446223584485323748610456300364783827", " 68380160577053130037267269337", " public exponent:", " 65537", "", "Validity: ", " From: Mon Jan 26 16:03:11 EST 2009", " To: Mon Mar 27 17:03:11 EDT 2028", "", "Issuer: OID.1.2.840.113549.1.9.2=\"1233003790,564d7761726520496e632e\", CN=myhypervisor.mycompany.com, OU=VMware ESX Server Certificate, EMAILADDRESS=ssl-certificates@vmware.com, O=\"VMware, Inc.\", L=Palo Alto, ST=California, C=US", "", "Serial Number:", " 0", "", "Signature: ", " Algorithm: MD5withRSA", " Algorithm OID: 1.2.840.113549.1.1.4", "", " 0000: 53 73 eb f0 f0 bb 4c 48 ea d4 23 0c 20 e1 4f b7 Ss....LH......O. \n", "0010: aa 7d 64 aa 5f cc c7 a4 fa b0 38 73 9c 94 eb 77 ..d.......8s...w \n", "0020: c8 2a 51 bb 34 7c 2f b6 90 c8 25 f1 e3 90 18 ea ..Q.4........... \n", "0030: bb 63 08 a0 2f 66 c4 36 9a d1 98 29 1f 37 d4 0d .c...f.6.....7.. \n", "0040: 5e 10 20 ac 1c d3 bc 2f 4e e8 b4 65 3d 3e 90 ed ........N..e.... \n", "0050: 90 64 9e f6 d0 f0 a7 31 ba 13 b3 93 69 a3 39 59 .d.....1....i.9Y \n", "0060: 73 c9 f3 4f 22 3c 7e 3d 08 6b 09 6f ac 82 e4 bb s..O.....k.o.... \n", "0070: d6 32 0f ba eb 29 47 20 24 78 1c d2 cb ed fb 4b .2....G..x.....K" ] } ``` -------------------------------- ### Creating Virtual System Instances with deployer.virtualsystems.create Source: https://www.ibm.com/docs/en/cloudpakw3700/2.2_topic=patterns-classic-virtual-system-instances Illustrates how to use the `deployer.virtualsystems.create` method to instantiate classic virtual system instances. It shows options for interactive prompting via a wizard or providing a list of configurations for multiple instances. ```python >>> deployer.virtualsystems.create(['vs1', {'name':'foo',...}]) ``` -------------------------------- ### Maestro Part Installation Data Objects Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=reference-deployment Details the data objects appended to the `maestro` package when part installation scripts start, providing access to part URLs, file URLs, parameters, node information, and deployment details. ```APIDOC ## Part Installation Data Objects ### Description When the agent starts part installation scripts, it appends several data objects to the `maestro` package, providing context and information about the deployment and environment. ### Data Objects - `maestro.parturl` (string; RO): Fully-qualified URL from which the part `.tgz` file was obtained. - `maestro.filesurl` (string; RO): Fully-qualified URL prefix for shared files in storehouse. - `maestro.parms` (JSON object; RO): Associated parameters specified in the topology document. - `maestro.node['java']` (string; RO): Absolute path to the Java executable. - `maestro.node['deployment.id']` (string; RO): The deployment ID (e.g., `d-xxx`). - `maestro.node['tmpdir']` (string; RO): Absolute path to a working directory (cleared after use). - `maestro.node['scriptdir']` (string; RO): Absolute path to the root of the script directory. - `maestro.node['name']` (string; RO): Server name (same as `SERVER_NAME` environment variable). - `maestro.node['instance']['private-ip']` (string; RO): The private IP address of the instance. - `maestro.node['instance']['public-ip']` (string; RO): The public IP address of the instance. - `maestro.node['parts']` (JSON object; RW): Shared with all Python scripts invoked on this node. ### Usage Example ```python print(f"Deployment ID: {maestro.node['deployment.id']}") print(f"Private IP: {maestro.node['instance']['private-ip']}") ``` ### Notes - RO: Read-Only - RW: Read-Write ``` -------------------------------- ### POST /resources/virtualSystems Example (JSON) Source: https://www.ibm.com/docs/en/cloudpakw3700/2.3_topic=management-classic-virtual-system-instances This snippet demonstrates the JSON payload structure for creating a new virtual system via the POST /resources/virtualSystems API endpoint. It includes details for environment profiles, system name, deployment manager configuration, and optional node configurations. Dependencies include valid resource IDs for environment profiles and clouds. ```json { "environmentProfile":"\/resources\/environmentProfiles\/3", "name":"MyTest", "parts":[ { "cloud":"\/resources\/clouds\/5", "count":null, "description":"The administrative manager of a deployment cell", "id":1, "label":"Deployment manager", "nics":[ [ { "ipGroup":"\/resources\/ipGroups\/9" } ] ], "properties":[ { "description":"Number of virtual CPUs required", "key":"numvcpus", "label":"Virtual CPUs", "pclass":"HWAttributes", "type":"integer", "validValues":[ "1", "2", "4", "8" ], "value":"1" }, { "description":"Memory size required in megabytes", "key":"memsize", "label":"Memory size (MB)", "pclass":"HWAttributes", "type":"integer", "value":"2048" }, { "description":"Reserve physical CPUs", "key":"physcpures", "label":"Reserve physical CPUs", "pclass":"HWAttributes", "type":"boolean", "value":"false" }, { "description":"Reserve physical memory", "key":"physmemres", "label":"Reserve physical memory", "pclass":"HWAttributes", "type":"boolean", "value":"false" }, { "description":"This is the cell name of the profile", "key":"cell_name", "label":"Cell name", "pclass":"ConfigWAS", "type":"string", "value":"CloudBurstCell" }, { "description":"This is the node name of the profile", "key":"node_name", "label":"Node name", "pclass":"ConfigWAS", "type":"string", "value":"CloudBurstNode" }, { "description":"List of feature packs", "key":"augment_list", "label":"Feature packs", "pclass":"ConfigWAS", "type":"string", "validValues":[ "none", "batch", "cea", "jpa", "osgi", "sca", "sdo", "xml" ], "value":[ "none" ] }, { "description":"This is the root password for the system", "key":"password", "label":"Password (root)", "pclass":"ConfigPWD_ROOT", "type":"string", "value":"password" }, { "description":"This is the username for the system and websphere", "key":"username", "label":"WebSphere administrative user name", "pclass":"ConfigPWD_USER", "type":"string", "value":"virtuser" }, { "description":"This is the password for the system and WebSphere account", "key":"password", "label":"WebSphere administrative password", "pclass":"ConfigPWD_USER", "type":"string", "value":"password" } ], "scripts":[ { "description":"Configure IBM HTTP Server on node", "id":1, "label":"Add IBM HTTP Server node", "parameters":[ { "key":"ihs", "value":"true" } ] } ], "virtualimage":"\/resources\/virtualImages\/1" }, { "cloud":"\/resources\/clouds\/5", "count":2, "description":"A custom node to be federated into a deployment manager", ```