|
5 | 5 | HYPERNODE_API_ADDON_SLA_LIST_ENDPOINT = "/v2/addon/slas/" |
6 | 6 | HYPERNODE_API_APP_CHECK_PAYMENT_INFORMATION = "/v2/app/{}/check-payment-information/" |
7 | 7 | HYPERNODE_API_APP_CONFIGURATION_ENDPOINT = "/v2/configuration/" |
| 8 | +HYPERNODE_API_APP_CLUSTER_RELATIONS = "/v2/app/{}/relations/" |
8 | 9 | HYPERNODE_API_APP_DETAIL_ENDPOINT = "/v2/app/{}/?destroyed=false" |
9 | 10 | HYPERNODE_API_APP_DETAIL_WITH_ADDONS_ENDPOINT = "/v2/app/{}/with_addons?destroyed=false" |
10 | 11 | HYPERNODE_API_APP_EAV_DESCRIPTION_ENDPOINT = "/v2/app/eav_descriptions/" |
@@ -365,6 +366,34 @@ def get_app_configurations(self): |
365 | 366 | """ |
366 | 367 | return self.requests("GET", HYPERNODE_API_APP_CONFIGURATION_ENDPOINT) |
367 | 368 |
|
| 369 | + def get_cluster_relations(self, app_name): |
| 370 | + """ " |
| 371 | + List all relations for the specified app. This will return all the |
| 372 | + relations that are currently configured for the specified app. |
| 373 | +
|
| 374 | + Example: |
| 375 | + > client.get_cluster_relations('mytestappweb').json() |
| 376 | + > {'children': [], |
| 377 | + > 'parents': [{'child': 'mytestappweb', |
| 378 | + > 'cluster_description': None, |
| 379 | + > 'id': 182, |
| 380 | + > 'parent': 'mytestappdb', |
| 381 | + > 'relation_type': 'mysql'}, |
| 382 | + > {'child': 'mytestappweb', |
| 383 | + > 'cluster_description': None, |
| 384 | + > 'id': 180, |
| 385 | + > 'parent': 'mytestapp', |
| 386 | + > 'relation_type': 'loadbalancer'}, |
| 387 | + > {'child': 'mytestappweb', |
| 388 | + > 'cluster_description': None, |
| 389 | + > 'id': 181, |
| 390 | + > 'parent': 'mytestapp', |
| 391 | + > 'relation_type': 'nfs'}]} |
| 392 | + """ |
| 393 | + return self.requests( |
| 394 | + "GET", HYPERNODE_API_APP_CLUSTER_RELATIONS.format(app_name) |
| 395 | + ) |
| 396 | + |
368 | 397 | def get_product_info_with_price(self, product_code, error_to_raise=None): |
369 | 398 | """ |
370 | 399 | Get information about a specific product |
|
0 commit comments