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 core app to support NetBox 3.5 #541

Closed
wants to merge 7 commits into from

Conversation

markkuleinio
Copy link
Contributor

@markkuleinio markkuleinio commented Apr 15, 2023

From NetBox 3.5-beta1 release notes:

The JobResult model has been moved from the extras app to core and renamed to Job. Accordingly, its REST API endpoint has been moved from /api/extras/job-results/ to /api/core/jobs/.

Example (after having created a CheckPrefixLength report and running it):

>>> jobs = list(nb.core.jobs.filter())
>>> jobs
[CheckPrefixLength]
>>> pprint.pprint(dict(jobs[0]))
{'completed': '2023-04-15T23:06:50.380572+03:00',
 'created': '2023-04-15T23:06:50.012358+03:00',
 'data': {'test_prefix_lengths': {'failure': 0,
                                  'info': 4,
                                  'log': [['2023-04-15T20:06:50.074076+00:00',
                                           'info',
                                           '2.2.2.2/32',
                                           '/ipam/ip-addresses/2/',
                                           'No parent prefix'],
                                          ['2023-04-15T20:06:50.379922+00:00',
                                           'info',
                                           '3.3.3.3/32',
                                           '/ipam/ip-addresses/3/',
                                           'No parent prefix'],
                                          ['2023-04-15T20:06:50.380069+00:00',
                                           'info',
                                           '4.4.4.4/32',
                                           '/ipam/ip-addresses/4/',
                                           'No parent prefix'],
                                          ['2023-04-15T20:06:50.380489+00:00',
                                           'info',
                                           '192.168.1.1/24',
                                           '/ipam/ip-addresses/1/',
                                           'No parent prefix']],
                                  'success': 7,
                                  'warning': 0}},
 'display': '845c1a8d-565b-417a-a18e-780f9f64a9ca',
 'id': 3,
 'interval': None,
 'job_id': '845c1a8d-565b-417a-a18e-780f9f64a9ca',
 'name': 'CheckPrefixLength',
 'object_id': 1,
 'object_type': 'extras.reportmodule',
 'scheduled': None,
 'started': '2023-04-15T23:06:50.026913+03:00',
 'status': {'label': 'Completed', 'value': 'completed'},
 'url': 'http://netbox-future.lein.io/api/core/jobs/3/',
 'user': {'display': 'admin',
          'id': 1,
          'url': 'http://netbox-future.lein.io/api/users/users/1/',
          'username': 'admin'}}
>>>

@markkuleinio
Copy link
Contributor Author

Reference to the pytest.skip() change: https://docs.pytest.org/en/7.1.x/reference/reference.html#pytest.skip

reason (str) – The message to show the user as reason for the skip.
msg (Optional[str]) – Same as reason, but deprecated. Will be removed in a future version, use reason instead.

@abhi1693
Copy link
Member

This will be superseded by #564 once that's merged.

@abhi1693 abhi1693 closed this Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants