8.1 slms commands

8.1.1 slms

The slms command usually takes one of its subcommands as an argument. When used without a subcommand, it prints the list of its subcommands. All subcommands accept --help (or -h), which prints the list of available subcommands/options, and --verbose (or -v), which provides the user with more information about the changes that are being executed. A number of subcommands produce results as a tabular list. These accept the --csv (or -z) option, which tells them to export the output data into CSV format.

HINT: CSV Output

--csv outputs the structured data to the standard output (usually on the screen) by default. To save it to a file, redirect the output with a > sign, for example:

slms appliance --overlays --name appliance1 --csv > appliance1_overlays.csv

Moreover, do not use --verbose together with --csv as it produces additional output and makes the exported data unusable.

8.1.2 slms help

The slms help subcommand command describes all valid options of the related slms subcommand.

HINT: Omitting the help subcommand

If you do not specify any subcommand's switch—such as slms appliance—the behavior is same as in the case of slms help appliance.

8.1.3 slms admin-ui-user

This command is an equivalent to slms-admin-ui-user, see Section 8.2, slms-admin-ui-user.

8.1.4 slms appliance

Usage:

slms appliance options

Lists and manages appliances. The command understands the following options:

--adapt --id appliance_id or --adapt --name appliance_name

Adapts KIWI appliances for use with SLMS.

-l or --list

Lists all appliances if no other option is provided. If the user provides an appliance ID with --id or appliance name with --name, the query will return only the targeted appliance.

To list all available appliances, enter the following:

tux@venus:~> slms appliance --list
----+-------------------+---------------+------------------+-----------
 ID | Name              | Studio ID/kiwi| Status           | Base sys.   
----+-------------------+---------------+------------------+-----------
 1  | SLES11SP1-minimal | 652450        | Ready            | SLES11_SP1
 2  | LAMP-server       | 650851        | Needs adaptation | SLES11_SP2
 3  | SLES11SP2-X       | 650947        | Ready            | SLES11_SP2
----+-------------------+---------------+------------------+-----------
-r or --repos

Lists update repositories for an appliance. Options --id or --name are mandatory.

To list the update repositories of the appliance with ID 6, enter the following:

tux@venus:~> slms appliance --id 6 --repos
----+-----------------------------+---------------+--------------------
 ID | Name                        | Patch Version | Updated At             
----+-----------------------------+---------------+--------------------
 10 | Production Update Reposit.. | 0             | 2013-01-02 09:22:30
 11 | Main Testing Repository     | 0             | 2013-01-02 09:22:30 
----+-----------------------------+---------------+--------------------
-n or --name appliance_name

Provides appliance name for other subcommands.

-i or --id appliance_id

Provides appliance ID for other subcommands.

-e or --set-arch architecture

Sets the CPU architecture for a local KIWI appliance and enables it. Valid options are x86_64, i586, and s390x.

slms appliance --set-arch x86_64 --name jeos1_appliance
-o or --overlays

Shows the overlay files for an appliance.

slms appliance --overlays --id 44
-d or --additional-dependencies

Shows the list of possible additional dependencies such as version freeze or addition of a new package.

slms appliance --additional-dependencies --name lamp_appliance
-x or --exclude-dependency dependency_id

Excludes a dependency from newly created patches.

slms appliance --exclude-dependency --name lamp_appliance
-c or --include-dependency dependency_id

Includes a dependency into newly created patches.

slms appliance --include-dependency --name lamp_appliance
--sync

Synchronizes all data needed for generating appliance update repositories with the recent state.

slms appliance --sync
slms appliance --sync ALL

These previous two commands are identical and will synchronize all appliances available in SLMS.

slms appliance --sync --name magic_appliance

The appliance named magic_appliance will be synchronized.

8.1.5 slms customer

Usage:

slms customer options

Lists and modifies customer information. The command understands the following options:

-l or --list customer_name

Prints detailed information about the specified customer. Note that customer_name does not have to be the whole customer name string, but rather a string contained in the customer name.

-c or --create options

Creates a new customer. You need to provide details about the new customer through additional options (see below for details): --status, --description, --username, --password, --name, or --owner-email.

