Skip to content

Commit

Permalink
Version 24.2.1
Browse files Browse the repository at this point in the history
* Fix deprecation (pkg_resources, namespace_packages parameter)
* Change versioning gitpy for manual 24.2.1
* Remove deprecated namespace_packages parameter
* Add Jupyter Notebook example
* Update notebook
  • Loading branch information
gwenblum authored Feb 21, 2024
1 parent 69fafaa commit 7a128f3
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "gitpy_versioning"]
path = gitpy_versioning
url = ../gitpy-versioning.git
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Riverbed SteelScript for SteelCentral AppResponse
Riverbed SteelScript for AppResponse
=================================================

This package provides device specific bindings for interacting
with Riverbed SteelCentral AppResponse devices as part of the Riverbed
with Riverbed AppResponse devices as part of the Riverbed
SteelScript for Python.

For a complete guide to installation, see:
Expand All @@ -12,7 +12,7 @@ For a complete guide to installation, see:
License
=======

Copyright (c) 2019 Riverbed Technology, Inc.
Copyright (c) 2019-2024 Riverbed Technology, Inc.

This software is licensed under the terms and conditions of the MIT License
accompanying the software ("License"). This software is distributed "AS IS" as
Expand Down
85 changes: 85 additions & 0 deletions notebooks/01-appresponse-hostgroups.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set parameters"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"hostname = \"APPRESPONSE.your-corp.net\"\n",
"username = \"USERNAME\"\n",
"password = \"PASSWORD\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Load modules"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import steelscript\n",
"from steelscript.common.service import UserAuth\n",
"from steelscript.appresponse.core.appresponse import AppResponse\n",
"from steelscript.appresponse.core.app import AppResponseApp\n",
"from steelscript.common.datautils import Formatter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Initialize the connection"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ar = AppResponse(host=hostname, auth=UserAuth(username, password))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Fetch data and print in a table"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"headers = ['id', 'name', 'active', 'definition']\n",
"data = [[hg.id, hg.name, hg.data.enabled, hg.data.hosts]\n",
" for hg in ar.classification.get_hostgroups() if hasattr(hg.data,'hosts')\n",
" ]\n",
"Formatter.print_table(data, headers)"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019 Riverbed Technology, Inc.
# Copyright (c) 2019-2024 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License"). This software is distributed "AS IS"
Expand All @@ -7,18 +7,16 @@
from glob import glob

from setuptools import setup, find_packages
from gitpy_versioning import get_version

install_requires = (
'steelscript>=2.0',
'steelscript>=24.2.0',
'sleepwalker>=2.0',
'reschema>=2.0'
)

setup_args = {
'name': 'steelscript.appresponse',
'namespace_packages': ['steelscript'],
'version': get_version(),
'version': '24.2.1',
'author': 'Riverbed Technology',
'author_email': 'eng-github@riverbed.com',
'url': 'http://pythonhosted.org/steelscript',
Expand Down
2 changes: 1 addition & 1 deletion steelscript/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__("pkg_resources").declare_namespace(__name__)
__import__("pkg_resources").declare_namespace(__name__)
1 change: 0 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
__import__("pkg_resources").declare_namespace(__name__)

0 comments on commit 7a128f3

Please sign in to comment.