@@ -71,7 +71,7 @@ public async Task<Guid> CreateCloudFoundrySpace(string tenantName, CancellationT
71
71
72
72
private static async Task < Guid > GetEnvironmentId ( string tenantName , CancellationToken cancellationToken , HttpClient client )
73
73
{
74
- var environmentsResponse = await client . GetAsync ( "/v3/organizations" , cancellationToken )
74
+ var environmentsResponse = await client . GetAsync ( $ "/v3/organizations?names= { tenantName } ", cancellationToken )
75
75
. CatchingIntoServiceExceptionFor ( "get-organizations" , HttpAsyncResponseMessageExtension . RecoverOptions . INFRASTRUCTURE ) ;
76
76
var environments = await environmentsResponse . Content
77
77
. ReadFromJsonAsync < GetEnvironmentsResponse > ( JsonSerializerExtensions . Options , cancellationToken )
@@ -136,7 +136,7 @@ public async Task<Guid> GetSpace(string tenantName, CancellationToken cancellati
136
136
{
137
137
var spaceName = $ "{ tenantName } -space";
138
138
var client = await _basicAuthTokenService . GetBasicAuthorizedLegacyClient < CfClient > ( _settings , cancellationToken ) . ConfigureAwait ( false ) ;
139
- var result = await client . GetAsync ( "/v3/spaces" , cancellationToken )
139
+ var result = await client . GetAsync ( $ "/v3/spaces?names= { spaceName } ", cancellationToken )
140
140
. CatchingIntoServiceExceptionFor ( "get-space" , HttpAsyncResponseMessageExtension . RecoverOptions . ALLWAYS ) . ConfigureAwait ( false ) ;
141
141
try
142
142
{
@@ -180,8 +180,9 @@ await client.PostAsJsonAsync("/v3/service_instances", data, JsonSerializerExtens
180
180
181
181
private async Task < Guid > GetServiceInstances ( string tenantName , Guid ? spaceId , CancellationToken cancellationToken )
182
182
{
183
+ var name = $ "{ tenantName } -dim-instance";
183
184
var client = await _basicAuthTokenService . GetBasicAuthorizedLegacyClient < CfClient > ( _settings , cancellationToken ) . ConfigureAwait ( false ) ;
184
- var result = await client . GetAsync ( "/v3/service_instances" , cancellationToken )
185
+ var result = await client . GetAsync ( $ "/v3/service_instances?names= { name } ", cancellationToken )
185
186
. CatchingIntoServiceExceptionFor ( "get-si" , HttpAsyncResponseMessageExtension . RecoverOptions . INFRASTRUCTURE ) . ConfigureAwait ( false ) ;
186
187
try
187
188
{
@@ -193,7 +194,6 @@ private async Task<Guid> GetServiceInstances(string tenantName, Guid? spaceId, C
193
194
throw new ServiceException ( "Response must not be null" ) ;
194
195
}
195
196
196
- var name = $ "{ tenantName } -dim-instance";
197
197
var resources = response . Resources . Where ( x => x . Name == name && x . Type == "managed" && ( spaceId == null || x . Relationships . Space . Data . Id == spaceId . Value ) && x . LastOperation . State == "succeeded" ) ;
198
198
if ( resources . Count ( ) != 1 )
199
199
{
0 commit comments