Skip to content

list async jobs for a resource type#13011

Merged
sureshanaparti merged 1 commit intoapache:4.22from
shapeblue:async-jobs-resource-filtering-update
Apr 14, 2026
Merged

list async jobs for a resource type#13011
sureshanaparti merged 1 commit intoapache:4.22from
shapeblue:async-jobs-resource-filtering-update

Conversation

@sureshanaparti
Copy link
Copy Markdown
Contributor

Description

This PR allows list async jobs for a resource type (VirtualMachine/Volume/etc)

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@sureshanaparti sureshanaparti force-pushed the async-jobs-resource-filtering-update branch from c378e9d to 6a6ebbe Compare April 13, 2026 12:13
@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.61%. Comparing base (ae455ee) to head (e2eb7de).
⚠️ Report is 4 commits behind head on 4.22.

Files with missing lines Patch % Lines
...ain/java/com/cloud/api/query/QueryManagerImpl.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #13011   +/-   ##
=========================================
  Coverage     17.60%   17.61%           
- Complexity    15688    15692    +4     
=========================================
  Files          5919     5919           
  Lines        532005   532004    -1     
  Branches      65060    65060           
=========================================
+ Hits          93683    93695   +12     
+ Misses       427755   427744   -11     
+ Partials      10567    10565    -2     
Flag Coverage Δ
uitests 3.70% <ø> (ø)
unittests 18.68% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 17468

@sureshanaparti sureshanaparti force-pushed the async-jobs-resource-filtering-update branch from 6a6ebbe to e2eb7de Compare April 13, 2026 14:03
@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17469

Copy link
Copy Markdown
Member

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Tested the api calls (list asyncjobs and query asyncjobresult) with resourcetype and resourceid parameters

list asyncjobs resourcetype=<> resourceid=<>

list asyncjobs resourcetype=<>

query asyncjobresult resourcetype=<> resourceid=<>

Sample

