Skip to content

Commit 4762a50

Browse files
authored
chore: adjust get queries to filter for name (#43)
1 parent 50320b9 commit 4762a50

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

charts/dim/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
apiVersion: v2
2121
name: dim
2222
type: application
23-
version: 0.0.5
24-
appVersion: 0.0.5
23+
version: 0.0.6
24+
appVersion: 0.0.6
2525
description: Helm chart for DIM Middle Layer
2626
home: https://github.com/catenax-ng/dim-repo
2727
dependencies:

charts/dim/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To use the helm chart as a dependency:
2727
dependencies:
2828
- name: dim
2929
repository: https://phil91.github.io/dim-client
30-
version: 0.0.5
30+
version: 0.0.6
3131
```
3232
3333
## Requirements

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<Project>
2121
<PropertyGroup>
22-
<VersionPrefix>0.0.5</VersionPrefix>
22+
<VersionPrefix>0.0.6</VersionPrefix>
2323
<VersionSuffix></VersionSuffix>
2424
</PropertyGroup>
2525
</Project>

src/clients/Dim.Clients/Api/Cf/CfClient.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public async Task<Guid> CreateCloudFoundrySpace(string tenantName, CancellationT
7171

7272
private static async Task<Guid> GetEnvironmentId(string tenantName, CancellationToken cancellationToken, HttpClient client)
7373
{
74-
var environmentsResponse = await client.GetAsync("/v3/organizations", cancellationToken)
74+
var environmentsResponse = await client.GetAsync($"/v3/organizations?names={tenantName}", cancellationToken)
7575
.CatchingIntoServiceExceptionFor("get-organizations", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE);
7676
var environments = await environmentsResponse.Content
7777
.ReadFromJsonAsync<GetEnvironmentsResponse>(JsonSerializerExtensions.Options, cancellationToken)
@@ -136,7 +136,7 @@ public async Task<Guid> GetSpace(string tenantName, CancellationToken cancellati
136136
{
137137
var spaceName = $"{tenantName}-space";
138138
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)
140140
.CatchingIntoServiceExceptionFor("get-space", HttpAsyncResponseMessageExtension.RecoverOptions.ALLWAYS).ConfigureAwait(false);
141141
try
142142
{
@@ -180,8 +180,9 @@ await client.PostAsJsonAsync("/v3/service_instances", data, JsonSerializerExtens
180180

181181
private async Task<Guid> GetServiceInstances(string tenantName, Guid? spaceId, CancellationToken cancellationToken)
182182
{
183+
var name = $"{tenantName}-dim-instance";
183184
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)
185186
.CatchingIntoServiceExceptionFor("get-si", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE).ConfigureAwait(false);
186187
try
187188
{
@@ -193,7 +194,6 @@ private async Task<Guid> GetServiceInstances(string tenantName, Guid? spaceId, C
193194
throw new ServiceException("Response must not be null");
194195
}
195196

196-
var name = $"{tenantName}-dim-instance";
197197
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");
198198
if (resources.Count() != 1)
199199
{

0 commit comments

Comments
 (0)