Class: Infrawrench::LogWorkspacesNamespace
- Inherits:
-
Object
- Object
- Infrawrench::LogWorkspacesNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.log_workspaces
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Save a log workspace query.
-
#delete(query_id:, org_id: nil, request_options: nil) ⇒ nil
Delete a saved log query.
-
#get(org_id: nil, request_options: nil) ⇒ Hash
List saved log queries.
-
#initialize(transport) ⇒ LogWorkspacesNamespace
constructor
private
A new instance of LogWorkspacesNamespace.
-
#resources(org_id: nil, request_options: nil) ⇒ Hash
List log-capable resources.
-
#update(query_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a saved log query.
Constructor Details
#initialize(transport) ⇒ LogWorkspacesNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of LogWorkspacesNamespace.
8994 8995 8996 |
# File 'lib/infrawrench/client.rb', line 8994 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Save a log workspace query
Save a named multi-resource tail: up to 8 log streams plus a search
expression, so the workspace can be reopened. With alertEnabled the
poller evaluates the query every few minutes over a bounded tail window
and notifies (push/Slack/Teams, logMatchAlerts trigger) when a line
matches, with a cooldown between alerts. Alerting requires a non-empty
search expression. Audit-logged.
Requires permission: resources:write.
POST /api/org/orgId/log-workspaces
Raises on 400: Bad request
Raises on 404: Not found
Raises on 409: A saved query with this name already exists
9023 9024 9025 9026 9027 9028 9029 9030 9031 |
# File 'lib/infrawrench/client.rb', line 9023 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/log-workspaces", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(query_id:, org_id: nil, request_options: nil) ⇒ nil
Delete a saved log query
Remove the saved query and stop any alerting it carried. Audit-logged.
Requires permission: resources:write.
DELETE /api/org/orgId/log-workspaces/queryId
Raises on 404: Not found
9049 9050 9051 9052 9053 9054 9055 9056 9057 |
# File 'lib/infrawrench/client.rb', line 9049 def delete(query_id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/log-workspaces/{queryId}", path_params: { "orgId" => org_id, "queryId" => query_id }, accept: :empty, request_options: ) end |
#get(org_id: nil, request_options: nil) ⇒ Hash
List saved log queries
Every saved log-workspace query in the organization: its name, the set of
log streams it tails, the search expression, the alert flag and the alert
pass's last evaluation state. Log text itself is fetched per resource via
POST /api/org/{orgId}/resources/{pluginId}/{typeId}/logs.
Requires permission: resources:read.
GET /api/org/orgId/log-workspaces
9076 9077 9078 9079 9080 9081 9082 9083 |
# File 'lib/infrawrench/client.rb', line 9076 def get(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/log-workspaces", path_params: { "orgId" => org_id }, request_options: ) end |
#resources(org_id: nil, request_options: nil) ⇒ Hash
List log-capable resources
Synced resources whose rendered detail declares the logs capability — the
candidates a log workspace can tail — plus sidecar streams reached through
a peer integration (pods and workloads inside a managed cluster, listed
live from the provider and marked with parentResourceId). Discovered
from the plugin contract (never a hardcoded provider list), capped at 500
results.
Requires permission: resources:read.
GET /api/org/orgId/log-workspaces/resources
9104 9105 9106 9107 9108 9109 9110 9111 |
# File 'lib/infrawrench/client.rb', line 9104 def resources(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/log-workspaces/resources", path_params: { "orgId" => org_id }, request_options: ) end |
#update(query_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a saved log query
Edit the name, resource set, search expression and/or the alert toggle. Changing the search or the resources resets the alert pass's evaluation state; turning the alert on makes the query due for evaluation immediately. Audit-logged.
Requires permission: resources:write.
PUT /api/org/orgId/log-workspaces/queryId
Raises on 400: Bad request
Raises on 404: Not found
Raises on 409: A saved query with this name already exists
9137 9138 9139 9140 9141 9142 9143 9144 9145 |
# File 'lib/infrawrench/client.rb', line 9137 def update(query_id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/log-workspaces/{queryId}", path_params: { "orgId" => org_id, "queryId" => query_id }, body: body, request_options: ) end |