-m or --modify options

Changes the customer's attributes. You need to provide details about the change through additional options (see below for details): --status, --description, --username, --password, or --rename.

-n or --name customer_name

It either supplies a customer name when creating a new customer (see --create), or you can use it when specifying an existing customer together with options --delete, --modify, or --mirror-details.

-s or --status customer_status

Specifies the customer status when creating or modifying the customer. Allowed values are active or inactive.

-d or --delete

Deletes a customer account specified by either --name or --id.

-r or --rename new_customer_name

Changes the customer's name. Use together with --modify.

-o or --mirror-details

Shows information about mirroring credentials related to the customer specified by --id or --name.

-s or --description description

Changes the description of the customer. Use together with --create or --modify.

-u or --username username

Changes the customer's username. Use together with --create or --modify.

-p or --password password

Changes the customer's password. Use together with --create or --modify.

8.1.6 slms customer contact

Usage:

slms customer contact options

Changes the customer's contact information. The command understands the following options:

-l or --list

Shows the contact of a customer specified with --id or --name.

-id or --customer-id customer_id

Specifies the customer ID. Use with --list, --remove, or --modify.

-n or --customer-name customer_name

Specifies the customer name. Use with --list, --remove, or --modify.

-a or --add

Creates a new contact for a customer (if there is none yet). You need to specify additional contact information with --name, --email, or --password.

-r or --remove

Removes the contact specified with --id or --customer-name.

-m or --modify

Modifies the contact attributes specified with --name, --password, or --email.

-c or --name contact_name

Provides a name for the customer's contact. Use together with --add and --modify.

-p or --passwordpassword

Provides a password for the customer's contact. Use together with --add and --modify.

-e or --emailemail

Provides an e-mail for the customer's contact. Use together with --add and --modify.

8.1.7 slms node

Usage:

slms node options

Lists and manages subscription nodes registered with SLMS. It is useful if you want to do command line filtering based on data. The command understands the following options:

-r node_id or --remove node_id

Deletes a node as identified by its ID number.

-l or --list

Lists all nodes.

tux@venus:~> slms node --list
-------+-----------+-------------+---------+------- --+-------------
NodeID | GUID      | Secret      | Appl ID | Subsc ID | Updt RepoID 
-------+-----------+-------------+---------+------- --+-------------
 1     | lx93i84.. | die94jdgn.. | 1       | 1        | 1          
 2     | die9d9w.. | 12989d84j.. | 2       |          | 2          
-------+-----------+-------------+---------+------- --+-------------
-d or --details node_id

Shows detailed information about the node specified by its ID.

-s or --assign-repo repository_id

Assigns an update repository to one or more nodes specified with --node.

-n or --node node_id

Specifies one or more node IDs for use with other related options. When providing multiple IDs, separate them with commas and avoid spaces between them.

-a or --active YYYY-MM-DD

Filters nodes which are active since the given date. Use together with --list.

-i or --inactive YYYY-MM-DD

Filters nodes which are inactive since the given date. Use together with --list.

8.1.8 slms purge

Usage:

slms purge options

Cleans the SLMS database by removing invalid or unneeded data. The command understands the following options:

--date YYYY-MM-DD

Specifies date for the --jobs and --nodes options.

--appliances

Removes deleted appliances which have no subscriptions assigned. When used together with --force, it removes also appliances that have subscriptions assigned, including the subscriptions.

--subscriptions

Removes subscriptions which are inactive. Only subscriptions older than the date specified with --date will be removed.

--vacuum fast or full

Reclaims the disk space used by deleted database records. full may reclaim more space, but takes much longer and exclusively locks the database table. fast is the default.

--repositories

Removes update repositories which are not used anymore.

--nodes

Removes nodes that have not contacted the server for a period of time. The nodes have to be older than the date specified with the mandatory --date option.

--jobs

Removes jobs which are marked as running. Use together with --date to only remove jobs older than a specified date.

-f or --force

Use together with --appliances to remove existing associated subscriptions.

--rpms

Removes all unused RPM packages from the SLMS repository and database. Unused means packages not included in any of the current appliances or appliance patches. Use if you need to reclaim free disk space.

8.1.9 slms repos

Usage:

slms repos options

Lists and manages mirrored update repositories. The command understands the following options:

-l or --list

Lists all (even unused) repositories.

-u or --list-used

Lists used repositories only.

-n or --list-unused

Lists unused repositories only.

-r or --remove-unused

Removes all unused repositories.

8.1.10 slms subscription

Usage:

slms subscription options

Lists and manages customer subscriptions.

-l or --list

Lists all subscriptions.

-c or --create

Creates a new subscription. The attributes for the new subscription must be provided with other options such as --start-date, --end-date, --nodecount, --appliance-name, --owner, --customer-name or --customer-id, and --active or --inactive.

-m or --modify subscr_id

Changes an existing subscription specified by subscr_id. The subscription attributes can be changed by providing --start-date, --end-date, --nodecount, --active or --inactive.

-i or --inactive

Sets the inactive flag for a subscription. Use together with --create, --modify and --list.

-a or --active

Sets the active flag for a subscription. Use together with --create, --modify and --list.

-s or --start-date YYYY-MM-DD

Sets the start date of the subscription's validity. Use 'None' if you do not want to specify the start date. Use together with --create, --modify and --list.

-e or --end-date YYYY-MM-DD

Sets the end date of the subscription's validity. Use 'None' if you do not want to specify the end date. Use together with --create, --modify and --list.

-n or --nodecount max_nodes

Sets the maximum number of nodes for the subscription. Use together with --create, --modify and --list.

-g or --regenerate_reg_key

Regenerates a registration key. Use together with --modify. The option re-initializes an update repository while copying only RPM packages that appear in any patch, and regenerates the repository metadata. It does not generate any patch itself, so even a rejected patch is not re-created after the option is used. It helps mainly when troubleshooting, and is not needed in a common workflow.

-o or --assign-repo repo_id

Assigns an update repository specified with repo_id to a subscription specified with --subscription_id.

-f or --subscription_id subscr_id

Use to specify the subscription ID together with --list, --remove-repo, or --assign-repo.

-u or --customer-name cust_name

Use to specify a unique customer name together with --list or --create.

-d or --customer-id cust_id

Use to specify the existing customer ID together with --list or --create.

-w or --owner user_email

Supplies the e-mail address when creating a new subscription with --create. Sets the subscription type to testing if provided.

-p or --appliance-name appliance_name

Supplies the appliance name when creating a new subscription with --create.

8.1.11 slms update

Usage:

slms update options

Multi-purpose command to manipulate update repositories. The command understands the following options:

-l or --list

Lists update repositories for an appliance specified with --appliance-id or --appliance-name.

-c or --create-repo repo_name

Creates a new update repository for the appliance specified with --appliance-id or --appliance-name.

-r or --rename new_repo_name

Renames the update repository specified with --repo-id.

-i or repo-id repo_id

Specifies an update repository ID for use with other options such as --rename.

-a or --appliance-id

Specifies an appliance ID for use with other options such as --list.

-p or --create-patch repo_id

Creates a new update patch. Mandatory options are --appliance-name or --appliance-id, and --severity. You can give a patch a specific name with --patch-name ('update' by default). Other available options are --summary, --description, --priority-patch, and --script.

-n or --patch-name patch_name

Gives the patch a name. Use with --create-patch.

-s or --summary patch_summary

Specifies a text summary for a patch. Use with --create-patch.

-S or --script-path file_path

Specifies the path to a file containing a post-update script. Use with --create-patch.

-t or --description description

Specifies a text description for a patch. Use with --create-patch.

-P or --priority-patch

If provided, it will mark the patch as a high priority patch containing only software stack updates. Use with --create-patch.

-y or --severity severity

Specifies a patch severity. Valid options are recommended and security. Use with --create-patch.

-d or --delete repo_id

Deletes an existing update repository.

-u or --publish repo_id

Publishes the content of the testing repository identified by repo_id to the production environment.

-j or --reject repo_id

Rejects the testing repository—it will not be published.

-o or --approve repo_id

Approves the testing repository identified by repo_id. The repository can now be published to customers.

-e or --regenerate repo_id

Regenerates the testing repository.