Scroll to navigation

OPENQA-CLI(1) User Contributed Perl Documentation OPENQA-CLI(1)

NAME

openqa-cli - openQA API commandline

ABSTRACT

DESCRIPTION

      # Show api command help with all available options and more examples
      openqa-cli api --help
      # Show details for job from localhost
      openqa-cli api jobs/4160811
      # Show details for job from arbitrary host
      openqa-cli api --host http://openqa.example.com jobs/408
      # Show details for OSD job (prettified JSON)
      openqa-cli api --osd --pretty jobs/4160811
      # Archive job from O3
      openqa-cli archive --o3 408 /tmp/job_408
      Configuration:
        API key and secret are read from "client.conf" or environment
        variables "OPENQA_API_KEY" and "OPENQA_API_SECRET" if not specified
        via CLI arguments. The config file is checked for under
        "$OPENQA_CONFIG", "~/.config/openqa" and "/etc/openqa" in this
        order. It must look like this:
          [openqa.opensuse.org]
          key = 45ABCEB4562ACB04
          secret = 4BA0003086C4CB95
          [another.host]
          key = D7345DA7B9D86B3B
          secret = A98CDBA9C8DB87BD

GLOBAL OPTIONS

    --apibase       API base, defaults to /api/v1                                                                          
    --apikey        API key. Use is discouraged due to risk of leaking credentials. Prefer config file or env variables.   
    --apisecret     API secret. Use is discouraged due to risk of leaking credentials. Prefer config file or env variables.
    --host          Target host, defaults to http://localhost                                                              
    --help -h       Get more information on a specific command (flag)                                                      
    --osd           Set target host to http://openqa.suse.de (flag)                                                        
    --o3            Set target host to https://openqa.opensuse.org (flag)                                                  
    --odn           Set target host to https://openqa.debian.net (flag)                                                    
    --links -L      Print pagination links to STDERR (flag)                                                                
    --name          Name of this client, used by openQA to                                                                 
                    identify different clients via User-Agent                                                              
                    header, defaults to "openqa-cli"                                                                       
    --pretty -p     Pretty print JSON content (flag)                                                                       
    --quiet -q      Do not print error messages to STDERR (flag)                                                           
    --verbose -v    Print HTTP response headers (flag)

SUBCOMMANDS

api

    openqa-cli  api [options] <path> [<parameters>]

Issue an arbitrary request to the API

  Usage: openqa-cli api [OPTIONS] PATH [PARAMS]
  # Show details for job from localhost
  openqa-cli api jobs/4160811
  # Show details for job from arbitrary host
  openqa-cli api --host http://openqa.example.com jobs/408
  # Show details for job from OSD (prettified JSON)
  openqa-cli api --osd --pretty jobs/4160811
  # List all jobs (CAUTION: this might time out for a large instance)
  openqa-cli api --host openqa.example.com jobs
  # List all jobs matching the search criteria
  openqa-cli api --osd jobs groupid=135 distri=caasp version=3.0 latest=1
  # List the latest jobs matching the search criteria
  # supported search criteria: $search_criteria
  openqa-cli api --osd jobs/overview groupid=135 distri=caasp version=3.0
  # Restart a job
  openqa-cli api -X POST jobs/16/restart
  # Delete job (CAUTION: destructive operation)
  openqa-cli api --host openqa.example.com -X DELETE jobs/1
  # Trigger a single job
  openqa-cli api -X POST jobs ISO=foo.iso DISTRI=my-distri \
    FLAVOR=my-flavor VERSION=42 BUILD=42 TEST=my-test
  # Trigger a single set of jobs (see
  # https://open.qa/docs/#spawning-single-new-jobs---jobs-post for details)
  openqa-cli api -X POST jobs \
    TEST:0=first-job TEST:1=second-job _START_AFTER:1=0
  # Trigger jobs on ISO "foo.iso" creating a "scheduled product" (see
  # https://open.qa/docs/#spawning-multiple-jobs-based-on-templates---isos-post
  # for details, e.g for considering to use the `async` flag)
  openqa-cli api --o3 -X POST isos ISO=foo.iso \
    DISTRI=my-distri FLAVOR=my-flavor ARCH=my-arch VERSION=42 BUILD=1234
  # Track scheduled product
  openqa-cli api --o3 isos/1234
  # Change group id for job
  openqa-cli api --json --data '{"group_id":1}' -X PUT jobs/639172
  # Change group id for job (pipe JSON data)
  echo '{"group_id":1}' | openqa-cli api --json -X PUT jobs/639172
  # Post job template
  openqa-cli api -X POST job_templates_scheduling/1 \
    schema=JobTemplates-01.yaml preview=0 template="$(cat foo.yaml)"
  # Post job template (from file)
  openqa-cli api -X POST job_templates_scheduling/1 \
    schema=JobTemplates-01.yaml preview=0 --param-file template=foo.yaml
  # Post job template (from JSON file)
  openqa-cli api --data-file form.json -X POST job_templates_scheduling/1
  # Get job ID(s) filtered by job settings
  openqa-cli api --osd job_settings/jobs key="*_TEST_ISSUES" list_value=39911

