Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for capsule content counts #1017

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Oct 18, 2023

Description of changes

This PR adds

  1. support for capsule content count endpoints added in 6.15/stream
  2. a few fields that appear useful to me and API returns them already
Upstream API documentation, plugin, or feature links

https://<<SAT_FQDN>>/apidoc/v2/capsule_content.en.html

Functional demonstration
# Demonstrate functional Snapshot read in ipython
In [1]: from robottelo.hosts import Satellite
In [2]: sat = Satellite('satellite.redhat.com')
In [3]: ngc = sat.api.Capsule().search(query={'search': f'name=capsule.redhat.com'})[0]
In [4]: ngc.content_counts()
Out[4]: 
{'content_view_versions': {'4': {'repositories': {'4': {'rpm': 58,
     'erratum': 32,
     'rpm.repo_metadata_file': 1},
    '10': {'rpm': 32,
     'erratum': 4,
     'package_group': 2,
     'rpm.packagecategory': 1}},
   'cv_version_content_counts': {'rpm': 90,
    'erratum': 36,
    'package_group': 2,
    'rpm.packagecategory': 1,
    'rpm.repo_metadata_file': 1}}}}
In [5]: ngc.content_update_counts()
Out[5]: 
{'id': '0d498591-fda8-4287-b5e3-3c577de28967',
 'label': 'Actions::Katello::CapsuleContent::UpdateContentCounts',
 'pending': False,
 'action': 'Update Content Counts',
 'username': 'admin',
 'started_at': '2023-10-18 13:42:19 UTC',
 'ended_at': '2023-10-18 13:42:20 UTC',
 'duration': '0.555393',
 'state': 'stopped',
 'result': 'success',
 'progress': 1.0,
 'input': {'smart_proxy_id': 2,
  'current_request_id': '40535e72-ded4-445d-b187-5015d2a7d198',
  'current_timezone': 'UTC',
  'current_organization_id': None,
  'current_location_id': None,
  'current_user_id': 4},
 'output': {},
 'humanized': {'action': 'Update Content Counts',
  'input': [],
  'output': '',
  'errors': []},
 'cli_example': None,
 'start_at': '2023-10-18 13:42:19 UTC',
 'available_actions': {'cancellable': False, 'resumable': False}}

@vsedmik vsedmik added enhancement No-CherryPick PR doesnt need CherryPick to previous branches Stream labels Oct 18, 2023
@vsedmik vsedmik self-assigned this Oct 18, 2023
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (f714255) 92.15% compared to head (9b05162) 92.18%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1017      +/-   ##
==========================================
+ Coverage   92.15%   92.18%   +0.02%     
==========================================
  Files           6        6              
  Lines        3047     3057      +10     
==========================================
+ Hits         2808     2818      +10     
  Misses        239      239              
Files Coverage Δ
nailgun/entities.py 91.33% <100.00%> (+0.03%) ⬆️

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

Copy link
Contributor

@sambible sambible left a comment

Choose a reason for hiding this comment

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

lgtm

@sambible sambible merged commit b13aee3 into SatelliteQE:master Oct 20, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement No-CherryPick PR doesnt need CherryPick to previous branches Stream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants