Class: Infrawrench::NetworkFlowsNamespace

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

Overview

client.network_flows

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ NetworkFlowsNamespace

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

Parameters:



10510
10511
10512
10513
# File 'lib/infrawrench/client.rb', line 10510

def initialize(transport)
  @transport = transport
  @settings = NetworkFlowsSettingsNamespace.new(@transport)
end

Instance Attribute Details

#settingsNetworkFlowsSettingsNamespace (readonly)

Returns client.network_flows.settings.

Returns:



10506
10507
10508
# File 'lib/infrawrench/client.rb', line 10506

def settings
  @settings
end

Instance Method Details

#get(org_id: nil, from: nil, to: nil, scope: nil, account_id: nil, limit: nil, request_options: nil) ⇒ Hash

Priced source→destination network flow attribution

Which two things are talking, across which billing boundary, and what that costs. Answers the question the cost dimensions structurally cannot: every cost dimension is about one side of a transfer, and a network charge is about a pair.

All figures are estimates and the estimated field says so unconditionally. Bytes come from the provider's flow logs (which sample, or drop records under capacity pressure) and are priced at published list rates with no free tier, no volume tier and no negotiated discount applied. Use the ranking; do not reconcile the total against an invoice line.

Accounts whose provider has no readable flow source appear in accounts with supportsFlows: false and contribute nothing to the totals — never zero bytes.

Requires permission: costs:read.

GET /api/org/orgId/network-flows

Raises on 400: Bad request

Parameters:

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

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

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

    Inclusive start day. Defaults to 13 days ago.

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

    Inclusive end day. Defaults to today.

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

    Narrow to one billing boundary.

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

    Narrow to one connected account.

  • limit (Integer, nil) (defaults to: nil)

    Pairs to return in topFlows, largest cost first. Defaults to 50.

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

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

  • org_id: (String, nil) (defaults to: nil)
  • from: (String, nil) (defaults to: nil)
  • to: (String, nil) (defaults to: nil)
  • scope: ("intra_zone", "cross_zone", "cross_region", "internet_egress", "internet_ingress", "provider_service", "nat_gateway", "private_interconnect", "unknown", nil) (defaults to: nil)
  • account_id: (String, nil) (defaults to: nil)
  • limit: (Integer, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
# File 'lib/infrawrench/client.rb', line 10550

def get(
  org_id: nil,
  from: nil,
  to: nil,
  scope: nil,
  account_id: nil,
  limit: nil,
  request_options: nil
)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/network-flows",
    path_params: { "orgId" => org_id },
    query: {
      "from" => from,
      "to" => to,
      "scope" => scope,
      "accountId" => ,
      "limit" => limit
    },
    request_options: request_options
  )
end