File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
sdk/resourcegraph/azure-resourcemanager-resourcegraph
src/test/java/com/azure/resourcemanager/resourcegraph Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,22 @@ See [API design][design] for general introduction on design and key concepts on
7474
7575## Examples
7676
77+ ``` java
78+ QueryRequest queryRequest = new QueryRequest ()
79+ .withSubscriptions(Collections . singletonList(subscriptionId))
80+ .withQuery(" Resources | project name, type | limit 5 | order by name asc" );
81+ // table format
82+ queryRequest. withOptions(new QueryRequestOptions (). withResultFormat(ResultFormat . TABLE ));
83+ QueryResponse response = manager. resourceProviders(). resources(queryRequest);
84+
85+
86+ // object array format
87+ queryRequest. withOptions(new QueryRequestOptions (). withResultFormat(ResultFormat . OBJECT_ARRAY ));
88+ response = manager. resourceProviders(). resources(queryRequest);
89+
90+ ```
91+
92+
7793## Troubleshooting
7894
7995## Next steps
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ public void queryTest() {
3232 ResourceGraphManager manager = ResourceGraphManager
3333 .authenticate (new DefaultAzureCredentialBuilder ().build (), new AzureProfile (AzureEnvironment .AZURE ));
3434
35+ // @embedmeStart
3536 QueryRequest queryRequest = new QueryRequest ()
3637 .withSubscriptions (Collections .singletonList (subscriptionId ))
3738 .withQuery ("Resources | project name, type | limit 5 | order by name asc" );
@@ -48,5 +49,6 @@ public void queryTest() {
4849
4950 Assertions .assertNotNull (response .data ());
5051 Assertions .assertTrue (response .data () instanceof List );
52+ // @embedmeEnd
5153 }
5254}
You can’t perform that action at this time.
0 commit comments