Class: Infrawrench::ProbesNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.probes

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ ProbesNamespace

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 ProbesNamespace.

Parameters:



4733
4734
4735
# File 'lib/infrawrench/client.rb', line 4733

def initialize(transport)
  @transport = transport
end

Instance Method Details

#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash

Create a probe

Point an uptime/latency check at an endpoint. Numeric inputs are clamped into their allowed ranges rather than rejected; the first check runs within one poller tick. Audit-logged.

Requires permission: resources:write.

POST /api/org/orgId/probes

Raises on 400: Bad request

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as SyntheticProbeCreate.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • body: (synthetic_probe_create, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as SyntheticProbe — see sig/infrawrench/sdk.rbs.

Raises:



4757
4758
4759
4760
4761
4762
4763
4764
4765
# File 'lib/infrawrench/client.rb', line 4757

def create(org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/probes",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end

#delete(probe_id:, org_id: nil, request_options: nil) ⇒ nil

Delete a probe

Remove the probe. Recorded series age out of the metric store. Audit-logged.

Requires permission: resources:write.

DELETE /api/org/orgId/probes/probeId

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • probe_id (String)
  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • probe_id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (nil)

    This endpoint returns no content.

Raises:



4784
4785
4786
4787
4788
4789
4790
4791
4792
# File 'lib/infrawrench/client.rb', line 4784

def delete(probe_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/probes/{probeId}",
    path_params: { "orgId" => org_id, "probeId" => probe_id },
    accept: :empty,
    request_options: request_options
  )
end

#get(org_id: nil, request_options: nil) ⇒ Hash

List synthetic probes

Every probe in the organization with its live status, consecutive-failure count, last latency and trailing-24h uptime. Probes run on an interval from an edge proxy outside the cluster, so results reflect what an internet client would see.

Requires permission: resources:read.

GET /api/org/orgId/probes

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as SyntheticProbeList — see sig/infrawrench/sdk.rbs.

Raises:



4811
4812
4813
4814
4815
4816
4817
4818
# File 'lib/infrawrench/client.rb', line 4811

def get(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/probes",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#metrics(probe_id:, org_id: nil, start_ms: nil, end_ms: nil, request_options: nil) ⇒ Hash

Read a probe's recorded series

The "Latency" (ms) and "Up" (1/0) series over a time range, from the shared metric store. Resolution auto-selects raw/1-minute/1-hour rollups by span. Defaults to the trailing 24 hours.

Requires permission: resources:read.

GET /api/org/orgId/probes/probeId/metrics

Raises on 400: Bad request

Raises on 404: Not found

Raises on 503: A backing service this endpoint depends on is not available

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • probe_id (String)
  • start_ms (String, nil) (defaults to: nil)

    Range start, Unix epoch ms.

  • end_ms (String, nil) (defaults to: nil)

    Range end, Unix epoch ms.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • probe_id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • start_ms: (String, nil) (defaults to: nil)
  • end_ms: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as ProbeMetrics — see sig/infrawrench/sdk.rbs.

Raises:



4844
4845
4846
4847
4848
4849
4850
4851
4852
# File 'lib/infrawrench/client.rb', line 4844

def metrics(probe_id:, org_id: nil, start_ms: nil, end_ms: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/probes/{probeId}/metrics",
    path_params: { "orgId" => org_id, "probeId" => probe_id },
    query: { "startMs" => start_ms, "endMs" => end_ms },
    request_options: request_options
  )
end

#suggestions(org_id: nil, request_options: nil) ⇒ Hash

Suggest endpoints from synced resources

Endpoint candidates mined from the organization's synced resource outputs and fields (keys like url, endpoint, host, domain, publicIp). A cheap read over stored state — no provider API calls. Deduplicated by URL.

Requires permission: resources:read.

GET /api/org/orgId/probes/suggestions

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as ProbeSuggestions — see sig/infrawrench/sdk.rbs.

Raises:



4869
4870
4871
4872
4873
4874
4875
4876
# File 'lib/infrawrench/client.rb', line 4869

def suggestions(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/probes/suggestions",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#update(probe_id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash

Update or disable a probe

Edit settings and/or toggle enabled. Changing the URL or method resets the probe's state to unknown — the history belongs to the old endpoint. Audit-logged.

Requires permission: resources:write.

PUT /api/org/orgId/probes/probeId

Raises on 400: Bad request

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • probe_id (String)
  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as SyntheticProbeUpdate.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • probe_id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • body: (synthetic_probe_update, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as SyntheticProbe — see sig/infrawrench/sdk.rbs.

Raises:



4899
4900
4901
4902
4903
4904
4905
4906
4907
# File 'lib/infrawrench/client.rb', line 4899

def update(probe_id:, org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "PUT",
    path: "/api/org/{orgId}/probes/{probeId}",
    path_params: { "orgId" => org_id, "probeId" => probe_id },
    body: body,
    request_options: request_options
  )
end