Matteo Scandolo | d2044a4 | 2017-08-07 16:08:28 -0700 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Zack Williams | 045b63d | 2019-01-22 16:30:57 -0700 | [diff] [blame] | 15 | from __future__ import print_function |
| 16 | from xosapi import xos_grpc_client |
Scott Baker | 6bb5f26 | 2017-03-10 10:53:36 -0800 | [diff] [blame] | 17 | import sys |
Zack Williams | 045b63d | 2019-01-22 16:30:57 -0700 | [diff] [blame] | 18 | |
Scott Baker | 6bb5f26 | 2017-03-10 10:53:36 -0800 | [diff] [blame] | 19 | sys.path.append("..") |
| 20 | |
Scott Baker | 6bb5f26 | 2017-03-10 10:53:36 -0800 | [diff] [blame] | 21 | |
| 22 | def test_callback(): |
Zack Williams | 045b63d | 2019-01-22 16:30:57 -0700 | [diff] [blame] | 23 | print("TEST: csr_introspect") |
Scott Baker | 6bb5f26 | 2017-03-10 10:53:36 -0800 | [diff] [blame] | 24 | |
| 25 | c = xos_grpc_client.coreclient |
| 26 | |
| 27 | for csr in c.xos_orm.CordSubscriberRoot.objects.all(): |
Zack Williams | 045b63d | 2019-01-22 16:30:57 -0700 | [diff] [blame] | 28 | print(" csr", csr.id) |
| 29 | for field_name in [ |
| 30 | "firewall_enable", |
| 31 | "firewall_rules", |
| 32 | "url_filter_enable", |
| 33 | "url_filter_rules", |
| 34 | "cdn_enable", |
| 35 | "uplink_speed", |
| 36 | "downlink_speed", |
| 37 | "enable_uverse", |
| 38 | "status", |
| 39 | ]: |
| 40 | print(" %s: %s" % (field_name, getattr(csr, field_name))) |
Scott Baker | 6bb5f26 | 2017-03-10 10:53:36 -0800 | [diff] [blame] | 41 | |
Zack Williams | 045b63d | 2019-01-22 16:30:57 -0700 | [diff] [blame] | 42 | print(" okay") |
| 43 | |
Scott Baker | 6bb5f26 | 2017-03-10 10:53:36 -0800 | [diff] [blame] | 44 | |
| 45 | xos_grpc_client.start_api_parseargs(test_callback) |