Options:

    --header -a      [] One or more additional HTTP headers (<name:value>) (multiple)
    --data-file -D      Load content to send with request from file                  
    --data -d           Content to send with request                                 
    --form -f           Turn JSON object into form parameters (flag)                 
    --json -j           Request content is JSON (flag)                               
    --verbose -v        Print HTTP response headers (flag)                           
    --param-file     [] Load content of params from files instead of (multiple)      
                        from command line arguments. Multiple params                 
                        may be specified by adding the option                        
                        multiple times                                               
    --retries -r        Retry up to the specified value on some                      
                        errors. Retries can also be set by the                       
                        environment variable 'OPENQA_CLI_RETRIES',                   
                        defaults to no retry.                                        
                        Set 'OPENQA_CLI_RETRY_SLEEP_TIME_S' to                       
                        configure the sleep time between retries.                    
    --method -X         HTTP method to use, defaults to GET

Parameters:

    path        *  API route       
    parameters     Query parameters

archive

    openqa-cli  archive [options] <job_id> <path>

Download assets and test results from a job

Usage: openqa-cli archive [OPTIONS] JOB PATH

Options:

    --asset-size-limit -l    Asset size limit in bytes         
    --with-thumbnails -t     Download thumbnails as well (flag)

Parameters:

    job_id  *  ID of the job to archive              
    path    *  Path to directory where to store files

monitor

    openqa-cli  monitor [options] [<job_id>+]

Monitors a set of jobs

Usage: openqa-cli monitor [OPTIONS] [JOB_IDS]

Wait until all specified jobs have reached a final state and return a non-zero exit code if at least one job is not ok (is not passed or softfailed).

Options:

    --poll-interval -i    Specifies the poll interval used with --monitor  
    --follow -f           Use the newest clone of each monitored job (flag)

Parameters:

    job_id   [] Jobs to monitor (multiple)

reservation

    openqa-cli  reservation [options] <worker_id>

Manage worker reservations

Usage: openqa-cli reservation [OPTIONS] WORKER_ID

Options:

    --class -C       Optional class for verification jobs                                    
    --comment -c     Comment describing the reason for reservation                           
    --duration -d    Duration of the reservation (e.g. 5h, 30m, 2d, 0 for indefinite)        
    --force -f       Force reservation even if worker is already reserved (flag)             
    --release -r     Release an existing reservation (flag)                                  
    --worker-host    Reserve or release an entire worker host instead of individual WORKER_ID

Parameters:

    worker_id  *  ID (int) of worker

schedule

    openqa-cli  schedule [options] [<parameters>]

Schedules a set of jobs (via "isos post" creating a schedule product)

Usage: openqa-cli schedule [OPTIONS] DISTRI=… VERSION=… FLAVOR=… ARCH=… [ISO=… …]

Example:

  openqa-cli schedule --o3 \
    --param-file SCENARIO_DEFINITIONS_YAML=scenario-definitions.yaml \
    DISTRI=openQA VERSION=Tumbleweed FLAVOR=dev ARCH=x86_64

Options:

    --param-file         [] Load content of params from files instead of (multiple) 
                            from command line arguments. Multiple params            
                            may be specified by adding the option                   
                            multiple times                                          
    --monitor -m            Wait until all jobs are done/cancelled and return (flag)
                            non-zero exit code if at least on job has not           
                            passed/softfailed                                       
    --follow -f             Use the newest clone of each monitored job (flag)       
    --poll-interval -i      Specifies the poll interval used with --monitor

Parameters:

    parameters    Query parameters (DISTRI=… VERSION=… FLAVOR=… ARCH=… [ISO=… …])
2026-10-20 perl v5.44.0