Skip to content

Commit 21d8e7f

Browse files
committed
Merge pull request #784 from vivsriaus/odata
Include odata query filter for a single resource get
2 parents 081dc96 + ab49b76 commit 21d8e7f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,20 @@ private async Task<JObject> GetResource()
353353
.DetermineApiVersion(resourceId: resourceId)
354354
.ConfigureAwait(continueOnCapturedContext: false);
355355

356+
var odataQuery = QueryFilterBuilder.CreateFilter(
357+
resourceType: null,
358+
resourceName: null,
359+
tagName: null,
360+
tagValue: null,
361+
filter: this.ODataQuery);
362+
356363
return await this
357364
.GetResourcesClient()
358365
.GetResource<JObject>(
359366
resourceId: resourceId,
360367
apiVersion: apiVersion,
361-
cancellationToken: this.CancellationToken.Value)
368+
cancellationToken: this.CancellationToken.Value,
369+
odataQuery: odataQuery)
362370
.ConfigureAwait(continueOnCapturedContext: false);
363371
}
364372

0 commit comments

Comments
 (0)