Skip to content

Commit b5ac40d

Browse files
committed
fix resource search and formatting (#21)
Signed-off-by: Richard Gebhardt <[email protected]>
1 parent b20410d commit b5ac40d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

oci_compute_instance_agent.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
import oci
66
from fastmcp import FastMCP
77
from oci.compute_instance_agent.models import (
8-
CreateInstanceAgentCommandDetails, InstanceAgentCommandContent,
9-
InstanceAgentCommandExecution, InstanceAgentCommandOutputViaTextDetails,
10-
InstanceAgentCommandSourceViaTextDetails, InstanceAgentCommandTarget)
8+
CreateInstanceAgentCommandDetails,
9+
InstanceAgentCommandContent,
10+
InstanceAgentCommandExecution,
11+
InstanceAgentCommandOutputViaTextDetails,
12+
InstanceAgentCommandSourceViaTextDetails,
13+
InstanceAgentCommandTarget,
14+
)
1115

1216
logger = Logger("oci_compute_mcp", level="INFO")
1317

oci_resource_search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def search_resources(
5959
):
6060
"""Searches for resources by display name"""
6161
search_client = get_search_client()
62-
structured_search = FreeTextSearchDetails(
62+
structured_search = StructuredSearchDetails(
6363
type="Structured",
64-
query=f"query all resources where compartmentId = '{compartment_id}' and displayName =~ '{display_name}'",
64+
query=f"query all resources where compartmentId = '{compartment_id}' && displayName =~ '{display_name}'",
6565
)
6666
response = search_client.search_resources(structured_search).data
6767
return [
@@ -85,7 +85,7 @@ def search_resources_free_form(
8585
):
8686
"""Searches for the presence of the search string in all resource fields"""
8787
search_client = get_search_client()
88-
freetext_search = StructuredSearchDetails(
88+
freetext_search = FreeTextSearchDetails(
8989
type="FreeText",
9090
text=text,
9191
)

0 commit comments

Comments
 (0)