-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathservice_offerings.py
More file actions
22 lines (16 loc) · 931 Bytes
/
service_offerings.py
File metadata and controls
22 lines (16 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from typing import TYPE_CHECKING
from cloudfoundry_client.v3.entities import EntityManager, Entity
if TYPE_CHECKING:
from cloudfoundry_client.client import CloudFoundryClient
class ServiceOfferingsManager(EntityManager[Entity]):
def __init__(self, target_endpoint: str, client: "CloudFoundryClient"):
super(ServiceOfferingsManager, self).__init__(target_endpoint, client, "/v3/service_offerings")
def update(self, guid: str, meta_labels: dict | None = None, meta_annotations: dict | None = None) -> Entity:
payload = dict()
self._metadata(payload, meta_labels, meta_annotations)
return super(ServiceOfferingsManager, self)._update(guid, payload)
def remove(self, guid: str, purge: bool = False) -> None:
url = f"{self.target_endpoint}{self.entity_uri}/{guid}"
if purge:
url += "?purge=true"
super(ServiceOfferingsManager, self)._delete(url)