HCL Workload Automation, Version 9.4

resource

Use the resource command to create, modify, associate, query, or set resources online or offline.

By correctly configuring the CLIConfig.properties file on the agent, you can run this command also from any connected HCL Workload Automation agent. See Using the resource command from an agent for details.

Syntax

resource ?

resource [-usr user_name -pwd password ]
{
[-create{ -logical name -type type[-quantity quantity ][-offline ] |
-group name[-offline ]}]
|
[-delete{-logical name |
-group name }]
|
[-update{-computer name{[ -setOnline | -setOffline]} |
-logical name
[-setName name]
[-setType type]
[-setQuantity quantity]
[-setOnline | -setOffline]
[-addComputer name |
-addComputerByID ID |
-removeComputer name |
-removeComputerByID ID]
|
-group name
[-setName name]
[-setOnline | -setOffline]
[-addComputer name |
-addComputerByID ID |
-removeComputer name |
-removeComputerByID ID |
-addLogical name |
-removeLogical name]}]
|
[-query{-computer name [-v] |
-logical name [-v] |
-group name [-v]}
[-configFile configuration_file]
}

Description

Use this command to work with computers, logical resources, and resource groups. In particular it is possible to:
  • Create, update, list, and delete logical resources or groups
  • Create logical resources, associate them to computers, define groups of logical resources or computers, and set them online or offline
  • Retrieve and update resource properties using the query and the update options
  • Discover the list of computers associated to a logical resource performing a detailed query on the logical resource
  • Change the association between computers and logical resources
  • Set resources online or offline and query computer properties

Options

?
Displays help information.
-usr user_name
Specifies the user name for a user authorized to perform operations on the command line. This option is required when security is enabled and the user name is not defined in the CLIConfig.properties configuration file (with the tdwb_user keyword).
-pwd password
Specifies the password for a user authorized to perform operations on the command line. This option is required when security is enabled and the password is not defined in the CLIConfig.properties configuration file (with the tdwb_pwd keyword).
-create -logical name -type type
Creates the logical resource with the specified name and type. It is also possible to set a specific quantity or set the resource offline by using optional parameters in the following way:
-create -logical name -type type-quantity quantity -offline
-create -group name
Creates the resource group with the specified name. It is also possible to set it offline by using the -offline optional parameter in the following way:
-create -group name -offline
-delete -logical name
Deletes the logical resource with the specified name.
-delete -group name
Deletes the resource group with the specified name.
-update -computer name
Updates the computer system with the specified name. You can set the computer online or offline as follows:
-update -computer name -setOnline
Sets the specified computer online.
-update -computer name -setOffline
Sets the specified computer offline.
-update -logical name
Updates the specified logical resource. You can update the properties and status of a resource in the following ways:
-update -logical name -setName name
Updates the name of the specified logical resource.
-update -logical name -setType type
Updates the type of the specified logical resource.
-update -logical name -setQuantity quantity
Updates the quantity of the specified logical resource.
-update -logical name -setOnline
Sets online the specified logical resource.
-update -logical name -setOffline
Sets offline the specified logical resource.
You can change the association between a logical resource and a computer in the following ways:
-update -logical name -addComputer name
Associates the specified logical resource to the computer with the specified name.
-update -logical name -addComputerByID ID
Associates the specified logical resource to the computer with the specified ID.
-update -logical name -removeComputer name
Removes the association between the specified logical resource and the computer with the specified name.
-update -logical name -removeComputerByID ID
Removes the association between the specified logical resource and the computer with the specified ID.
-update -group name
Updates the specified resource group. You can update the properties and status of a resource group in the following ways:
-update -group name -setName name
Updates the name of the specified resource group.
-update -group name -setOnline
Sets online the specified resource group.
-update -group name -setOffline
Sets offline the specified resource group.
You can add and remove logical resources or computers to and from a resource group in the following ways:
-update -group name -addLogical name
Adds the logical resource with the specified name to the resource group.
-update -group name -removeLogical name
Removes the logical resource with the specified name from the resource group.
-update -group name -addComputer name
Adds the computer with the specified name to the resource group.
-update -group name -addComputerByID ID
Adds the computer with the specified ID to the resource group.
-update -group name -removeComputer name
Removes the computer with the specified name from the resource group.
-update -group name -removeComputerByID ID
Removes the computer with the specified ID from the resource group.
-query -computer name
Retrieves the following properties of the specified computer:
  • Name
  • Computer ID
  • Operating system name
  • Operating system type
  • Operating system version
  • Status
  • Availability status
Retrieves the following additional properties if you add the -v option:
  • Physical memory
  • Virtual memory
  • CPU utilization
  • Free physical memory
  • Free virtual memory
  • Free swap space
  • Allocated physical memory
  • Allocated virtual memory
  • Allocated swap space
  • Processors number
  • Allocated processors number
  • Processor type
  • Processor speed
  • Manufacturer
  • Model
  • Serial number
  • Network interfaces
  • File systems
You can use the asterisk (*) as a wildcard character in the following ways:
As a single parameter
You must enclose it between double quotation marks, for example:
C:\HCL\TWA\TDWB\bin>resource –query –computer "*"
This command returns a list of all existing computers.
To complete a computer name
You must enclose the entire name between double quotation marks, for example:
C:\HCL\TWA\TDWB\bin> resource –query –computer "lab123*"
This command returns a list of all existing computers with a name starting with lab123.
-query -logical name
Retrieves the name and the type of the specified logical resource. Retrieves the following additional properties if you add the -v option:
  • Status
  • Quantity
  • Current allocation
  • Computers list
You can use the asterisk (*) as a wildcard character in the following ways:
As a single parameter
You must enclose it between double quotation marks, for example:
C:\HCL\TWA\TDWB\bin>resource –query –logical "*"
This command returns a list of all existing logical resources.
To complete a resource name
You must enclose the entire name between double quotation marks, for example:
C:\HCL\TWA\TDWB\bin> resource –query –logical "myRes*"
This command returns a list of all existing logical resources with a name starting with myRes.
-query -group name
Retrieves the name and the status of the specified resource group. Retrieves the list of computers and of logical resources contained in the resource group if you use the –v option.
You can use the asterisk (*) as a wildcard character in the following ways:
As a single parameter
You must enclose it between double quotation marks, for example:
C:\HCL\TWA\TDWB\bin>resource –query –group "*"
This command returns a list of all existing resource groups.
To complete a resource group name
You must enclose the entire name between double quotation marks, for example:
C:\HCL\TWA\TDWB\bin> resource –query –group "myResGrou*"
This command returns a list of all existing resource groups with a name starting with myResGrou.
-configFile configuration_file
Specifies the name and the path of a custom configuration file. This keyword is optional. If you do not specify it, the default configuration file is assumed. For more information on the configuration file, see the section about the CLIConfig.properties.

Authorization

The user name and password for the command are defined in the CLIConfig.properties file. To override the settings defined in this file, you can enter the user name and the password when you type the command. For more information on the CLIConfig.properties file, see the section about the CLIConfig.properties.

Return Values

The resource command returns one of the following values:
0
Indicates that the command completed successfully.
< > 0
Indicates that the command failed.

Examples

  • To create a logical resource named myApplication, of type Applications, type the following command:
    resource.bat -usr john -pwd BXVFDCGS -create -logical myApplication 
    -type Applications
    The following output is displayed:
    AWKCLI153I Logical resource "myApplication" created.
  • To update the quantity of the logical resource named myApplication, type the following command:
    resource.bat -update -logical myApplication -setQuantity 5 
    -usr john -pwd BXVFDCGS
    The following output is displayed:
    AWKCLI165I Logical resource "myApplication" updated.
  • To add the relationship between a logical resource and a computer, type the following command:
    resource.bat -update -logical myApplication -addComputer myComputer 
    -usr john -pwd BXVFDCGS
    The following output is displayed:
    AWKCLI165I Logical resource "myApplication" updated.
  • To retrieve details of a logical resource named myApplication, type the following command:
    resource.bat -usr john -pwd BXVFDCGS -query -logical myApplication –v
    The following output is displayed:
    AWKCLI171I Calling the resource repository to perform a query on resources.
    
    AWKCLI172I "1" logical resources were found for your query.
    Details are as follows:
    
    Resource Name:myApplication
    Resource Type:Applications
    Resource Status:Online
    Resource Quantity:5
    Resource Current Allocation:0
    Computers List:
            Computer Name:myComputer
            Computer ID:D656470E8D76409F9F4FDEB9D764FF59
            Computer Status:Online
            Computer Availability Status:Unavailable
  • To set the logical resource named myApplication offline, type the following command:
    resource.bat -usr john -pwd BXVFDCGS -update -logical myApplication 
    -setOffline
    The following output is displayed:
    AWKCLI165I Logical resource "myApplication" updated.
  • To set the computer named myComputer offline, type the following command:
    resource.bat -usr john -pwd BXVFDCGS -update -computer myComputer 
    -setOffline
    The following output is displayed:
    AWKCLI165I Computer "myComputer" updated.
  • To retrieve basic properties of the computer named myComputer, type the following command:
    resource.bat -usr john -pwd BXVFDCGS -query -computer myComputer
    The following output is displayed:
    AWKCLI171I Calling the resource repository to perform a query on resources.
    AWKCLI174I "1" computers were found for your query.
    Details are as follows:
    
    
    Computer Name: myComputer
    Computer ID:D656470E8D76409F9F4FDEB9D764FF59
    Computer OS Name: Microsoft Windows XP Professional English (United States) version
    Computer OS Type:Windows XP
    Computer OS Version:5
    Computer Status:Offline
    Computer Availability Status:Unavailable
  • To retrieve detailed properties of the computer named myComputer, type the following command:
    resource.bat -usr john -pwd BXVFDCGS -query -computer myComputer -v
    The following output is displayed:
    AWKCLI171I Calling the resource repository to perform a query on resources.
    AWKCLI174I "1" computers were found for your query.
    Details are as follows:
    
    
    Computer Name: myComputer
    Computer ID:D656470E8D76409F9F4FDEB9D764FF59
    Computer OS Name:Microsoft Windows XP Professional English (United States) version
    Computer OS Type:Windows XP
    Computer OS Version:5
    Computer Status:Offline
    Computer Availability Status:Unavailable
    Computer details:
            Physic memory = 2095536.0
            Virtual memory = 3513788.0
            Cpu utilization = 16.0
            Free physic memory = 947972.0
            Free virtual memory = 2333484.0
            Free swap space = 52.0
            Allocated physic memory = 0.0
            Allocated virtual memory = 0.0
            Allocated swap space = 0.0
            Processors number = 1.0
            Allocated processors number = 0.0
            Processor type = x86
            Processor speed = 1995.00
            Manufacturer = HCL
            Model = 2668F8G
            Serial number = L3WZYNC
  • To retrieve detailed properties of the logical resource named geneva, including the list of associated computers, type the following command:
    resource.bat -usr john -pwd BXVFDCGS -query -logical geneva -v
    The following output is displayed:
    Setting CLI environment variables....
    AWKCLI171I Calling the resource repository to perform a query on resources.
    AWKCLI172I "1" logical resources were found for your query.
    Details are as follows:
    
    
    Resource Name:geneva
    Resource Type:prod_wks
    Resource Status:Online
    Resource Quantity:1
    Resource Current Allocation:0
    Computers List:
        Computer Name:bd_ff139_1
        Computer ID:666AADE61CBA11E0ACBECD0E6F3527DE
        Computer Status:Online
        Computer Availability Status:Available
        AWKCLI171I Calling the resource repository to perform a query on resources.
  • To create a resource group named myGroup, type the following command:
    resource.bat -usr john -pwd BXVFDCGS -create -group myGroup
    The following output is displayed:
    AWKCLI153I Resource group  "myGroup" created.
  • To retrieve basic properties of a resource group named myGroup, type the following command:
    resource.bat -query -group myGroup
    The following output is displayed:
    Setting CLI environment variables....
    		AWKCLI171I Calling the resource repository to perform a query on resources.
    		AWKCLI173I "1" groups were found for your query.
    		Details are as follows:
    
    
    		Group Name:myGroup
    		Group Status:Online
  • To add the computer named myComputer to a resource group named myGroup, type the following command:
    resource.bat -update -group myGroup  -addComputer myComputer
    The following output is displayed:
    Setting CLI environment variables....
    		AWKCLI165I Resource Group  "myGroup" updated.
  • To retrieve details of a resource group named myGroup, type the following command:
    resource.bat -query -group myGroup -v
    The following output is displayed:
    Setting CLI environment variables....
    		AWKCLI171I Calling the resource repository to perform a query on resources.
    		AWKCLI173I "1" groups were found for your query.
    		Details are as follows:
    
    
    		Group Name:myGroup
    		Group Status:Online
    		Computers List:
    			Computer Name:myComputer
            			Computer ID:D656470E8D76409F9F4FDEB9D764FF59
            			Computer Status:Online
    			Computer Availability Status:Unavailable
    
    		Resources List: