blob: 501cc78de6c5e2b87fd19cb14b080397c7caba26 [file] [log] [blame]
Matteo Scandolod2044a42017-08-07 16:08:28 -07001# 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 Williams045b63d2019-01-22 16:30:57 -070015from __future__ import print_function
16from xosapi import xos_grpc_client
Scott Baker6bb5f262017-03-10 10:53:36 -080017import sys
Zack Williams045b63d2019-01-22 16:30:57 -070018
Scott Baker6bb5f262017-03-10 10:53:36 -080019sys.path.append("..")
20
Scott Baker6bb5f262017-03-10 10:53:36 -080021
22def test_callback():
Zack Williams045b63d2019-01-22 16:30:57 -070023 print("TEST: csr_introspect")
Scott Baker6bb5f262017-03-10 10:53:36 -080024
25 c = xos_grpc_client.coreclient
26
27 for csr in c.xos_orm.CordSubscriberRoot.objects.all():
Zack Williams045b63d2019-01-22 16:30:57 -070028 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 Baker6bb5f262017-03-10 10:53:36 -080041
Zack Williams045b63d2019-01-22 16:30:57 -070042 print(" okay")
43
Scott Baker6bb5f262017-03-10 10:53:36 -080044
45xos_grpc_client.start_api_parseargs(test_callback)