def assign_isolation_segment(self, space_guid: str, isolation_segment_guid: Optional[str]) -> ToOneRelationship:
     return ToOneRelationship.from_json_object(
         super(SpaceManager, self)._patch(
             "%s%s/%s/relationships/isolation_segment" % (self.target_endpoint, self.entity_uri, space_guid),
             dict(data=None) if isolation_segment_guid is None else ToOneRelationship(isolation_segment_guid),
         )
     )
 def assign_default_isolation_segment(self, org_guid: str,
                                      iso_seg_guid: str) -> Entity:
     return ToOneRelationship.from_json_object(
         super(OrganizationManager, self)._patch(
             "%s%s/%s/relationships/default_isolation_segment" %
             (self.target_endpoint, self.entity_uri, org_guid),
             data=ToOneRelationship(iso_seg_guid),
         ))
Beispiel #3
0
 def __init__(self, target_endpoint: str, entity_manager: 'EntityManager', **kwargs):
     super(Domain, self).__init__(target_endpoint, entity_manager, **kwargs)
     relationships = self['relationships']
     if 'organization' in relationships:
         self['relationships']['organization'] = ToOneRelationship.from_json_object(relationships['organization'].get('data'))
     if 'shared_organizations' in relationships:
         self['relationships']['shared_organizations'] \
             = ToManyRelationship.from_json_object(relationships['shared_organizations'])
 def __init__(self, target_endpoint: str, client: "CloudFoundryClient", **kwargs):
     super(Domain, self).__init__(target_endpoint, client, **kwargs)
     relationships = self["relationships"]
     if "organization" in relationships:
         self["relationships"]["organization"] = ToOneRelationship.from_json_object(relationships["organization"])
     if "shared_organizations" in relationships:
         self["relationships"]["shared_organizations"] = ToManyRelationship.from_json_object(
             relationships["shared_organizations"]
         )
Beispiel #5
0
 def get_default_isolation_segment(self, guid: str) -> ToOneRelationship:
     return ToOneRelationship.from_json_object(
         super(OrganizationManager, self).get(guid, 'relationships', 'default_isolation_segment'))
 def get_assigned_isolation_segment(self, space_guid: str) -> ToOneRelationship:
     return ToOneRelationship.from_json_object(
         super(SpaceManager, self)._get(
             "%s%s/%s/relationships/isolation_segment" % (self.target_endpoint, self.entity_uri, space_guid)
         )
     )