github.com/orange-cloudfoundry/cli@v7.1.0+incompatible/api/cloudcontroller/ccv3/relationship_list.go (about)

     1  package ccv3
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/internal"
     5  	"code.cloudfoundry.org/cli/resources"
     6  )
     7  
     8  // EntitleIsolationSegmentToOrganizations will create a link between the
     9  // isolation segment and the list of organizations provided.
    10  func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (resources.RelationshipList, Warnings, error) {
    11  	var responseBody resources.RelationshipList
    12  
    13  	_, warnings, err := client.MakeRequest(RequestParams{
    14  		RequestName:  internal.PostIsolationSegmentRelationshipOrganizationsRequest,
    15  		URIParams:    internal.Params{"isolation_segment_guid": isolationSegmentGUID},
    16  		RequestBody:  resources.RelationshipList{GUIDs: organizationGUIDs},
    17  		ResponseBody: &responseBody,
    18  	})
    19  
    20  	return responseBody, warnings, err
    21  }
    22  
    23  // ShareServiceInstanceToSpaces will create a sharing relationship between
    24  // the service instance and the shared-to space for each space provided.
    25  func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (resources.RelationshipList, Warnings, error) {
    26  	var responseBody resources.RelationshipList
    27  
    28  	_, warnings, err := client.MakeRequest(RequestParams{
    29  		RequestName:  internal.PostServiceInstanceRelationshipsSharedSpacesRequest,
    30  		URIParams:    internal.Params{"service_instance_guid": serviceInstanceGUID},
    31  		RequestBody:  resources.RelationshipList{GUIDs: spaceGUIDs},
    32  		ResponseBody: &responseBody,
    33  	})
    34  
    35  	return responseBody, warnings, err
    36  }