(localcloud) 🐱 > list asyncjobs resourcetype=VirtualMachine
{
  "asyncjobs": [
    {
      "account": "admin",
      "accountid": "c0b7685d-371d-11f1-8b66-1e00d80002e8",
      "cmd": "org.apache.cloudstack.api.command.admin.vm.StartVMCmdByAdmin",
      "created": "2026-04-14T09:25:51+0000",
      "domainid": "7f740ce2-371d-11f1-8b66-1e00d80002e8",
      "domainpath": "ROOT",
      "jobid": "786b5392-e575-4f3b-a198-dec8a64598dc",
      "jobinstanceid": "69fd8295-0809-4a9f-ab61-60ff42bfb189",
      "jobinstancetype": "VirtualMachine",
      "jobprocstatus": 0,
      "jobresultcode": 0,
      "jobstatus": 0,
      "managementserverid": "86e26ae0-b43c-45a1-86a9-96458553a33a",
      "managementservername": "ref-trl-11563-k-mol8-kiran-chavala-mgmt1.sofia.shapeblue.com",
      "userid": "c0b8df47-371d-11f1-8b66-1e00d80002e8"
    }
  ],
  "count": 1
}
(localcloud) 🐱 > query asyncjobresult resourcetype=VirtualMachine resourceid=69fd8295-0809-4a9f-ab61-60ff42bfb189
{
  "account": "admin",
  "accountid": "c0b7685d-371d-11f1-8b66-1e00d80002e8",
  "cmd": "org.apache.cloudstack.api.command.admin.vm.StartVMCmdByAdmin",
  "created": "2026-04-14T09:25:51+0000",
  "domainid": "7f740ce2-371d-11f1-8b66-1e00d80002e8",
  "domainpath": "ROOT",
  "jobid": "786b5392-e575-4f3b-a198-dec8a64598dc",
  "jobinstanceid": "69fd8295-0809-4a9f-ab61-60ff42bfb189",
  "jobinstancetype": "VirtualMachine",
  "jobprocstatus": 0,
  "jobresultcode": 0,
  "jobstatus": 0,
  "managementserverid": "86e26ae0-b43c-45a1-86a9-96458553a33a",
  "managementservername": "ref-trl-11563-k-mol8-kiran-chavala-mgmt1.sofia.shapeblue.com",
  "userid": "c0b8df47-371d-11f1-8b66-1e00d80002e8"
}
(localcloud) 🐱 > list asyncjobs resourcetype=VirtualMachine resourceid=69fd8295-0809-4a9f-ab61-60ff42bfb189
(localcloud) 🐱 > list asyncjobs resourcetype=VirtualMachine resourceid=69fd8295-0809-4a9f-ab61-60ff42bfb189
{
  "asyncjobs": [
    {
      "account": "admin",
      "accountid": "c0b7685d-371d-11f1-8b66-1e00d80002e8",
      "cmd": "org.apache.cloudstack.api.command.admin.vm.StopVMCmdByAdmin",
      "created": "2026-04-14T09:27:02+0000",
      "domainid": "7f740ce2-371d-11f1-8b66-1e00d80002e8",
      "domainpath": "ROOT",
      "jobid": "3e976fc8-bdba-4b82-98be-48d616312b1d",
      "jobinstanceid": "69fd8295-0809-4a9f-ab61-60ff42bfb189",
      "jobinstancetype": "VirtualMachine",
      "jobprocstatus": 0,
      "jobresultcode": 0,
      "jobstatus": 0,
      "managementserverid": "86e26ae0-b43c-45a1-86a9-96458553a33a",
      "managementservername": "ref-trl-11563-k-mol8-kiran-chavala-mgmt1.sofia.shapeblue.com",
      "userid": "c0b8df47-371d-11f1-8b66-1e00d80002e8"
    }
  ],
  "count": 1
}
(localcloud) 🐱 > query asyncjobresult resourcetype=VirtualMachine resourceid=69fd8295-0809-4a9f-ab61-60ff42bfb189
{
  "account": "admin",
  "accountid": "c0b7685d-371d-11f1-8b66-1e00d80002e8",
  "cmd": "org.apache.cloudstack.api.command.admin.vm.StopVMCmdByAdmin",
  "completed": "2026-04-14T09:27:05+0000",
  "created": "2026-04-14T09:27:02+0000",
  "domainid": "7f740ce2-371d-11f1-8b66-1e00d80002e8",
  "domainpath": "ROOT",
  "jobid": "3e976fc8-bdba-4b82-98be-48d616312b1d",
  "jobinstanceid": "69fd8295-0809-4a9f-ab61-60ff42bfb189",
  "jobinstancetype": "VirtualMachine",
  "jobprocstatus": 0,
  "jobresult": {
    "virtualmachine": {
      "account": "admin",
      "affinitygroup": [],
      "cpunumber": 1,
      "cpuspeed": 500,
      "cpuused": "0%",
      "created": "2026-04-13T10:11:55+0000",
      "details": {
        "Message.ReservedCapacityFreed.Flag": "false",
        "cpuOvercommitRatio": "2.0"
      },
      "diskioread": 0,
      "diskiowrite": 0,
      "diskkbsread": 0,
      "diskkbswrite": 0,
      "displayname": "test",
      "displayvm": true,
      "domain": "ROOT",
      "domainid": "7f740ce2-371d-11f1-8b66-1e00d80002e8",
      "guestosid": "7f9ddbe2-371d-11f1-8b66-1e00d80002e8",
      "haenable": false,
      "hasannotations": false,
      "hypervisor": "KVM",
      "id": "69fd8295-0809-4a9f-ab61-60ff42bfb189",
      "instancename": "i-2-3-VM",
      "isdynamicallyscalable": false,
      "jobid": "3e976fc8-bdba-4b82-98be-48d616312b1d",
      "jobstatus": 0,
      "lastupdated": "2026-04-14T09:27:05+0000",
      "memory": 512,
      "memoryintfreekbs": -1,
      "memorykbs": 524288,
      "memorytargetkbs": 524288,
      "name": "test",
      "networkkbsread": 0,
      "networkkbswrite": 0,
      "nic": [
        {
          "deviceid": "0",
          "extradhcpoption": [],
          "gateway": "10.1.1.1",
          "id": "3e4cfda4-f574-4af7-84f3-78d14b023425",
          "ipaddress": "10.1.1.128",
          "isdefault": true,
          "macaddress": "02:01:00:cc:00:01",
          "netmask": "255.255.255.0",
          "networkid": "22bd44ba-36b9-4e5d-a14e-799e2f4e8016",
          "networkname": "test",
          "secondaryip": [],
          "traffictype": "Guest",
          "type": "Isolated"
        }
      ],
      "osdisplayname": "CentOS 5.5 (64-bit)",
      "ostypeid": "7f9ddbe2-371d-11f1-8b66-1e00d80002e8",
      "passwordenabled": false,
      "pooltype": "NetworkFilesystem",
      "receivedbytes": 0,
      "rootdeviceid": 0,
      "rootdevicetype": "ROOT",
      "securitygroup": [],
      "sentbytes": 0,
      "serviceofferingid": "d6fbfcd8-aa18-40f4-b5d4-c96f9ff4a292",
      "serviceofferingname": "Small Instance",
      "state": "Stopped",
      "tags": [],
      "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
      "templateid": "7f7b47e0-371d-11f1-8b66-1e00d80002e8",
      "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
      "userid": "c0b8df47-371d-11f1-8b66-1e00d80002e8",
      "username": "admin",
      "zoneid": "4346705d-480b-42a2-8fac-a2c3e0414c74",
      "zonename": "ref-trl-11563-k-Mol8-kiran-chavala"
    }
  },
  "jobresultcode": 0,
  "jobresulttype": "object",
  "jobstatus": 1,
  "userid": "c0b8df47-371d-11f1-8b66-1e00d80002e8"
}

(localcloud) 🐱 > query asyncjobresult resourceid=69fd8295-0809-4a9f-ab61-60ff42bfb189
🙈 Error: (HTTP 431, error code 4350) Both resourceid and resourcetype required
(localcloud) 🐱 > list asyncjobs resourceid=69fd8295-0809-4a9f-ab61-60ff42bfb189
🙈 Error: (HTTP 431, error code 4350) resourceid parameter must be used with resourcetype parameter



@kiranchavala
Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@kiranchavala a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@sureshanaparti sureshanaparti merged commit 38abe2d into apache:4.22 Apr 14, 2026
24 of 26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.22.1 Apr 14, 2026
@sureshanaparti sureshanaparti deleted the async-jobs-resource-filtering-update branch April 14, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants