Class: Infrawrench::CustomGraphsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::CustomGraphsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.custom_graphs
Instance Method Summary collapse
-
#check(body:, org_id: nil, request_options: nil) ⇒ Hash
Type-check custom-graph source without saving it.
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a custom graph (paid plan required).
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a custom graph (and its dashboard cards).
-
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Get a custom graph (including source).
-
#initialize(transport) ⇒ CustomGraphsNamespace
constructor
private
A new instance of CustomGraphsNamespace.
-
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List custom graphs.
-
#render(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Run the graph's script and return its render spec (paid plan required).
-
#typings(org_id: nil, request_options: nil) ⇒ String
The ambient graph.d.ts for custom-graph source.
-
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a custom graph (paid plan required).
Constructor Details
#initialize(transport) ⇒ CustomGraphsNamespace
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 CustomGraphsNamespace.
2175 2176 2177 |
# File 'lib/infrawrench/client.rb', line 2175 def initialize(transport) @transport = transport end |
Instance Method Details
#check(body:, org_id: nil, request_options: nil) ⇒ Hash
Type-check custom-graph source without saving it
Requires permission: dashboards:read.
POST /api/org/orgId/custom-graphs/check
Raises on 400: Bad request
2194 2195 2196 2197 2198 2199 2200 2201 2202 |
# File 'lib/infrawrench/client.rb', line 2194 def check(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/custom-graphs/check", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a custom graph (paid plan required)
Requires permission: dashboards:write.
POST /api/org/orgId/custom-graphs
Raises on 400: Bad request
Raises on 402: Payment required — the organization's plan does not include this
2221 2222 2223 2224 2225 2226 2227 2228 2229 |
# File 'lib/infrawrench/client.rb', line 2221 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/custom-graphs", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a custom graph (and its dashboard cards)
Requires permission: dashboards:write.
DELETE /api/org/orgId/custom-graphs/id
Raises on 404: Not found
2245 2246 2247 2248 2249 2250 2251 2252 |
# File 'lib/infrawrench/client.rb', line 2245 def delete(id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/custom-graphs/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Get a custom graph (including source)
Requires permission: dashboards:read.
GET /api/org/orgId/custom-graphs/id
Raises on 404: Not found
2268 2269 2270 2271 2272 2273 2274 2275 |
# File 'lib/infrawrench/client.rb', line 2268 def get(id:, org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/custom-graphs/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List custom graphs
Requires permission: dashboards:read.
GET /api/org/orgId/custom-graphs
2289 2290 2291 2292 2293 2294 2295 2296 |
# File 'lib/infrawrench/client.rb', line 2289 def list(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/custom-graphs", path_params: { "orgId" => org_id }, request_options: ) end |
#render(id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Run the graph's script and return its render spec (paid plan required)
Requires permission: dashboards:read.
POST /api/org/orgId/custom-graphs/id/render
Raises on 400: Bad request
Raises on 402: Payment required — the organization's plan does not include this
Raises on 404: Not found
2319 2320 2321 2322 2323 2324 2325 2326 2327 |
# File 'lib/infrawrench/client.rb', line 2319 def render(id:, org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/custom-graphs/{id}/render", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |
#typings(org_id: nil, request_options: nil) ⇒ String
The ambient graph.d.ts for custom-graph source
Requires permission: dashboards:read.
GET /api/org/orgId/custom-graphs/typings
2340 2341 2342 2343 2344 2345 2346 2347 2348 |
# File 'lib/infrawrench/client.rb', line 2340 def typings(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/custom-graphs/typings", path_params: { "orgId" => org_id }, accept: :binary, request_options: ) end |
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a custom graph (paid plan required)
Requires permission: dashboards:write.
PUT /api/org/orgId/custom-graphs/id
Raises on 400: Bad request
Raises on 402: Payment required — the organization's plan does not include this
Raises on 404: Not found
2370 2371 2372 2373 2374 2375 2376 2377 2378 |
# File 'lib/infrawrench/client.rb', line 2370 def update(id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/custom-graphs/{id}", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |