3.2. Resources
3.2.1. List Resources in a Collection (list)
list command to display all resources of a specific type. Lists also include optional search queries to filter results.
list [collection] [options]
Table 3.2. list standard options
| Option | Description |
|---|---|
--show-all | Displays all non-empty properties for each listed resource. Without this option, only the id, name and description properties display. |
--query [QUERY] | Filters the list using a server-side query based upon Red Hat Enterprise Virtualization Manager query language. |
--kwargs [QUERY] | Filters the list using a client-side query. |
--case_sensitive true|false | Match search queries using case sensitivity. |
--max | Maximum number of results for display. |
Note
Example 3.3. Examples for list
[RHEVM shell (connected)]# list vms
[RHEVM shell (connected)]# list vms --show-all
[RHEVM shell (connected)]# list vms --query "status=up"
[RHEVM shell (connected)]# list users --query "usrname=jsmith@*" --case_sensitive false
[RHEVM shell (connected)]# list --help
3.2.2. Show a Resource (show)
show command to display resource properties.
show [resource] [id|name] [options]
Note
Example 3.4. Examples for show
id:
[RHEVM shell (connected)]# show vm fcadfd5f-9a12-4a1e-bb9b-2b9d5c2e04c3
name:
[RHEVM shell (connected)]# show vm RHEL6-Server
3.2.3. Add a Resource (add)
add command to add a new resource.
add [resource] [options]
Note
Example 3.5. Examples for add
[RHEVM shell (connected)]# add vm [vm-options]
[RHEVM shell (connected)]# add user [user-options]
add command can be made synchronous (if supported) by using the expect option:
[RHEVM shell (connected)]# add vm [vm-options] --expect '201-created'
3.2.4. Update a Resource (update)
update command to modify an existing resource.
update [resource] [id|name] [options]
Note
Example 3.6. Examples for update
[RHEVM shell (connected)]# update vm RHEL6-Server [vm-options]
3.2.5. Remove a Resource (remove)
remove command to remove a resource.
remove [resource] [id|name] [options]
Table 3.3. remove standard options
| Option | Description |
|---|---|
--async | Perform an asynchronous removal of the resource. |
--force | Perform a force remove of the resource. This removes all database entries and associations for a particular resource. This action applies only to datacenter and vm resources. |
Note
Example 3.7. Examples for remove
[RHEVM shell (connected)]# remove vm RHEL6-Server
[RHEVM shell (connected)]# remove vm RHEL6-Server --async true
[RHEVM shell (connected)]# remove vm RHEL6-Server --force
3.2.6. Perform Action on a Resource (action)
action command to perform a special function relevant to resource type.
action [resource] [id|name] [action] [options]
Note
Example 3.8. Examples for action
[RHEVM shell (connected)]# action vm RHEL6-Server start
[RHEVM shell (connected)]# action vm RHEL6-Server stop
action command can be made synchronous (if supported) by using the async option:
[RHEVM shell (connected)]# action vm [vm-options] --async false
3.2.7. Using Sub-Resources (--RESOURCE-identifier)
--RESOURCE-identifier [name] option, where RESOURCE is the parent resource type, to target a sub-resource part of a parent resource.
Example 3.9. Examples for creating sub-resources with add
[RHEVM shell (connected)]# add nic --vm-identifier RHEL6-Server [nic-options]
--vm-identifier RHEL6-Server option. This adds a NIC on the RHEL6-Server virtual machine.
[RHEVM shell (connected)]# add disk --vm-identifier RHEL6-Server [user-options]
--vm-identifier RHEL6-Server option. This adds a storage disk on the RHEL6-Server virtual machine.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.