graphiant-sdk 25.7.1__py3-none-any.whl → 25.8.1__py3-none-any.whl

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.
Files changed (67) hide show
  1. graphiant_sdk/__init__.py +21 -6
  2. graphiant_sdk/api/default_api.py +15423 -9804
  3. graphiant_sdk/api_client.py +1 -1
  4. graphiant_sdk/configuration.py +1 -1
  5. graphiant_sdk/models/__init__.py +20 -5
  6. graphiant_sdk/models/v1_auth_mfa_patch_request.py +87 -0
  7. graphiant_sdk/models/v1_backbone_health_device_device_id_post200_response.py +3 -3
  8. graphiant_sdk/models/v1_bwtracker_enterprise_details_post200_response_bwusage_details.py +11 -2
  9. graphiant_sdk/models/v1_bwtracker_region_site_gateway_summary_post200_response.py +91 -0
  10. graphiant_sdk/models/v1_bwtracker_region_site_gateway_summary_post200_response_bwusage_summary.py +102 -0
  11. graphiant_sdk/models/v1_devices_device_id_config_put_request_edge_interfaces_value_interface.py +6 -2
  12. graphiant_sdk/models/v1_devices_running_version_post200_response_versions_inner.py +3 -3
  13. graphiant_sdk/models/v1_devices_upgrade_schedule_put_request.py +14 -4
  14. graphiant_sdk/models/v1_edges_hardware_assigned_get200_response_edges_summary_inner_upgrade_summary.py +17 -5
  15. graphiant_sdk/models/v1_edges_hardware_assigned_get200_response_edges_summary_inner_upgrade_summary_last_running_version.py +91 -0
  16. graphiant_sdk/models/v1_edges_hardware_assigned_get200_response_edges_summary_inner_upgrade_summary_schedule.py +3 -3
  17. graphiant_sdk/models/v1_global_site_lists_get200_response.py +97 -0
  18. graphiant_sdk/models/v1_global_site_lists_get200_response_entries_inner.py +103 -0
  19. graphiant_sdk/models/v1_global_site_lists_id_get200_response.py +97 -0
  20. graphiant_sdk/models/v1_global_site_lists_id_sites_get200_response_entries_inner.py +3 -3
  21. graphiant_sdk/models/v1_global_site_lists_post_request.py +99 -0
  22. graphiant_sdk/models/v1_global_site_lists_post_request_entries_inner.py +93 -0
  23. graphiant_sdk/models/v1_global_site_lists_post_request_entries_inner_tag.py +91 -0
  24. graphiant_sdk/models/v1_groups_id_members_delete_post_request.py +87 -0
  25. graphiant_sdk/models/v1_groups_id_members_get200_response_users_inner.py +7 -1
  26. graphiant_sdk/models/v1_groups_id_members_post_request.py +5 -3
  27. graphiant_sdk/models/v1_onboarding_cloudinit_get200_response.py +95 -0
  28. graphiant_sdk/models/v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner.py +105 -0
  29. graphiant_sdk/models/v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner_cloudinit_config.py +103 -0
  30. graphiant_sdk/models/v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner_cloudinit_config_interfaces_inner.py +100 -0
  31. graphiant_sdk/models/v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner_cloudinit_config_interfaces_inner_ipv4.py +91 -0
  32. graphiant_sdk/models/v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner_token.py +98 -0
  33. graphiant_sdk/models/v1_software_auto_upgrade_default_get200_response.py +7 -7
  34. graphiant_sdk/models/v1_software_auto_upgrade_default_get200_response_profile.py +97 -0
  35. graphiant_sdk/models/v1_software_auto_upgrade_default_get200_response_profile_occurrence.py +93 -0
  36. graphiant_sdk/models/v1_software_releases_summary_get200_response_summaries_inner.py +6 -1
  37. graphiant_sdk/models/v1_troubleshooting_device_device_id_post200_response.py +3 -3
  38. graphiant_sdk/models/v2_assistant_add_to_conversation_post200_response.py +4 -2
  39. graphiant_sdk/models/v2_assistant_conversation_context_history_post_request.py +87 -0
  40. graphiant_sdk/models/v2_assistant_get_conversations_post200_response.py +5 -3
  41. graphiant_sdk/models/v2_assistant_get_conversations_post200_response_conversation_list_inner.py +5 -3
  42. graphiant_sdk-25.8.1.dist-info/METADATA +384 -0
  43. {graphiant_sdk-25.7.1.dist-info → graphiant_sdk-25.8.1.dist-info}/RECORD +66 -26
  44. test/test_v1_auth_mfa_patch_request.py +53 -0
  45. test/test_v1_bwtracker_region_site_gateway_summary_post200_response.py +61 -0
  46. test/test_v1_bwtracker_region_site_gateway_summary_post200_response_bwusage_summary.py +60 -0
  47. test/test_v1_edges_hardware_assigned_get200_response_edges_summary_inner_upgrade_summary_last_running_version.py +53 -0
  48. test/test_v1_global_site_lists_get200_response.py +63 -0
  49. test/test_v1_global_site_lists_get200_response_entries_inner.py +59 -0
  50. test/test_v1_global_site_lists_id_get200_response.py +59 -0
  51. test/test_v1_global_site_lists_post_request.py +60 -0
  52. test/test_v1_global_site_lists_post_request_entries_inner.py +55 -0
  53. test/test_v1_global_site_lists_post_request_entries_inner_tag.py +53 -0
  54. test/test_v1_groups_id_members_delete_post_request.py +53 -0
  55. test/test_v1_onboarding_cloudinit_get200_response.py +82 -0
  56. test/test_v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner.py +79 -0
  57. test/test_v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner_cloudinit_config.py +67 -0
  58. test/test_v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner_cloudinit_config_interfaces_inner.py +60 -0
  59. test/test_v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner_cloudinit_config_interfaces_inner_ipv4.py +53 -0
  60. test/test_v1_onboarding_cloudinit_get200_response_cloudinit_tokens_inner_token.py +57 -0
  61. test/test_v1_software_auto_upgrade_default_get200_response_profile.py +58 -0
  62. test/test_v1_software_auto_upgrade_default_get200_response_profile_occurrence.py +54 -0
  63. test/test_v2_assistant_conversation_context_history_post_request.py +51 -0
  64. graphiant_sdk-25.7.1.dist-info/METADATA +0 -119
  65. {graphiant_sdk-25.7.1.dist-info → graphiant_sdk-25.8.1.dist-info}/WHEEL +0 -0
  66. {graphiant_sdk-25.7.1.dist-info → graphiant_sdk-25.8.1.dist-info}/licenses/LICENSE +0 -0
  67. {graphiant_sdk-25.7.1.dist-info → graphiant_sdk-25.8.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,384 @@
1
+ Metadata-Version: 2.4
2
+ Name: graphiant_sdk
3
+ Version: 25.8.1
4
+ Summary: Python SDK for Graphiant NaaS
5
+ Home-page: https://www.graphiant.com
6
+ Author: Graphiant Inc
7
+ Author-email: support@graphiant.com
8
+ License: MIT
9
+ Project-URL: Source Code, https://github.com/Graphiant-Inc/graphiant-sdk-python
10
+ Keywords: SDK,Graphiant,NaaS
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: urllib3<3.0.0,>=2.1.0
17
+ Requires-Dist: python-dateutil>=2.8.2
18
+ Requires-Dist: pydantic>=2
19
+ Requires-Dist: typing-extensions>=4.7.1
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: license
28
+ Dynamic: license-file
29
+ Dynamic: project-url
30
+ Dynamic: requires-dist
31
+ Dynamic: summary
32
+
33
+ # Graphiant SDK Python
34
+
35
+ [![PyPI version](https://badge.fury.io/py/graphiant-sdk.svg)](https://badge.fury.io/py/graphiant-sdk)
36
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
37
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
38
+ [![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.graphiant.com/docs/graphiant-sdk-python)
39
+
40
+ A comprehensive Python SDK for [Graphiant Network-as-a-Service (NaaS)](https://www.graphiant.com) offerings, providing seamless integration with Graphiant's network automation platform.
41
+
42
+ Refer [Graphiant Docs](https://docs.graphiant.com) to get started with [Graphiant Network-as-a-Service (NaaS)](https://www.graphiant.com) offerings.
43
+
44
+ ## 📚 Documentation
45
+
46
+ - **Official Documentation**: [Graphiant SDK Python Guide](https://docs.graphiant.com/docs/graphiant-sdk-python) <-> [Graphiant Automation Docs](https://docs.graphiant.com/docs/automation)
47
+ - **API Reference**: [Graphiant SDK Python API Docs](docs/DefaultApi.md) <-> [Graphiant Portal REST API Guide](https://docs.graphiant.com/docs/graphiant-portal-rest-api)
48
+ - **Package**: [PyPI package - graphiant-sdk](https://pypi.org/project/graphiant-sdk)
49
+
50
+ ## ✨ Features
51
+
52
+ - **Complete API Coverage**: Full access to all Graphiant REST API endpoints
53
+ - **Authentication**: Built-in bearer token authentication
54
+ - **Device Management**: Comprehensive device configuration and monitoring
55
+ - **Network Operations**: Circuit management, interface configuration, and routing
56
+ - **Error Handling**: Robust exception handling with detailed error messages
57
+ - **Type Safety**: Full type hints and validation using Pydantic models
58
+ - **CLI Support**: Command-line interface for quick operations
59
+
60
+ ## 🚀 Quick Start
61
+
62
+ ### Installation
63
+
64
+ Install the package from PyPI:
65
+
66
+ ```bash
67
+ pip install graphiant-sdk
68
+ ```
69
+
70
+ ### Basic Usage
71
+
72
+ ```python
73
+ import graphiant_sdk
74
+ from graphiant_sdk.exceptions import (
75
+ ApiException, BadRequestException, UnauthorizedException,
76
+ ForbiddenException, NotFoundException, ServiceException
77
+ )
78
+
79
+ # Create client configuration
80
+ config = graphiant_sdk.Configuration(
81
+ host="https://api.graphiant.com",
82
+ username="your_username",
83
+ password="your_password"
84
+ )
85
+
86
+ # Initialize API client
87
+ api_client = graphiant_sdk.ApiClient(config)
88
+ api = graphiant_sdk.DefaultApi(api_client)
89
+
90
+ # Authenticate and get bearer token
91
+ auth_request = graphiant_sdk.V1AuthLoginPostRequest(
92
+ username=config.username,
93
+ password=config.password
94
+ )
95
+
96
+ try:
97
+ auth_response = api.v1_auth_login_post(v1_auth_login_post_request=auth_request)
98
+ bearer_token = f'Bearer {auth_response.token}'
99
+ print(f"Authentication successful")
100
+ except Exception as e:
101
+ print(f"Authentication failed: {e}")
102
+ exit(1)
103
+
104
+ # Get device summary
105
+ try:
106
+ edges_summary = api.v1_edges_summary_get(authorization=bearer_token)
107
+ print(f"Found {len(edges_summary.edges_summary)} devices")
108
+
109
+ for device in edges_summary.edges_summary:
110
+ print(f"Device: {device.hostname}, Status: {device.status}")
111
+
112
+ except Exception as e:
113
+ print(f"Failed to get device summary: {e}")
114
+ ```
115
+
116
+ ## 🔧 Advanced Usage
117
+
118
+ ### Device Configuration Management
119
+
120
+ ```python
121
+ # Verify device portal status before configuration
122
+ def verify_device_portal_status(api, bearer_token, device_id):
123
+ """Verify device is ready for configuration updates"""
124
+ edges_summary = api.v1_edges_summary_get(authorization=bearer_token)
125
+
126
+ for edge in edges_summary.edges_summary:
127
+ if edge.device_id == device_id:
128
+ if edge.portal_status == "Ready" and edge.tt_conn_count == 2:
129
+ return True
130
+ else:
131
+ raise Exception(f"Device {device_id} not ready. "
132
+ f"Status: {edge.portal_status}, "
133
+ f"TT Connections: {edge.tt_conn_count}")
134
+ return False
135
+
136
+ # Configure device interfaces
137
+ def configure_device_interfaces(api, bearer_token, device_id):
138
+ """Configure device interfaces with circuits and subinterfaces"""
139
+
140
+ # Define circuits
141
+ circuits = {
142
+ "c-gigabitethernet5-0-0": {
143
+ "name": "c-gigabitethernet5-0-0",
144
+ "description": "c-gigabitethernet5-0-0",
145
+ "linkUpSpeedMbps": 50,
146
+ "linkDownSpeedMbps": 100,
147
+ "connectionType": "internet_dia",
148
+ "label": "internet_dia_4",
149
+ "qosProfile": "gold25",
150
+ "qosProfileType": "balanced",
151
+ "diaEnabled": False,
152
+ "lastResort": False,
153
+ "patAddresses": {},
154
+ "staticRoutes": {}
155
+ }
156
+ }
157
+
158
+ # Define interfaces
159
+ interfaces = {
160
+ "GigabitEthernet5/0/0": {
161
+ "interface": {
162
+ "adminStatus": True,
163
+ "maxTransmissionUnit": 1500,
164
+ "circuit": "c-gigabitethernet5-0-0",
165
+ "description": "wan_1",
166
+ "alias": "primary_wan",
167
+ "ipv4": {"dhcp": {"dhcpClient": True}},
168
+ "ipv6": {"dhcp": {"dhcpClient": True}}
169
+ }
170
+ },
171
+ "GigabitEthernet8/0/0": {
172
+ "interface": {
173
+ "subinterfaces": {
174
+ "18": {
175
+ "interface": {
176
+ "lan": "lan-7-test",
177
+ "vlan": 18,
178
+ "description": "lan-7",
179
+ "alias": "non_production",
180
+ "adminStatus": True,
181
+ "ipv4": {"address": {"address": "10.2.7.1/24"}},
182
+ "ipv6": {"address": {"address": "2001:10:2:7::1/64"}}
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
189
+
190
+ # Create configuration request
191
+ edge_config = graphiant_sdk.V1DevicesDeviceIdConfigPutRequestEdge(
192
+ circuits=circuits,
193
+ interfaces=interfaces
194
+ )
195
+
196
+ config_request = graphiant_sdk.V1DevicesDeviceIdConfigPutRequest(
197
+ edge=edge_config
198
+ )
199
+
200
+ try:
201
+ # Verify device is ready
202
+ verify_device_portal_status(api, bearer_token, device_id)
203
+
204
+ # Push configuration
205
+ response = api.v1_devices_device_id_config_put(
206
+ authorization=bearer_token,
207
+ device_id=device_id,
208
+ v1_devices_device_id_config_put_request=config_request
209
+ )
210
+
211
+ print(f"Configuration job submitted. Job ID: {response.job_id}")
212
+ return response
213
+
214
+ except ForbiddenException as e:
215
+ print(f"Permission denied: {e}")
216
+ except Exception as e:
217
+ print(f"Configuration failed: {e}")
218
+ ```
219
+
220
+ ### Error Handling
221
+
222
+ ```python
223
+ def handle_api_errors(func):
224
+ """Decorator for consistent error handling"""
225
+ def wrapper(*args, **kwargs):
226
+ try:
227
+ return func(*args, **kwargs)
228
+ except BadRequestException as e:
229
+ print(f"Bad Request: {e}")
230
+ except UnauthorizedException as e:
231
+ print(f"Unauthorized: {e}")
232
+ except ForbiddenException as e:
233
+ print(f"Forbidden: {e}")
234
+ except NotFoundException as e:
235
+ print(f"Not Found: {e}")
236
+ except ServiceException as e:
237
+ print(f"Service Error: {e}")
238
+ except ApiException as e:
239
+ print(f"API Error: {e}")
240
+ return wrapper
241
+
242
+ @handle_api_errors
243
+ def get_device_info(api, bearer_token, device_id):
244
+ """Get detailed device information"""
245
+ return api.v1_devices_device_id_get(
246
+ authorization=bearer_token,
247
+ device_id=device_id
248
+ )
249
+ ```
250
+
251
+ ## 🛠️ Development
252
+
253
+ ### Prerequisites
254
+
255
+ - Python 3.12+
256
+ - Git
257
+ - OpenAPI Generator (for code generation)
258
+
259
+ ### Building from Source
260
+
261
+ ```bash
262
+ # Clone repository
263
+ git clone git@github.com:Graphiant-Inc/graphiant-sdk-python.git
264
+ cd graphiant-sdk-python
265
+
266
+ # Create virtual environment
267
+ python3 -m venv venv
268
+ source venv/bin/activate # On Windows: venv\Scripts\activate
269
+
270
+ # Install dependencies
271
+ pip install --upgrade pip setuptools wheel
272
+ pip install -r requirements.txt
273
+
274
+ # Build distribution
275
+ python setup.py sdist bdist_wheel
276
+
277
+ # Install locally
278
+ pip install dist/*.tar.gz
279
+ ```
280
+
281
+ ### Code Generation
282
+
283
+ To regenerate the SDK from the latest API specification:
284
+
285
+ ```bash
286
+ # Install OpenAPI Generator
287
+ brew install openapi-generator # macOS
288
+ # or download from: https://github.com/OpenAPITools/openapi-generator
289
+
290
+ # Generate SDK
291
+ openapi-generator generate \
292
+ -i graphiant_api_docs_v25.8.1.json \
293
+ -g python \
294
+ --git-user-id Graphiant-Inc \
295
+ --git-repo-id graphiant-sdk-python \
296
+ --package-name graphiant_sdk \
297
+ --additional-properties=packageVersion=25.8.1
298
+ ```
299
+
300
+ > **Note**: Latest API documentation can be downloaded from the Graphiant portal under "Support Hub" > "Developer Tools".
301
+
302
+ ### Testing
303
+
304
+ ```bash
305
+ # Run tests
306
+ python -m pytest tests/
307
+
308
+ # Run with coverage
309
+ python -m pytest tests/ --cov=graphiant_sdk --cov-report=html
310
+ ```
311
+
312
+ ## 📖 API Reference
313
+
314
+ ### Core Classes
315
+
316
+ - **`Configuration`**: Client configuration with authentication
317
+ - **`ApiClient`**: HTTP client for API requests
318
+ - **`DefaultApi`**: Main API interface with all endpoints
319
+
320
+ ### Key Models
321
+
322
+ - **`V1AuthLoginPostRequest`**: Authentication request
323
+ - **`V1EdgesSummaryGet200Response`**: Device summary response
324
+ - **`V1DevicesDeviceIdConfigPutRequest`**: Device configuration request
325
+
326
+ ### Common Endpoints
327
+
328
+ | Endpoint | Method | Description |
329
+ |----------|--------|-------------|
330
+ | `/v1/auth/login` | POST | Authenticate and get bearer token |
331
+ | `/v1/edges/summary` | GET | Get all device summaries |
332
+ | `/v1/devices/{device_id}` | GET | Get device details |
333
+ | `/v1/devices/{device_id}/config` | PUT | Update device configuration |
334
+ | `/v1/circuits` | GET | List circuits |
335
+ | `/v1/alarms` | GET | Get system alarms |
336
+
337
+ ## 🔐 Security
338
+
339
+ - **Authentication**: Bearer token-based authentication
340
+ - **HTTPS**: All API communications use HTTPS
341
+ - **Credentials**: Store credentials securely using environment variables
342
+ - **Token Management**: Bearer tokens expire and should be refreshed as needed
343
+
344
+ ### Environment Variables
345
+
346
+ ```bash
347
+ export GRAPHIANT_HOST="https://api.graphiant.com"
348
+ export GRAPHIANT_USERNAME="your_username"
349
+ export GRAPHIANT_PASSWORD="your_password"
350
+ ```
351
+
352
+ ```bash
353
+ username = os.Getenv("GRAPHIANT_USERNAME")
354
+ password = os.Getenv("GRAPHIANT_PASSWORD")
355
+ host = os.Getenv("GRAPHIANT_HOST")
356
+ ```
357
+
358
+ ## 🤝 Contributing
359
+
360
+ 1. Fork the repository
361
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
362
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
363
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
364
+ 5. Open a Pull Request
365
+
366
+ ## 📄 License
367
+
368
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
369
+
370
+ ## 🆘 Support
371
+
372
+ - **Official Documentation**: [Graphiant SDK Python Guide](https://docs.graphiant.com/docs/graphiant-sdk-python) <-> [Graphiant Automation Docs](https://docs.graphiant.com/docs/automation)
373
+ - **API Reference**: [Graphiant SDK Python API Docs](docs/DefaultApi.md) <-> [Graphiant Portal REST API Guide](https://docs.graphiant.com/docs/graphiant-portal-rest-api)
374
+ - **Issues**: [GitHub Issues](https://github.com/Graphiant-Inc/graphiant-sdk-python/issues)
375
+ - **Email**: support@graphiant.com
376
+
377
+ ## 🔗 Related Projects
378
+
379
+ - [Graphiant SDK Go](https://github.com/Graphiant-Inc/graphiant-sdk-go)
380
+ - [Graphiant Playbooks](https://github.com/Graphiant-Inc/graphiant-playbooks)
381
+
382
+ ---
383
+
384
+ **Made with ❤️ by the Graphiant Team**