-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathservice_bindings.py
More file actions
20 lines (14 loc) · 861 Bytes
/
service_bindings.py
File metadata and controls
20 lines (14 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from typing import TYPE_CHECKING
from cloudfoundry_client.v2.entities import EntityManager, Entity
if TYPE_CHECKING:
from cloudfoundry_client.client import CloudFoundryClient
class ServiceBindingManager(EntityManager):
def __init__(self, target_endpoint: str, client: "CloudFoundryClient"):
super(ServiceBindingManager, self).__init__(target_endpoint, client, "/v2/service_bindings")
def create(self, app_guid: str, instance_guid: str, parameters: dict | None = None, name: str | None = None) -> Entity:
request = self._request(app_guid=app_guid, service_instance_guid=instance_guid)
request["parameters"] = parameters
request["name"] = name
return super(ServiceBindingManager, self)._create(request)
def remove(self, binding_id: str):
super(ServiceBindingManager, self)._remove(binding_id)