readyview 0.0.3__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: readyview
3
+ Version: 0.0.4
4
+ Summary: ReadyLinks ReadyView API library.
5
+ Project-URL: Homepage, https://gitlab.com/readylinks
6
+ Project-URL: Issues, https://gitlab.com/readylinks
7
+ Author-email: ReadyLinks Developers <developers@ready-links.com>
8
+ License-File: LICENSE
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.8
13
+ Description-Content-Type: text/markdown
14
+
15
+ # ReadyView Dashboard Python Library
16
+
17
+ The ReadyView Dashboard Python library provides all current ReadyView [dashboard API](https://api.readylinks.io/redoc) calls to interface with the ReadyLinks ReadyView cloud-managed platform. ReadyView generates the library based on dashboard API's OpenAPI spec to keep it up to date with the latest API releases, and provides the full source code for the library including the tools used to generate the library. ReadyLinks welcomes constructive pull requests that maintain backwards compatibility with prior versions. The library requires Python 3.10+, receives support from the community, and you can install it via [PyPI](https://pypi.org/project/readyview/):
18
+
19
+ ```
20
+ pip install --upgrdade readyview
21
+ ```
22
+
23
+ ## Usage
24
+ 1. Export your Organization ID and API Key as an environment variable, for example:
25
+ ```
26
+ export READYVIEW_DASHBOARD_ORG_ID=YOUR_ORG_ID
27
+ export READYVIEW_DASHBOARD_API_KEY=YOUR_API_KEY
28
+ ```
29
+ 2. Import the library with a single line at the top of your Python script.
30
+ ```
31
+ import readyview
32
+ ```
33
+ 3. Instantiate the dashboard client.
34
+ ```
35
+ dashboard = readyview.Dashboard()
36
+ ```
37
+ 4. Start programmatically interacting with your ReadyView dashboard!
38
+ ```
39
+ my_networks = dashboard.network.get_networks()
40
+ ```
@@ -0,0 +1,26 @@
1
+ # ReadyView Dashboard Python Library
2
+
3
+ The ReadyView Dashboard Python library provides all current ReadyView [dashboard API](https://api.readylinks.io/redoc) calls to interface with the ReadyLinks ReadyView cloud-managed platform. ReadyView generates the library based on dashboard API's OpenAPI spec to keep it up to date with the latest API releases, and provides the full source code for the library including the tools used to generate the library. ReadyLinks welcomes constructive pull requests that maintain backwards compatibility with prior versions. The library requires Python 3.10+, receives support from the community, and you can install it via [PyPI](https://pypi.org/project/readyview/):
4
+
5
+ ```
6
+ pip install --upgrdade readyview
7
+ ```
8
+
9
+ ## Usage
10
+ 1. Export your Organization ID and API Key as an environment variable, for example:
11
+ ```
12
+ export READYVIEW_DASHBOARD_ORG_ID=YOUR_ORG_ID
13
+ export READYVIEW_DASHBOARD_API_KEY=YOUR_API_KEY
14
+ ```
15
+ 2. Import the library with a single line at the top of your Python script.
16
+ ```
17
+ import readyview
18
+ ```
19
+ 3. Instantiate the dashboard client.
20
+ ```
21
+ dashboard = readyview.Dashboard()
22
+ ```
23
+ 4. Start programmatically interacting with your ReadyView dashboard!
24
+ ```
25
+ my_networks = dashboard.network.get_networks()
26
+ ```
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "readyview"
7
- version = "0.0.3"
7
+ version = "0.0.4"
8
8
  authors = [
9
9
  { name="ReadyLinks Developers", email="developers@ready-links.com" },
10
10
  ]
@@ -1,5 +1,6 @@
1
1
  from . import rest_session
2
2
  from .switch import Switch
3
+ from .network import Network
3
4
  import os
4
5
 
5
6
  class Dashboard:
@@ -8,6 +9,7 @@ class Dashboard:
8
9
  self.api_key = api_key or os.environ.get("READYVIEW_DASHBOARD_API_KEY")
9
10
  self._rest = rest_session.RestSession(self.organization_id, self.api_key)
10
11
  self.switch = Switch(self._rest)
12
+ self.network = Network(self._rest)
11
13
 
12
14
  def display_info(self):
13
15
  return (
@@ -0,0 +1,12 @@
1
+ class Network(object):
2
+ def __init__(self, rest):
3
+ super(Network, self).__init__()
4
+ self._rest = rest
5
+
6
+ def get_networks(self):
7
+ url = f"v2/networks"
8
+ return self._rest.get(url)
9
+
10
+ def get_network(self, id: str):
11
+ url = f"v2/networks/{id}"
12
+ return self._rest.get(url)
@@ -4,11 +4,11 @@ class Switch(object):
4
4
  self._rest = rest
5
5
 
6
6
  def get_ports(self, mac_address: str):
7
- url = f"v1/devices/{mac_address}/switch/ports"
7
+ url = f"v1/devices/{mac_address}/switch/ports/cache"
8
8
  return self._rest.get(url)
9
9
 
10
10
  def get_switch(self, mac_address: str):
11
- url = f"v1/devices/{mac_address}/switch"
11
+ url = f"v1/devices/{mac_address}/switch/cache"
12
12
  return self._rest.get(url)
13
13
 
14
14
  def get_switches(self):
readyview-0.0.3/PKG-INFO DELETED
@@ -1,19 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: readyview
3
- Version: 0.0.3
4
- Summary: ReadyLinks ReadyView API library.
5
- Project-URL: Homepage, https://gitlab.com/readylinks
6
- Project-URL: Issues, https://gitlab.com/readylinks
7
- Author-email: ReadyLinks Developers <developers@ready-links.com>
8
- License-File: LICENSE
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.8
13
- Description-Content-Type: text/markdown
14
-
15
- # Example Package
16
-
17
- This is a simple example package. You can use
18
- [GitHub-flavored Markdown](https://guides.github.com/features/mastering-markdown/)
19
- to write your content.
readyview-0.0.3/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Example Package
2
-
3
- This is a simple example package. You can use
4
- [GitHub-flavored Markdown](https://guides.github.com/features/mastering-markdown/)
5
- to write your content.
File without changes
File without changes