NAME

Bugzilla::Testopia::Webservice::Environment


EXTENDS

Bugzilla::Webservice


DESCRIPTION

Provides methods for automated scripts to manipulate Testopia Environments


METHODS

check_environment($name, $product)
 Description: Looks up and returns an environment by name.
 Params:      $name - String: name of the environment.
              $product - Integer/String/Object
                         Integer: product_id of the product in the Database
                         String: Product name
                         Object: Blessed Bugzilla::Product object
 Returns:     Hash: Matching Environment object hash or error if not found.
create($values)
 Description: Creates a new environment object and stores it in the database
 Params:      $values - Hash: A reference to a hash with keys and values  
              matching the fields of the environment to be created. 
  +-------------+----------------+-----------+------------------------------------+
  | Field       | Type           | Null      | Description                        |
  +-------------+----------------+-----------+------------------------------------+
  | product_id  | Integer/String | Required  | ID or Name of product              |
  | name        | String         | Required  |                                    |
  | isactive    | Boolean        | Optional  | Defaults to True (1)               |
  +-------------+----------------+-----------+------------------------------------+
 Returns:     The newly created object hash.
get($id)
 Description: Used to load an existing Environment from the database.
 Params:      $id - An integer representing the ID in the database
 Returns:     A blessed Bugzilla::Testopia::Environment object hash
get_caseruns($id)
 Description: Returns the list of case-runs that this Environment is used in.
 Params:      $id -  Integer: Environment ID.
 Returns:     Array: List of case-run object hashes.
get_runs($id)
 Description: Returns the list of runs that this Environment is used in.
 Params:      $id -  Integer: Environment ID.
 Returns:     Array: List of run object hashes.
list($query)
 Description: Performs a search and returns the resulting list of Environments
 Params:      $query - Hash: keys must match valid search fields.
                        +--------------------------+
                        | classification           |
                        | env_products             |
                        | env_categories           |
                        | env_elements             |
                        | env_properties           |
                        | env_expressions          |
                        | name                     |
                        | env_value_selected_type  |
                        +--------------------------+
 Returns:     Array: Matching Environments are retuned in a list of hashes.
update($ids, $values)
 Description: Updates the fields of the selected environment or environments.
 Params:      $ids - Integer  A single environment ID.
              $values - Hash of keys matching Environment fields and the new values 
              to set each field to.
                      +-------------+----------------+
                      | Field       | Type           |
                      +-------------+----------------+
                      | name        | String         |
                      | isactive    | Boolean        |
                      +-------------+----------------+
 Returns:     Hash: The updated environment object hash.


SEE ALSO

the Bugzilla::Testopia::Environment manpage the Bugzilla::Webservice manpage


AUTHOR

Greg Hendricks <ghendricks@novell.com>