infrawrench-sdk 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/infrawrench-sdk.gemspec +4 -4
- data/lib/infrawrench/client.rb +2045 -544
- data/lib/infrawrench/sdk.rb +2 -2
- data/lib/infrawrench/transport.rb +2 -2
- data/lib/infrawrench/version.rb +3 -3
- data/lib/infrawrench-sdk.rb +2 -2
- data/sig/infrawrench/sdk.rbs +831 -7
- metadata +4 -4
data/lib/infrawrench/client.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# infrawrench-sdk v0.
|
|
3
|
+
# infrawrench-sdk v0.30.0 | MIT | Copyright (c) 2026 Infrawrench LLC
|
|
4
4
|
# https://github.com/Infrawrench/Infrawrench
|
|
5
5
|
#
|
|
6
|
-
# Generated from the Infrawrench API OpenAPI 3.1 spec (API version 0.
|
|
6
|
+
# Generated from the Infrawrench API OpenAPI 3.1 spec (API version 0.30.0).
|
|
7
7
|
#
|
|
8
8
|
# DO NOT EDIT. Regenerate with:
|
|
9
9
|
# pnpm --filter @infrawrench/web generate:sdk
|
|
@@ -79,6 +79,134 @@ module Infrawrench
|
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
+
# `client.accounts.plugins`
|
|
83
|
+
class AccountsPluginsNamespace
|
|
84
|
+
# @api private
|
|
85
|
+
# @param transport [Transport]
|
|
86
|
+
def initialize(transport)
|
|
87
|
+
@transport = transport
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# List installed plugins and their credential fields
|
|
91
|
+
#
|
|
92
|
+
# _Requires permission: `accounts:read`._
|
|
93
|
+
#
|
|
94
|
+
# GET /api/org/{orgId}/accounts/plugins
|
|
95
|
+
#
|
|
96
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
97
|
+
# constructed with.
|
|
98
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
99
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<PluginSummary>` — see
|
|
100
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
101
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
102
|
+
def list(org_id: nil, request_options: nil)
|
|
103
|
+
@transport.request(
|
|
104
|
+
http_method: "GET",
|
|
105
|
+
path: "/api/org/{orgId}/accounts/plugins",
|
|
106
|
+
path_params: { "orgId" => org_id },
|
|
107
|
+
request_options: request_options
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Generate a least-privilege credential template for a plugin
|
|
112
|
+
#
|
|
113
|
+
# Returns the paste-ready credential document (IAM policy JSON, custom role
|
|
114
|
+
# YAML, token template…) scoped to the requested capability ids. Omitting
|
|
115
|
+
# `capabilities` (or sending it empty) selects every declared capability;
|
|
116
|
+
# any unknown capability id is rejected with 400. 400 also for plugins that
|
|
117
|
+
# don't provide a template.
|
|
118
|
+
#
|
|
119
|
+
# _Requires permission: `accounts:read`._
|
|
120
|
+
#
|
|
121
|
+
# GET /api/org/{orgId}/accounts/plugins/{pluginId}/policy-template
|
|
122
|
+
#
|
|
123
|
+
# Raises on 400: Bad request
|
|
124
|
+
#
|
|
125
|
+
# Raises on 404: Not found
|
|
126
|
+
#
|
|
127
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
128
|
+
# constructed with.
|
|
129
|
+
# @param plugin_id [String]
|
|
130
|
+
# @param capabilities [String, nil] Comma-separated capability ids, e.g. `resources,costs`.
|
|
131
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
132
|
+
# @return [Hash] Parsed JSON, shaped as `PolicyTemplateResponse` — see
|
|
133
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
134
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
135
|
+
def policy_template(plugin_id:, org_id: nil, capabilities: nil, request_options: nil)
|
|
136
|
+
@transport.request(
|
|
137
|
+
http_method: "GET",
|
|
138
|
+
path: "/api/org/{orgId}/accounts/plugins/{pluginId}/policy-template",
|
|
139
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id },
|
|
140
|
+
query: { "capabilities" => capabilities },
|
|
141
|
+
request_options: request_options
|
|
142
|
+
)
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# `client.accounts.preflight`
|
|
147
|
+
class AccountsPreflightNamespace
|
|
148
|
+
# @api private
|
|
149
|
+
# @param transport [Transport]
|
|
150
|
+
def initialize(transport)
|
|
151
|
+
@transport = transport
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Probe credentials before creating an account
|
|
155
|
+
#
|
|
156
|
+
# Runs the plugin's per-capability permission checks against the submitted
|
|
157
|
+
# credentials. Nothing is stored — use it from the add-account flow before
|
|
158
|
+
# committing.
|
|
159
|
+
#
|
|
160
|
+
# _Requires permission: `accounts:write`._
|
|
161
|
+
#
|
|
162
|
+
# POST /api/org/{orgId}/accounts/preflight
|
|
163
|
+
#
|
|
164
|
+
# Raises on 400: Bad request
|
|
165
|
+
#
|
|
166
|
+
# Raises on 404: Not found
|
|
167
|
+
#
|
|
168
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
169
|
+
# constructed with.
|
|
170
|
+
# @param body [Hash] Request body, shaped as `PreflightRequest`.
|
|
171
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
172
|
+
# @return [Hash] Parsed JSON, shaped as `PreflightReport` — see `sig/infrawrench/sdk.rbs`.
|
|
173
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
174
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
175
|
+
@transport.request(
|
|
176
|
+
http_method: "POST",
|
|
177
|
+
path: "/api/org/{orgId}/accounts/preflight",
|
|
178
|
+
path_params: { "orgId" => org_id },
|
|
179
|
+
body: body,
|
|
180
|
+
request_options: request_options
|
|
181
|
+
)
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Re-run credential preflight on a stored account
|
|
185
|
+
#
|
|
186
|
+
# _Requires permission: `accounts:write`._
|
|
187
|
+
#
|
|
188
|
+
# POST /api/org/{orgId}/accounts/{id}/preflight
|
|
189
|
+
#
|
|
190
|
+
# Raises on 400: Bad request
|
|
191
|
+
#
|
|
192
|
+
# Raises on 404: Not found
|
|
193
|
+
#
|
|
194
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
195
|
+
# constructed with.
|
|
196
|
+
# @param id [String]
|
|
197
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
198
|
+
# @return [Hash] Parsed JSON, shaped as `PreflightReport` — see `sig/infrawrench/sdk.rbs`.
|
|
199
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
200
|
+
def post_org_org_id_accounts_id_preflight(id:, org_id: nil, request_options: nil)
|
|
201
|
+
@transport.request(
|
|
202
|
+
http_method: "POST",
|
|
203
|
+
path: "/api/org/{orgId}/accounts/{id}/preflight",
|
|
204
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
205
|
+
request_options: request_options
|
|
206
|
+
)
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
82
210
|
# `client.accounts.sync_type`
|
|
83
211
|
class AccountsSyncTypeNamespace
|
|
84
212
|
# @api private
|
|
@@ -119,6 +247,10 @@ module Infrawrench
|
|
|
119
247
|
class AccountsNamespace
|
|
120
248
|
# @return [AccountsCredentialsNamespace] `client.accounts.credentials`
|
|
121
249
|
attr_reader :credentials
|
|
250
|
+
# @return [AccountsPluginsNamespace] `client.accounts.plugins`
|
|
251
|
+
attr_reader :plugins
|
|
252
|
+
# @return [AccountsPreflightNamespace] `client.accounts.preflight`
|
|
253
|
+
attr_reader :preflight
|
|
122
254
|
# @return [AccountsSyncTypeNamespace] `client.accounts.sync_type`
|
|
123
255
|
attr_reader :sync_type
|
|
124
256
|
|
|
@@ -127,6 +259,8 @@ module Infrawrench
|
|
|
127
259
|
def initialize(transport)
|
|
128
260
|
@transport = transport
|
|
129
261
|
@credentials = AccountsCredentialsNamespace.new(@transport)
|
|
262
|
+
@plugins = AccountsPluginsNamespace.new(@transport)
|
|
263
|
+
@preflight = AccountsPreflightNamespace.new(@transport)
|
|
130
264
|
@sync_type = AccountsSyncTypeNamespace.new(@transport)
|
|
131
265
|
end
|
|
132
266
|
|
|
@@ -226,27 +360,6 @@ module Infrawrench
|
|
|
226
360
|
)
|
|
227
361
|
end
|
|
228
362
|
|
|
229
|
-
# List installed plugins and their credential fields
|
|
230
|
-
#
|
|
231
|
-
# _Requires permission: `accounts:read`._
|
|
232
|
-
#
|
|
233
|
-
# GET /api/org/{orgId}/accounts/plugins
|
|
234
|
-
#
|
|
235
|
-
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
236
|
-
# constructed with.
|
|
237
|
-
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
238
|
-
# @return [Array<Hash>] Parsed JSON, shaped as `Array<PluginSummary>` — see
|
|
239
|
-
# `sig/infrawrench/sdk.rbs`.
|
|
240
|
-
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
241
|
-
def plugins(org_id: nil, request_options: nil)
|
|
242
|
-
@transport.request(
|
|
243
|
-
http_method: "GET",
|
|
244
|
-
path: "/api/org/{orgId}/accounts/plugins",
|
|
245
|
-
path_params: { "orgId" => org_id },
|
|
246
|
-
request_options: request_options
|
|
247
|
-
)
|
|
248
|
-
end
|
|
249
|
-
|
|
250
363
|
# List cached resources for an account
|
|
251
364
|
#
|
|
252
365
|
# _Requires permission: `resources:read`._
|
|
@@ -1515,422 +1628,730 @@ module Infrawrench
|
|
|
1515
1628
|
end
|
|
1516
1629
|
end
|
|
1517
1630
|
|
|
1518
|
-
# `client.
|
|
1519
|
-
class
|
|
1631
|
+
# `client.cost_centres.rules`
|
|
1632
|
+
class CostCentresRulesNamespace
|
|
1520
1633
|
# @api private
|
|
1521
1634
|
# @param transport [Transport]
|
|
1522
1635
|
def initialize(transport)
|
|
1523
1636
|
@transport = transport
|
|
1524
1637
|
end
|
|
1525
1638
|
|
|
1526
|
-
#
|
|
1639
|
+
# Create an allocation rule
|
|
1527
1640
|
#
|
|
1528
|
-
#
|
|
1529
|
-
#
|
|
1530
|
-
#
|
|
1531
|
-
# changed a threshold reads back the defaults. The response also carries the
|
|
1532
|
-
# derived, read-only `smsConfigured`.
|
|
1641
|
+
# Maps spend onto a cost centre. Rules evaluate first-match-wins by
|
|
1642
|
+
# ascending priority against each cost row's tags, account, provider, and
|
|
1643
|
+
# service.
|
|
1533
1644
|
#
|
|
1534
|
-
# _Requires permission: `costs:
|
|
1645
|
+
# _Requires permission: `costs:write`._
|
|
1535
1646
|
#
|
|
1536
|
-
#
|
|
1647
|
+
# POST /api/org/{orgId}/cost-centres/rules
|
|
1648
|
+
#
|
|
1649
|
+
# Raises on 400: Bad request
|
|
1650
|
+
#
|
|
1651
|
+
# Raises on 404: Not found
|
|
1537
1652
|
#
|
|
1538
1653
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1539
1654
|
# constructed with.
|
|
1655
|
+
# @param body [Hash] Request body, shaped as `AllocationRuleInput`.
|
|
1540
1656
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1541
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1542
|
-
# `sig/infrawrench/sdk.rbs`.
|
|
1657
|
+
# @return [Hash] Parsed JSON, shaped as `AllocationRule` — see `sig/infrawrench/sdk.rbs`.
|
|
1543
1658
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1544
|
-
def
|
|
1659
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
1545
1660
|
@transport.request(
|
|
1546
|
-
http_method: "
|
|
1547
|
-
path: "/api/org/{orgId}/
|
|
1661
|
+
http_method: "POST",
|
|
1662
|
+
path: "/api/org/{orgId}/cost-centres/rules",
|
|
1548
1663
|
path_params: { "orgId" => org_id },
|
|
1664
|
+
body: body,
|
|
1549
1665
|
request_options: request_options
|
|
1550
1666
|
)
|
|
1551
1667
|
end
|
|
1552
1668
|
|
|
1553
|
-
#
|
|
1554
|
-
#
|
|
1555
|
-
# Takes effect on the next detection pass (which runs after each cost
|
|
1556
|
-
# collection). Anomalies already stored are not re-judged. All four fields
|
|
1557
|
-
# are required — this is a PUT of the whole settings object, not a patch —
|
|
1558
|
-
# and `smsAlerts` deliberately has no server-side default, so a client that
|
|
1559
|
-
# omits it is rejected rather than silently switching an organization's SMS
|
|
1560
|
-
# paging back off. `smsConfigured` is derived and is not accepted here.
|
|
1669
|
+
# Delete an allocation rule
|
|
1561
1670
|
#
|
|
1562
1671
|
# _Requires permission: `costs:write`._
|
|
1563
1672
|
#
|
|
1564
|
-
#
|
|
1673
|
+
# DELETE /api/org/{orgId}/cost-centres/rules/{id}
|
|
1565
1674
|
#
|
|
1566
|
-
# Raises on
|
|
1675
|
+
# Raises on 404: Not found
|
|
1567
1676
|
#
|
|
1568
1677
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1569
1678
|
# constructed with.
|
|
1570
|
-
# @param
|
|
1679
|
+
# @param id [String]
|
|
1571
1680
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1572
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1573
|
-
# `sig/infrawrench/sdk.rbs`.
|
|
1681
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1574
1682
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1575
|
-
def
|
|
1683
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
1576
1684
|
@transport.request(
|
|
1577
|
-
http_method: "
|
|
1578
|
-
path: "/api/org/{orgId}/
|
|
1579
|
-
path_params: { "orgId" => org_id },
|
|
1580
|
-
body: body,
|
|
1685
|
+
http_method: "DELETE",
|
|
1686
|
+
path: "/api/org/{orgId}/cost-centres/rules/{id}",
|
|
1687
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1581
1688
|
request_options: request_options
|
|
1582
1689
|
)
|
|
1583
1690
|
end
|
|
1584
|
-
end
|
|
1585
|
-
|
|
1586
|
-
# `client.costs`
|
|
1587
|
-
class CostsNamespace
|
|
1588
|
-
# @return [CostsAnomalySettingsNamespace] `client.costs.anomaly_settings`
|
|
1589
|
-
attr_reader :anomaly_settings
|
|
1590
|
-
|
|
1591
|
-
# @api private
|
|
1592
|
-
# @param transport [Transport]
|
|
1593
|
-
def initialize(transport)
|
|
1594
|
-
@transport = transport
|
|
1595
|
-
@anomaly_settings = CostsAnomalySettingsNamespace.new(@transport)
|
|
1596
|
-
end
|
|
1597
1691
|
|
|
1598
|
-
# List
|
|
1599
|
-
#
|
|
1600
|
-
# Spend anomalies detected by the daily background pass. Two kinds share the
|
|
1601
|
-
# list: a `spike`, where a provider's or service's spend exceeded its
|
|
1602
|
-
# trailing 28-day baseline by a statistical threshold (mean + N·stddev, with
|
|
1603
|
-
# an absolute floor to ignore penny-scale noise), and a `new_source`, where
|
|
1604
|
-
# a provider or service with no spend at all across that window suddenly
|
|
1605
|
-
# billed a material amount. Thresholds are per organization — see GET
|
|
1606
|
-
# /costs/anomaly-settings. Newest day first, capped at 200 rows.
|
|
1692
|
+
# List allocation rules in evaluation order
|
|
1607
1693
|
#
|
|
1608
1694
|
# _Requires permission: `costs:read`._
|
|
1609
1695
|
#
|
|
1610
|
-
# GET /api/org/{orgId}/
|
|
1611
|
-
#
|
|
1612
|
-
# Raises on 400: Bad request
|
|
1696
|
+
# GET /api/org/{orgId}/cost-centres/rules
|
|
1613
1697
|
#
|
|
1614
1698
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1615
1699
|
# constructed with.
|
|
1616
|
-
# @param days [String, nil] Window in days over anomalous days, 1-90. Defaults to 30.
|
|
1617
1700
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1618
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1701
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<AllocationRule>` — see
|
|
1702
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1619
1703
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1620
|
-
def
|
|
1704
|
+
def list(org_id: nil, request_options: nil)
|
|
1621
1705
|
@transport.request(
|
|
1622
1706
|
http_method: "GET",
|
|
1623
|
-
path: "/api/org/{orgId}/
|
|
1707
|
+
path: "/api/org/{orgId}/cost-centres/rules",
|
|
1624
1708
|
path_params: { "orgId" => org_id },
|
|
1625
|
-
query: { "days" => days },
|
|
1626
1709
|
request_options: request_options
|
|
1627
1710
|
)
|
|
1628
1711
|
end
|
|
1629
1712
|
|
|
1630
|
-
#
|
|
1713
|
+
# Swap the priorities of two allocation rules
|
|
1631
1714
|
#
|
|
1632
|
-
#
|
|
1633
|
-
#
|
|
1715
|
+
# Atomically swaps priorities so first-match-wins order can be edited
|
|
1716
|
+
# without a half-applied pair of independent updates.
|
|
1634
1717
|
#
|
|
1635
|
-
# _Requires permission: `costs:
|
|
1718
|
+
# _Requires permission: `costs:write`._
|
|
1636
1719
|
#
|
|
1637
|
-
#
|
|
1720
|
+
# POST /api/org/{orgId}/cost-centres/rules/swap
|
|
1638
1721
|
#
|
|
1639
1722
|
# Raises on 400: Bad request
|
|
1640
1723
|
#
|
|
1724
|
+
# Raises on 404: Not found
|
|
1725
|
+
#
|
|
1641
1726
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1642
1727
|
# constructed with.
|
|
1643
|
-
# @param
|
|
1644
|
-
# @param tag_key [String, nil]
|
|
1728
|
+
# @param body [Hash] Request body, shaped as `SwapAllocationRulesBody`.
|
|
1645
1729
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1646
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1730
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<AllocationRule>` — see
|
|
1647
1731
|
# `sig/infrawrench/sdk.rbs`.
|
|
1648
1732
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1649
|
-
def
|
|
1733
|
+
def swap(body:, org_id: nil, request_options: nil)
|
|
1650
1734
|
@transport.request(
|
|
1651
|
-
http_method: "
|
|
1652
|
-
path: "/api/org/{orgId}/
|
|
1735
|
+
http_method: "POST",
|
|
1736
|
+
path: "/api/org/{orgId}/cost-centres/rules/swap",
|
|
1653
1737
|
path_params: { "orgId" => org_id },
|
|
1654
|
-
|
|
1738
|
+
body: body,
|
|
1655
1739
|
request_options: request_options
|
|
1656
1740
|
)
|
|
1657
1741
|
end
|
|
1658
1742
|
|
|
1659
|
-
#
|
|
1743
|
+
# Update an allocation rule
|
|
1660
1744
|
#
|
|
1661
|
-
#
|
|
1662
|
-
# cost graphs. Currencies are never merged; mixed-currency orgs get one
|
|
1663
|
-
# series per currency. Optionally returns a previous-period comparison and a
|
|
1664
|
-
# trend forecast.
|
|
1665
|
-
#
|
|
1666
|
-
# _Requires permission: `costs:read`._
|
|
1745
|
+
# _Requires permission: `costs:write`._
|
|
1667
1746
|
#
|
|
1668
|
-
#
|
|
1747
|
+
# PUT /api/org/{orgId}/cost-centres/rules/{id}
|
|
1669
1748
|
#
|
|
1670
1749
|
# Raises on 400: Bad request
|
|
1671
1750
|
#
|
|
1751
|
+
# Raises on 404: Not found
|
|
1752
|
+
#
|
|
1672
1753
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1673
1754
|
# constructed with.
|
|
1674
|
-
# @param
|
|
1755
|
+
# @param id [String]
|
|
1756
|
+
# @param body [Hash] Request body, shaped as `AllocationRuleInput`.
|
|
1675
1757
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1676
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1758
|
+
# @return [Hash] Parsed JSON, shaped as `AllocationRule` — see `sig/infrawrench/sdk.rbs`.
|
|
1677
1759
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1678
|
-
def
|
|
1760
|
+
def update(id:, body:, org_id: nil, request_options: nil)
|
|
1679
1761
|
@transport.request(
|
|
1680
|
-
http_method: "
|
|
1681
|
-
path: "/api/org/{orgId}/
|
|
1682
|
-
path_params: { "orgId" => org_id },
|
|
1762
|
+
http_method: "PUT",
|
|
1763
|
+
path: "/api/org/{orgId}/cost-centres/rules/{id}",
|
|
1764
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1683
1765
|
body: body,
|
|
1684
1766
|
request_options: request_options
|
|
1685
1767
|
)
|
|
1686
1768
|
end
|
|
1769
|
+
end
|
|
1687
1770
|
|
|
1688
|
-
|
|
1771
|
+
# `client.cost_centres`
|
|
1772
|
+
class CostCentresNamespace
|
|
1773
|
+
# @return [CostCentresRulesNamespace] `client.cost_centres.rules`
|
|
1774
|
+
attr_reader :rules
|
|
1775
|
+
|
|
1776
|
+
# @api private
|
|
1777
|
+
# @param transport [Transport]
|
|
1778
|
+
def initialize(transport)
|
|
1779
|
+
@transport = transport
|
|
1780
|
+
@rules = CostCentresRulesNamespace.new(@transport)
|
|
1781
|
+
end
|
|
1782
|
+
|
|
1783
|
+
# Create a cost centre
|
|
1689
1784
|
#
|
|
1690
|
-
#
|
|
1691
|
-
# invoice, an internal chargeback, a colo bill — into the same store the
|
|
1692
|
-
# provider collectors write to, so it appears in cost graphs, dimension
|
|
1693
|
-
# filters, and budgets alongside everything else.
|
|
1785
|
+
# _Requires permission: `costs:write`._
|
|
1694
1786
|
#
|
|
1695
|
-
#
|
|
1696
|
-
# `(source, day, service, region, resourceId, tags, currency)`: pushing the
|
|
1697
|
-
# same day again restates that day rather than adding to it, so a nightly
|
|
1698
|
-
# job can safely re-push a trailing window. Rows pushed under a source can
|
|
1699
|
-
# never overwrite rows a provider collector wrote.
|
|
1700
|
-
#
|
|
1701
|
-
# The whole batch is validated before anything is stored, so a 400 means
|
|
1702
|
-
# nothing was written.
|
|
1703
|
-
#
|
|
1704
|
-
# _Requires permission: `costs:write`._
|
|
1705
|
-
#
|
|
1706
|
-
# POST /api/org/{orgId}/costs/rows
|
|
1787
|
+
# POST /api/org/{orgId}/cost-centres
|
|
1707
1788
|
#
|
|
1708
1789
|
# Raises on 400: Bad request
|
|
1709
1790
|
#
|
|
1710
1791
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1711
1792
|
# constructed with.
|
|
1712
|
-
# @param body [Hash] Request body, shaped as `
|
|
1793
|
+
# @param body [Hash] Request body, shaped as `CostCentreInput`.
|
|
1713
1794
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1714
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1795
|
+
# @return [Hash] Parsed JSON, shaped as `CostCentre` — see `sig/infrawrench/sdk.rbs`.
|
|
1715
1796
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1716
|
-
def
|
|
1797
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
1717
1798
|
@transport.request(
|
|
1718
1799
|
http_method: "POST",
|
|
1719
|
-
path: "/api/org/{orgId}/
|
|
1800
|
+
path: "/api/org/{orgId}/cost-centres",
|
|
1720
1801
|
path_params: { "orgId" => org_id },
|
|
1721
1802
|
body: body,
|
|
1722
1803
|
request_options: request_options
|
|
1723
1804
|
)
|
|
1724
1805
|
end
|
|
1725
1806
|
|
|
1726
|
-
#
|
|
1807
|
+
# Delete a cost centre (its allocation rules go with it)
|
|
1727
1808
|
#
|
|
1728
|
-
#
|
|
1729
|
-
#
|
|
1809
|
+
# _Requires permission: `costs:write`._
|
|
1810
|
+
#
|
|
1811
|
+
# DELETE /api/org/{orgId}/cost-centres/{id}
|
|
1812
|
+
#
|
|
1813
|
+
# Raises on 404: Not found
|
|
1814
|
+
#
|
|
1815
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1816
|
+
# constructed with.
|
|
1817
|
+
# @param id [String]
|
|
1818
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1819
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
1820
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1821
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
1822
|
+
@transport.request(
|
|
1823
|
+
http_method: "DELETE",
|
|
1824
|
+
path: "/api/org/{orgId}/cost-centres/{id}",
|
|
1825
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1826
|
+
request_options: request_options
|
|
1827
|
+
)
|
|
1828
|
+
end
|
|
1829
|
+
|
|
1830
|
+
# List cost centres
|
|
1730
1831
|
#
|
|
1731
1832
|
# _Requires permission: `costs:read`._
|
|
1732
1833
|
#
|
|
1733
|
-
# GET /api/org/{orgId}/
|
|
1834
|
+
# GET /api/org/{orgId}/cost-centres
|
|
1734
1835
|
#
|
|
1735
1836
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1736
1837
|
# constructed with.
|
|
1737
1838
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1738
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1839
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<CostCentre>` — see
|
|
1840
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1739
1841
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1740
|
-
def
|
|
1842
|
+
def list(org_id: nil, request_options: nil)
|
|
1741
1843
|
@transport.request(
|
|
1742
1844
|
http_method: "GET",
|
|
1743
|
-
path: "/api/org/{orgId}/
|
|
1845
|
+
path: "/api/org/{orgId}/cost-centres",
|
|
1744
1846
|
path_params: { "orgId" => org_id },
|
|
1745
1847
|
request_options: request_options
|
|
1746
1848
|
)
|
|
1747
1849
|
end
|
|
1850
|
+
|
|
1851
|
+
# Update a cost centre
|
|
1852
|
+
#
|
|
1853
|
+
# _Requires permission: `costs:write`._
|
|
1854
|
+
#
|
|
1855
|
+
# PUT /api/org/{orgId}/cost-centres/{id}
|
|
1856
|
+
#
|
|
1857
|
+
# Raises on 400: Bad request
|
|
1858
|
+
#
|
|
1859
|
+
# Raises on 404: Not found
|
|
1860
|
+
#
|
|
1861
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1862
|
+
# constructed with.
|
|
1863
|
+
# @param id [String]
|
|
1864
|
+
# @param body [Hash] Request body, shaped as `CostCentreInput`.
|
|
1865
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1866
|
+
# @return [Hash] Parsed JSON, shaped as `CostCentre` — see `sig/infrawrench/sdk.rbs`.
|
|
1867
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1868
|
+
def update(id:, body:, org_id: nil, request_options: nil)
|
|
1869
|
+
@transport.request(
|
|
1870
|
+
http_method: "PUT",
|
|
1871
|
+
path: "/api/org/{orgId}/cost-centres/{id}",
|
|
1872
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
1873
|
+
body: body,
|
|
1874
|
+
request_options: request_options
|
|
1875
|
+
)
|
|
1876
|
+
end
|
|
1748
1877
|
end
|
|
1749
1878
|
|
|
1750
|
-
# `client.
|
|
1751
|
-
class
|
|
1879
|
+
# `client.costs.anomaly_settings`
|
|
1880
|
+
class CostsAnomalySettingsNamespace
|
|
1752
1881
|
# @api private
|
|
1753
1882
|
# @param transport [Transport]
|
|
1754
1883
|
def initialize(transport)
|
|
1755
1884
|
@transport = transport
|
|
1756
1885
|
end
|
|
1757
1886
|
|
|
1758
|
-
#
|
|
1887
|
+
# Get the organization's anomaly detection thresholds
|
|
1759
1888
|
#
|
|
1760
|
-
#
|
|
1889
|
+
# The tunable part of cost anomaly detection. Everything else about the
|
|
1890
|
+
# model — the 28-day baseline, the 7-day notification cooldown, the minimum
|
|
1891
|
+
# history a baseline needs — is fixed. An organization that has never
|
|
1892
|
+
# changed a threshold reads back the defaults. The response also carries the
|
|
1893
|
+
# derived, read-only `smsConfigured`.
|
|
1761
1894
|
#
|
|
1762
|
-
#
|
|
1895
|
+
# _Requires permission: `costs:read`._
|
|
1763
1896
|
#
|
|
1764
|
-
#
|
|
1897
|
+
# GET /api/org/{orgId}/costs/anomaly-settings
|
|
1765
1898
|
#
|
|
1766
1899
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1767
1900
|
# constructed with.
|
|
1768
|
-
# @param body [Hash] Request body, shaped as `CustomGraphCheckRequest`.
|
|
1769
1901
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1770
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1902
|
+
# @return [Hash] Parsed JSON, shaped as `CostAnomalySettingsView` — see
|
|
1771
1903
|
# `sig/infrawrench/sdk.rbs`.
|
|
1772
1904
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1773
|
-
def
|
|
1905
|
+
def get(org_id: nil, request_options: nil)
|
|
1774
1906
|
@transport.request(
|
|
1775
|
-
http_method: "
|
|
1776
|
-
path: "/api/org/{orgId}/
|
|
1907
|
+
http_method: "GET",
|
|
1908
|
+
path: "/api/org/{orgId}/costs/anomaly-settings",
|
|
1777
1909
|
path_params: { "orgId" => org_id },
|
|
1778
|
-
body: body,
|
|
1779
1910
|
request_options: request_options
|
|
1780
1911
|
)
|
|
1781
1912
|
end
|
|
1782
1913
|
|
|
1783
|
-
#
|
|
1914
|
+
# Update the organization's anomaly detection thresholds
|
|
1784
1915
|
#
|
|
1785
|
-
#
|
|
1916
|
+
# Takes effect on the next detection pass (which runs after each cost
|
|
1917
|
+
# collection). Anomalies already stored are not re-judged. All four fields
|
|
1918
|
+
# are required — this is a PUT of the whole settings object, not a patch —
|
|
1919
|
+
# and `smsAlerts` deliberately has no server-side default, so a client that
|
|
1920
|
+
# omits it is rejected rather than silently switching an organization's SMS
|
|
1921
|
+
# paging back off. `smsConfigured` is derived and is not accepted here.
|
|
1786
1922
|
#
|
|
1787
|
-
#
|
|
1923
|
+
# _Requires permission: `costs:write`._
|
|
1788
1924
|
#
|
|
1789
|
-
#
|
|
1925
|
+
# PUT /api/org/{orgId}/costs/anomaly-settings
|
|
1790
1926
|
#
|
|
1791
|
-
# Raises on
|
|
1792
|
-
# this
|
|
1927
|
+
# Raises on 400: Bad request
|
|
1793
1928
|
#
|
|
1794
1929
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1795
1930
|
# constructed with.
|
|
1796
|
-
# @param body [Hash] Request body, shaped as `
|
|
1931
|
+
# @param body [Hash] Request body, shaped as `CostAnomalySettings`.
|
|
1797
1932
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1798
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1933
|
+
# @return [Hash] Parsed JSON, shaped as `CostAnomalySettingsView` — see
|
|
1934
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1799
1935
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1800
|
-
def
|
|
1936
|
+
def update(body:, org_id: nil, request_options: nil)
|
|
1801
1937
|
@transport.request(
|
|
1802
|
-
http_method: "
|
|
1803
|
-
path: "/api/org/{orgId}/
|
|
1938
|
+
http_method: "PUT",
|
|
1939
|
+
path: "/api/org/{orgId}/costs/anomaly-settings",
|
|
1804
1940
|
path_params: { "orgId" => org_id },
|
|
1805
1941
|
body: body,
|
|
1806
1942
|
request_options: request_options
|
|
1807
1943
|
)
|
|
1808
1944
|
end
|
|
1945
|
+
end
|
|
1809
1946
|
|
|
1810
|
-
|
|
1947
|
+
# `client.costs`
|
|
1948
|
+
class CostsNamespace
|
|
1949
|
+
# @return [CostsAnomalySettingsNamespace] `client.costs.anomaly_settings`
|
|
1950
|
+
attr_reader :anomaly_settings
|
|
1951
|
+
|
|
1952
|
+
# @api private
|
|
1953
|
+
# @param transport [Transport]
|
|
1954
|
+
def initialize(transport)
|
|
1955
|
+
@transport = transport
|
|
1956
|
+
@anomaly_settings = CostsAnomalySettingsNamespace.new(@transport)
|
|
1957
|
+
end
|
|
1958
|
+
|
|
1959
|
+
# List recently detected cost anomalies
|
|
1811
1960
|
#
|
|
1812
|
-
#
|
|
1961
|
+
# Spend anomalies detected by the daily background pass. Two kinds share the
|
|
1962
|
+
# list: a `spike`, where a provider's or service's spend exceeded its
|
|
1963
|
+
# trailing 28-day baseline by a statistical threshold (mean + N·stddev, with
|
|
1964
|
+
# an absolute floor to ignore penny-scale noise), and a `new_source`, where
|
|
1965
|
+
# a provider or service with no spend at all across that window suddenly
|
|
1966
|
+
# billed a material amount. Thresholds are per organization — see GET
|
|
1967
|
+
# /costs/anomaly-settings. Newest day first, capped at 200 rows.
|
|
1813
1968
|
#
|
|
1814
|
-
#
|
|
1969
|
+
# _Requires permission: `costs:read`._
|
|
1815
1970
|
#
|
|
1816
|
-
#
|
|
1971
|
+
# GET /api/org/{orgId}/costs/anomalies
|
|
1972
|
+
#
|
|
1973
|
+
# Raises on 400: Bad request
|
|
1817
1974
|
#
|
|
1818
1975
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1819
1976
|
# constructed with.
|
|
1820
|
-
# @param
|
|
1977
|
+
# @param days [String, nil] Window in days over anomalous days, 1-90. Defaults to 30.
|
|
1821
1978
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1822
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1979
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
1823
1980
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1824
|
-
def
|
|
1981
|
+
def anomalies(org_id: nil, days: nil, request_options: nil)
|
|
1825
1982
|
@transport.request(
|
|
1826
|
-
http_method: "
|
|
1827
|
-
path: "/api/org/{orgId}/
|
|
1828
|
-
path_params: { "orgId" => org_id
|
|
1983
|
+
http_method: "GET",
|
|
1984
|
+
path: "/api/org/{orgId}/costs/anomalies",
|
|
1985
|
+
path_params: { "orgId" => org_id },
|
|
1986
|
+
query: { "days" => days },
|
|
1829
1987
|
request_options: request_options
|
|
1830
1988
|
)
|
|
1831
1989
|
end
|
|
1832
1990
|
|
|
1833
|
-
#
|
|
1991
|
+
# List distinct values for a cost dimension
|
|
1834
1992
|
#
|
|
1835
|
-
#
|
|
1993
|
+
# Feeds the filter and group-by pickers. Pass dimension=tag-keys for tag
|
|
1994
|
+
# keys; dimension=tag requires tagKey.
|
|
1836
1995
|
#
|
|
1837
|
-
#
|
|
1996
|
+
# _Requires permission: `costs:read`._
|
|
1838
1997
|
#
|
|
1839
|
-
#
|
|
1998
|
+
# GET /api/org/{orgId}/costs/dimensions
|
|
1999
|
+
#
|
|
2000
|
+
# Raises on 400: Bad request
|
|
1840
2001
|
#
|
|
1841
2002
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1842
2003
|
# constructed with.
|
|
1843
|
-
# @param
|
|
2004
|
+
# @param dimension [String]
|
|
2005
|
+
# @param tag_key [String, nil]
|
|
1844
2006
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1845
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
2007
|
+
# @return [Hash] Parsed JSON, shaped as `CostDimensionValues` — see
|
|
2008
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
1846
2009
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1847
|
-
def
|
|
2010
|
+
def dimensions(dimension:, org_id: nil, tag_key: nil, request_options: nil)
|
|
1848
2011
|
@transport.request(
|
|
1849
2012
|
http_method: "GET",
|
|
1850
|
-
path: "/api/org/{orgId}/
|
|
1851
|
-
path_params: { "orgId" => org_id
|
|
2013
|
+
path: "/api/org/{orgId}/costs/dimensions",
|
|
2014
|
+
path_params: { "orgId" => org_id },
|
|
2015
|
+
query: { "dimension" => dimension, "tagKey" => tag_key },
|
|
1852
2016
|
request_options: request_options
|
|
1853
2017
|
)
|
|
1854
2018
|
end
|
|
1855
2019
|
|
|
1856
|
-
#
|
|
2020
|
+
# Query aggregated cost series
|
|
1857
2021
|
#
|
|
1858
|
-
#
|
|
2022
|
+
# Aggregates collected provider spend into per-bucket, per-group series for
|
|
2023
|
+
# cost graphs. Currencies are never merged; mixed-currency orgs get one
|
|
2024
|
+
# series per currency. Optionally returns a previous-period comparison and a
|
|
2025
|
+
# trend forecast.
|
|
1859
2026
|
#
|
|
1860
|
-
#
|
|
2027
|
+
# _Requires permission: `costs:read`._
|
|
2028
|
+
#
|
|
2029
|
+
# POST /api/org/{orgId}/costs/query
|
|
2030
|
+
#
|
|
2031
|
+
# Raises on 400: Bad request
|
|
1861
2032
|
#
|
|
1862
2033
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1863
2034
|
# constructed with.
|
|
2035
|
+
# @param body [Hash] Request body, shaped as `CostQueryRequest`.
|
|
1864
2036
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1865
|
-
# @return [
|
|
1866
|
-
# `sig/infrawrench/sdk.rbs`.
|
|
2037
|
+
# @return [Hash] Parsed JSON, shaped as `CostQueryResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
1867
2038
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1868
|
-
def
|
|
2039
|
+
def query(body:, org_id: nil, request_options: nil)
|
|
1869
2040
|
@transport.request(
|
|
1870
|
-
http_method: "
|
|
1871
|
-
path: "/api/org/{orgId}/
|
|
2041
|
+
http_method: "POST",
|
|
2042
|
+
path: "/api/org/{orgId}/costs/query",
|
|
1872
2043
|
path_params: { "orgId" => org_id },
|
|
2044
|
+
body: body,
|
|
1873
2045
|
request_options: request_options
|
|
1874
2046
|
)
|
|
1875
2047
|
end
|
|
1876
2048
|
|
|
1877
|
-
#
|
|
2049
|
+
# Push cost rows from your own systems
|
|
1878
2050
|
#
|
|
1879
|
-
#
|
|
2051
|
+
# Reports spend Infrawrench has no provider plugin for — a parsed SaaS
|
|
2052
|
+
# invoice, an internal chargeback, a colo bill — into the same store the
|
|
2053
|
+
# provider collectors write to, so it appears in cost graphs, dimension
|
|
2054
|
+
# filters, and budgets alongside everything else.
|
|
1880
2055
|
#
|
|
1881
|
-
#
|
|
2056
|
+
# Rows are grouped under a caller-chosen `source`. Writes are idempotent per
|
|
2057
|
+
# `(source, day, service, region, resourceId, tags, currency)`: pushing the
|
|
2058
|
+
# same day again restates that day rather than adding to it, so a nightly
|
|
2059
|
+
# job can safely re-push a trailing window. Rows pushed under a source can
|
|
2060
|
+
# never overwrite rows a provider collector wrote.
|
|
1882
2061
|
#
|
|
1883
|
-
#
|
|
2062
|
+
# The whole batch is validated before anything is stored, so a 400 means
|
|
2063
|
+
# nothing was written.
|
|
1884
2064
|
#
|
|
1885
|
-
#
|
|
1886
|
-
# this
|
|
2065
|
+
# _Requires permission: `costs:write`._
|
|
1887
2066
|
#
|
|
1888
|
-
#
|
|
2067
|
+
# POST /api/org/{orgId}/costs/rows
|
|
2068
|
+
#
|
|
2069
|
+
# Raises on 400: Bad request
|
|
1889
2070
|
#
|
|
1890
2071
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1891
2072
|
# constructed with.
|
|
1892
|
-
# @param
|
|
1893
|
-
# @param body [Hash, nil] Request body, shaped as `CustomGraphRenderRequest`.
|
|
2073
|
+
# @param body [Hash] Request body, shaped as `CostPushRequest`.
|
|
1894
2074
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1895
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
1896
|
-
# `sig/infrawrench/sdk.rbs`.
|
|
2075
|
+
# @return [Hash] Parsed JSON, shaped as `CostPushResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
1897
2076
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1898
|
-
def
|
|
2077
|
+
def rows(body:, org_id: nil, request_options: nil)
|
|
1899
2078
|
@transport.request(
|
|
1900
2079
|
http_method: "POST",
|
|
1901
|
-
path: "/api/org/{orgId}/
|
|
1902
|
-
path_params: { "orgId" => org_id
|
|
2080
|
+
path: "/api/org/{orgId}/costs/rows",
|
|
2081
|
+
path_params: { "orgId" => org_id },
|
|
1903
2082
|
body: body,
|
|
1904
2083
|
request_options: request_options
|
|
1905
2084
|
)
|
|
1906
2085
|
end
|
|
1907
2086
|
|
|
1908
|
-
#
|
|
2087
|
+
# Spend grouped by cost centre (showback)
|
|
1909
2088
|
#
|
|
1910
|
-
#
|
|
2089
|
+
# Runs the org's allocation rules over collected spend and sums per cost
|
|
2090
|
+
# centre and currency. Spend no rule claims comes back as the "Unallocated"
|
|
2091
|
+
# bucket; every defined centre appears even with zero spend.
|
|
1911
2092
|
#
|
|
1912
|
-
#
|
|
2093
|
+
# _Requires permission: `costs:read`._
|
|
2094
|
+
#
|
|
2095
|
+
# GET /api/org/{orgId}/costs/showback
|
|
2096
|
+
#
|
|
2097
|
+
# Raises on 400: Bad request
|
|
1913
2098
|
#
|
|
1914
2099
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
1915
2100
|
# constructed with.
|
|
2101
|
+
# @param from [String, nil] Defaults to 30 days ago.
|
|
2102
|
+
# @param to [String, nil] Defaults to today.
|
|
1916
2103
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
1917
|
-
# @return [
|
|
2104
|
+
# @return [Hash] Parsed JSON, shaped as `ShowbackReport` — see `sig/infrawrench/sdk.rbs`.
|
|
1918
2105
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
1919
|
-
def
|
|
2106
|
+
def showback(org_id: nil, from: nil, to: nil, request_options: nil)
|
|
1920
2107
|
@transport.request(
|
|
1921
2108
|
http_method: "GET",
|
|
1922
|
-
path: "/api/org/{orgId}/
|
|
2109
|
+
path: "/api/org/{orgId}/costs/showback",
|
|
1923
2110
|
path_params: { "orgId" => org_id },
|
|
1924
|
-
|
|
2111
|
+
query: { "from" => from, "to" => to },
|
|
1925
2112
|
request_options: request_options
|
|
1926
2113
|
)
|
|
1927
2114
|
end
|
|
1928
2115
|
|
|
1929
|
-
#
|
|
2116
|
+
# Per-account cost collection status
|
|
1930
2117
|
#
|
|
1931
|
-
#
|
|
2118
|
+
# Which accounts support cost collection, whether their history backfill has
|
|
2119
|
+
# completed, and the ingested date coverage.
|
|
1932
2120
|
#
|
|
1933
|
-
#
|
|
2121
|
+
# _Requires permission: `costs:read`._
|
|
2122
|
+
#
|
|
2123
|
+
# GET /api/org/{orgId}/costs/status
|
|
2124
|
+
#
|
|
2125
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2126
|
+
# constructed with.
|
|
2127
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2128
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
2129
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2130
|
+
def status(org_id: nil, request_options: nil)
|
|
2131
|
+
@transport.request(
|
|
2132
|
+
http_method: "GET",
|
|
2133
|
+
path: "/api/org/{orgId}/costs/status",
|
|
2134
|
+
path_params: { "orgId" => org_id },
|
|
2135
|
+
request_options: request_options
|
|
2136
|
+
)
|
|
2137
|
+
end
|
|
2138
|
+
|
|
2139
|
+
# Untagged spend over the required tag keys
|
|
2140
|
+
#
|
|
2141
|
+
# Spend on cost rows missing at least one of the org's required tag keys,
|
|
2142
|
+
# overall and per key, plus the largest untagged (account, service) buckets.
|
|
2143
|
+
# Empty when no tag policy is configured — untagged is only meaningful
|
|
2144
|
+
# against a policy.
|
|
2145
|
+
#
|
|
2146
|
+
# _Requires permission: `costs:read`._
|
|
2147
|
+
#
|
|
2148
|
+
# GET /api/org/{orgId}/costs/untagged
|
|
2149
|
+
#
|
|
2150
|
+
# Raises on 400: Bad request
|
|
2151
|
+
#
|
|
2152
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2153
|
+
# constructed with.
|
|
2154
|
+
# @param from [String, nil] Defaults to 30 days ago.
|
|
2155
|
+
# @param to [String, nil] Defaults to today.
|
|
2156
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2157
|
+
# @return [Hash] Parsed JSON, shaped as `UntaggedSpendReport` — see
|
|
2158
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2159
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2160
|
+
def untagged(org_id: nil, from: nil, to: nil, request_options: nil)
|
|
2161
|
+
@transport.request(
|
|
2162
|
+
http_method: "GET",
|
|
2163
|
+
path: "/api/org/{orgId}/costs/untagged",
|
|
2164
|
+
path_params: { "orgId" => org_id },
|
|
2165
|
+
query: { "from" => from, "to" => to },
|
|
2166
|
+
request_options: request_options
|
|
2167
|
+
)
|
|
2168
|
+
end
|
|
2169
|
+
end
|
|
2170
|
+
|
|
2171
|
+
# `client.custom_graphs`
|
|
2172
|
+
class CustomGraphsNamespace
|
|
2173
|
+
# @api private
|
|
2174
|
+
# @param transport [Transport]
|
|
2175
|
+
def initialize(transport)
|
|
2176
|
+
@transport = transport
|
|
2177
|
+
end
|
|
2178
|
+
|
|
2179
|
+
# Type-check custom-graph source without saving it
|
|
2180
|
+
#
|
|
2181
|
+
# _Requires permission: `dashboards:read`._
|
|
2182
|
+
#
|
|
2183
|
+
# POST /api/org/{orgId}/custom-graphs/check
|
|
2184
|
+
#
|
|
2185
|
+
# Raises on 400: Bad request
|
|
2186
|
+
#
|
|
2187
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2188
|
+
# constructed with.
|
|
2189
|
+
# @param body [Hash] Request body, shaped as `CustomGraphCheckRequest`.
|
|
2190
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2191
|
+
# @return [Hash] Parsed JSON, shaped as `CustomGraphCheckResult` — see
|
|
2192
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2193
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2194
|
+
def check(body:, org_id: nil, request_options: nil)
|
|
2195
|
+
@transport.request(
|
|
2196
|
+
http_method: "POST",
|
|
2197
|
+
path: "/api/org/{orgId}/custom-graphs/check",
|
|
2198
|
+
path_params: { "orgId" => org_id },
|
|
2199
|
+
body: body,
|
|
2200
|
+
request_options: request_options
|
|
2201
|
+
)
|
|
2202
|
+
end
|
|
2203
|
+
|
|
2204
|
+
# Create a custom graph (paid plan required)
|
|
2205
|
+
#
|
|
2206
|
+
# _Requires permission: `dashboards:write`._
|
|
2207
|
+
#
|
|
2208
|
+
# POST /api/org/{orgId}/custom-graphs
|
|
2209
|
+
#
|
|
2210
|
+
# Raises on 400: Bad request
|
|
2211
|
+
#
|
|
2212
|
+
# Raises on 402: Payment required — the organization's plan does not include
|
|
2213
|
+
# this
|
|
2214
|
+
#
|
|
2215
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2216
|
+
# constructed with.
|
|
2217
|
+
# @param body [Hash] Request body, shaped as `CustomGraphInput`.
|
|
2218
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2219
|
+
# @return [Hash] Parsed JSON, shaped as `CustomGraphFull` — see `sig/infrawrench/sdk.rbs`.
|
|
2220
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2221
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
2222
|
+
@transport.request(
|
|
2223
|
+
http_method: "POST",
|
|
2224
|
+
path: "/api/org/{orgId}/custom-graphs",
|
|
2225
|
+
path_params: { "orgId" => org_id },
|
|
2226
|
+
body: body,
|
|
2227
|
+
request_options: request_options
|
|
2228
|
+
)
|
|
2229
|
+
end
|
|
2230
|
+
|
|
2231
|
+
# Delete a custom graph (and its dashboard cards)
|
|
2232
|
+
#
|
|
2233
|
+
# _Requires permission: `dashboards:write`._
|
|
2234
|
+
#
|
|
2235
|
+
# DELETE /api/org/{orgId}/custom-graphs/{id}
|
|
2236
|
+
#
|
|
2237
|
+
# Raises on 404: Not found
|
|
2238
|
+
#
|
|
2239
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2240
|
+
# constructed with.
|
|
2241
|
+
# @param id [String]
|
|
2242
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2243
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
2244
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2245
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
2246
|
+
@transport.request(
|
|
2247
|
+
http_method: "DELETE",
|
|
2248
|
+
path: "/api/org/{orgId}/custom-graphs/{id}",
|
|
2249
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
2250
|
+
request_options: request_options
|
|
2251
|
+
)
|
|
2252
|
+
end
|
|
2253
|
+
|
|
2254
|
+
# Get a custom graph (including source)
|
|
2255
|
+
#
|
|
2256
|
+
# _Requires permission: `dashboards:read`._
|
|
2257
|
+
#
|
|
2258
|
+
# GET /api/org/{orgId}/custom-graphs/{id}
|
|
2259
|
+
#
|
|
2260
|
+
# Raises on 404: Not found
|
|
2261
|
+
#
|
|
2262
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2263
|
+
# constructed with.
|
|
2264
|
+
# @param id [String]
|
|
2265
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2266
|
+
# @return [Hash] Parsed JSON, shaped as `CustomGraphFull` — see `sig/infrawrench/sdk.rbs`.
|
|
2267
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2268
|
+
def get(id:, org_id: nil, request_options: nil)
|
|
2269
|
+
@transport.request(
|
|
2270
|
+
http_method: "GET",
|
|
2271
|
+
path: "/api/org/{orgId}/custom-graphs/{id}",
|
|
2272
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
2273
|
+
request_options: request_options
|
|
2274
|
+
)
|
|
2275
|
+
end
|
|
2276
|
+
|
|
2277
|
+
# List custom graphs
|
|
2278
|
+
#
|
|
2279
|
+
# _Requires permission: `dashboards:read`._
|
|
2280
|
+
#
|
|
2281
|
+
# GET /api/org/{orgId}/custom-graphs
|
|
2282
|
+
#
|
|
2283
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2284
|
+
# constructed with.
|
|
2285
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2286
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<CustomGraphSummary>` — see
|
|
2287
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2288
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2289
|
+
def list(org_id: nil, request_options: nil)
|
|
2290
|
+
@transport.request(
|
|
2291
|
+
http_method: "GET",
|
|
2292
|
+
path: "/api/org/{orgId}/custom-graphs",
|
|
2293
|
+
path_params: { "orgId" => org_id },
|
|
2294
|
+
request_options: request_options
|
|
2295
|
+
)
|
|
2296
|
+
end
|
|
2297
|
+
|
|
2298
|
+
# Run the graph's script and return its render spec (paid plan required)
|
|
2299
|
+
#
|
|
2300
|
+
# _Requires permission: `dashboards:read`._
|
|
2301
|
+
#
|
|
2302
|
+
# POST /api/org/{orgId}/custom-graphs/{id}/render
|
|
2303
|
+
#
|
|
2304
|
+
# Raises on 400: Bad request
|
|
2305
|
+
#
|
|
2306
|
+
# Raises on 402: Payment required — the organization's plan does not include
|
|
2307
|
+
# this
|
|
2308
|
+
#
|
|
2309
|
+
# Raises on 404: Not found
|
|
2310
|
+
#
|
|
2311
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2312
|
+
# constructed with.
|
|
2313
|
+
# @param id [String]
|
|
2314
|
+
# @param body [Hash, nil] Request body, shaped as `CustomGraphRenderRequest`.
|
|
2315
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2316
|
+
# @return [Hash] Parsed JSON, shaped as `CustomGraphRenderResult` — see
|
|
2317
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2318
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2319
|
+
def render(id:, org_id: nil, body: nil, request_options: nil)
|
|
2320
|
+
@transport.request(
|
|
2321
|
+
http_method: "POST",
|
|
2322
|
+
path: "/api/org/{orgId}/custom-graphs/{id}/render",
|
|
2323
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
2324
|
+
body: body,
|
|
2325
|
+
request_options: request_options
|
|
2326
|
+
)
|
|
2327
|
+
end
|
|
2328
|
+
|
|
2329
|
+
# The ambient graph.d.ts for custom-graph source
|
|
2330
|
+
#
|
|
2331
|
+
# _Requires permission: `dashboards:read`._
|
|
2332
|
+
#
|
|
2333
|
+
# GET /api/org/{orgId}/custom-graphs/typings
|
|
2334
|
+
#
|
|
2335
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2336
|
+
# constructed with.
|
|
2337
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2338
|
+
# @return [String] Raw response bytes.
|
|
2339
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2340
|
+
def typings(org_id: nil, request_options: nil)
|
|
2341
|
+
@transport.request(
|
|
2342
|
+
http_method: "GET",
|
|
2343
|
+
path: "/api/org/{orgId}/custom-graphs/typings",
|
|
2344
|
+
path_params: { "orgId" => org_id },
|
|
2345
|
+
accept: :binary,
|
|
2346
|
+
request_options: request_options
|
|
2347
|
+
)
|
|
2348
|
+
end
|
|
2349
|
+
|
|
2350
|
+
# Update a custom graph (paid plan required)
|
|
2351
|
+
#
|
|
2352
|
+
# _Requires permission: `dashboards:write`._
|
|
2353
|
+
#
|
|
2354
|
+
# PUT /api/org/{orgId}/custom-graphs/{id}
|
|
1934
2355
|
#
|
|
1935
2356
|
# Raises on 400: Bad request
|
|
1936
2357
|
#
|
|
@@ -2594,554 +3015,1089 @@ module Infrawrench
|
|
|
2594
3015
|
# @param id [String]
|
|
2595
3016
|
# @param body [Hash, nil] Request body, shaped as `DeployRollbackInput`.
|
|
2596
3017
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2597
|
-
# @return [Hash] Parsed JSON, shaped as `DeployPlanResult` — see `sig/infrawrench/sdk.rbs`.
|
|
3018
|
+
# @return [Hash] Parsed JSON, shaped as `DeployPlanResult` — see `sig/infrawrench/sdk.rbs`.
|
|
3019
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3020
|
+
def rollback(id:, org_id: nil, body: nil, request_options: nil)
|
|
3021
|
+
@transport.request(
|
|
3022
|
+
http_method: "POST",
|
|
3023
|
+
path: "/api/org/{orgId}/deployments/runs/{id}/rollback",
|
|
3024
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3025
|
+
body: body,
|
|
3026
|
+
request_options: request_options
|
|
3027
|
+
)
|
|
3028
|
+
end
|
|
3029
|
+
end
|
|
3030
|
+
|
|
3031
|
+
# `client.deployments.triggers`
|
|
3032
|
+
class DeploymentsTriggersNamespace
|
|
3033
|
+
# @api private
|
|
3034
|
+
# @param transport [Transport]
|
|
3035
|
+
def initialize(transport)
|
|
3036
|
+
@transport = transport
|
|
3037
|
+
end
|
|
3038
|
+
|
|
3039
|
+
# Deploy an environment whenever a branch moves
|
|
3040
|
+
#
|
|
3041
|
+
# Arming a trigger records the branch's current commit WITHOUT deploying it
|
|
3042
|
+
# — the trigger fires on the next push, not on the state at the moment it
|
|
3043
|
+
# was created. The environment is validated against the Infrafile at that
|
|
3044
|
+
# branch head, so a typo fails here rather than silently never firing.
|
|
3045
|
+
#
|
|
3046
|
+
# _Requires permission: `deployments:write`._
|
|
3047
|
+
#
|
|
3048
|
+
# POST /api/org/{orgId}/deployments/triggers
|
|
3049
|
+
#
|
|
3050
|
+
# Raises on 400: Bad request
|
|
3051
|
+
#
|
|
3052
|
+
# Raises on 401: Unauthenticated
|
|
3053
|
+
#
|
|
3054
|
+
# Raises on 403: Forbidden
|
|
3055
|
+
#
|
|
3056
|
+
# Raises on 404: Not found
|
|
3057
|
+
#
|
|
3058
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3059
|
+
# constructed with.
|
|
3060
|
+
# @param body [Hash, nil] Request body, shaped as `DeployTriggerInput`.
|
|
3061
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3062
|
+
# @return [Hash] Parsed JSON, shaped as `DeployTrigger` — see `sig/infrawrench/sdk.rbs`.
|
|
3063
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3064
|
+
def create(org_id: nil, body: nil, request_options: nil)
|
|
3065
|
+
@transport.request(
|
|
3066
|
+
http_method: "POST",
|
|
3067
|
+
path: "/api/org/{orgId}/deployments/triggers",
|
|
3068
|
+
path_params: { "orgId" => org_id },
|
|
3069
|
+
body: body,
|
|
3070
|
+
request_options: request_options
|
|
3071
|
+
)
|
|
3072
|
+
end
|
|
3073
|
+
|
|
3074
|
+
# Delete a deploy trigger
|
|
3075
|
+
#
|
|
3076
|
+
# _Requires permission: `deployments:write`._
|
|
3077
|
+
#
|
|
3078
|
+
# DELETE /api/org/{orgId}/deployments/triggers/{id}
|
|
3079
|
+
#
|
|
3080
|
+
# Raises on 401: Unauthenticated
|
|
3081
|
+
#
|
|
3082
|
+
# Raises on 403: Forbidden
|
|
3083
|
+
#
|
|
3084
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3085
|
+
# constructed with.
|
|
3086
|
+
# @param id [String]
|
|
3087
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3088
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
3089
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3090
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
3091
|
+
@transport.request(
|
|
3092
|
+
http_method: "DELETE",
|
|
3093
|
+
path: "/api/org/{orgId}/deployments/triggers/{id}",
|
|
3094
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3095
|
+
request_options: request_options
|
|
3096
|
+
)
|
|
3097
|
+
end
|
|
3098
|
+
|
|
3099
|
+
# List deploy-on-push triggers
|
|
3100
|
+
#
|
|
3101
|
+
# _Requires permission: `deployments:read`._
|
|
3102
|
+
#
|
|
3103
|
+
# GET /api/org/{orgId}/deployments/triggers
|
|
3104
|
+
#
|
|
3105
|
+
# Raises on 401: Unauthenticated
|
|
3106
|
+
#
|
|
3107
|
+
# Raises on 403: Forbidden
|
|
3108
|
+
#
|
|
3109
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3110
|
+
# constructed with.
|
|
3111
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3112
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<DeployTrigger>` — see
|
|
3113
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3114
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3115
|
+
def list(org_id: nil, request_options: nil)
|
|
3116
|
+
@transport.request(
|
|
3117
|
+
http_method: "GET",
|
|
3118
|
+
path: "/api/org/{orgId}/deployments/triggers",
|
|
3119
|
+
path_params: { "orgId" => org_id },
|
|
3120
|
+
request_options: request_options
|
|
3121
|
+
)
|
|
3122
|
+
end
|
|
3123
|
+
|
|
3124
|
+
# Enable or disable a deploy trigger
|
|
3125
|
+
#
|
|
3126
|
+
# _Requires permission: `deployments:write`._
|
|
3127
|
+
#
|
|
3128
|
+
# PATCH /api/org/{orgId}/deployments/triggers/{id}
|
|
3129
|
+
#
|
|
3130
|
+
# Raises on 401: Unauthenticated
|
|
3131
|
+
#
|
|
3132
|
+
# Raises on 403: Forbidden
|
|
3133
|
+
#
|
|
3134
|
+
# Raises on 404: Not found
|
|
3135
|
+
#
|
|
3136
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3137
|
+
# constructed with.
|
|
3138
|
+
# @param id [String]
|
|
3139
|
+
# @param body [Hash, nil] Request body, shaped as `Hash`.
|
|
3140
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3141
|
+
# @return [Hash] Parsed JSON, shaped as `DeployTrigger` — see `sig/infrawrench/sdk.rbs`.
|
|
3142
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3143
|
+
def update(id:, org_id: nil, body: nil, request_options: nil)
|
|
3144
|
+
@transport.request(
|
|
3145
|
+
http_method: "PATCH",
|
|
3146
|
+
path: "/api/org/{orgId}/deployments/triggers/{id}",
|
|
3147
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3148
|
+
body: body,
|
|
3149
|
+
request_options: request_options
|
|
3150
|
+
)
|
|
3151
|
+
end
|
|
3152
|
+
end
|
|
3153
|
+
|
|
3154
|
+
# `client.deployments`
|
|
3155
|
+
class DeploymentsNamespace
|
|
3156
|
+
# @return [DeploymentsRunsNamespace] `client.deployments.runs`
|
|
3157
|
+
attr_reader :runs
|
|
3158
|
+
# @return [DeploymentsTriggersNamespace] `client.deployments.triggers`
|
|
3159
|
+
attr_reader :triggers
|
|
3160
|
+
|
|
3161
|
+
# @api private
|
|
3162
|
+
# @param transport [Transport]
|
|
3163
|
+
def initialize(transport)
|
|
3164
|
+
@transport = transport
|
|
3165
|
+
@runs = DeploymentsRunsNamespace.new(@transport)
|
|
3166
|
+
@triggers = DeploymentsTriggersNamespace.new(@transport)
|
|
3167
|
+
end
|
|
3168
|
+
|
|
3169
|
+
# List the environments a repository's Infrafile declares
|
|
3170
|
+
#
|
|
3171
|
+
# Reads `Infrafile` at the branch head and returns its declared
|
|
3172
|
+
# environments. The file is parsed, not executed.
|
|
3173
|
+
#
|
|
3174
|
+
# _Requires permission: `deployments:read`._
|
|
3175
|
+
#
|
|
3176
|
+
# POST /api/org/{orgId}/deployments/envs
|
|
3177
|
+
#
|
|
3178
|
+
# Raises on 400: Bad request
|
|
3179
|
+
#
|
|
3180
|
+
# Raises on 401: Unauthenticated
|
|
3181
|
+
#
|
|
3182
|
+
# Raises on 403: Forbidden
|
|
3183
|
+
#
|
|
3184
|
+
# Raises on 404: Not found
|
|
3185
|
+
#
|
|
3186
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3187
|
+
# constructed with.
|
|
3188
|
+
# @param body [Hash, nil] Request body, shaped as `DeployEnvsInput`.
|
|
3189
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3190
|
+
# @return [Hash] Parsed JSON, shaped as `DeployEnvs` — see `sig/infrawrench/sdk.rbs`.
|
|
3191
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3192
|
+
def envs(org_id: nil, body: nil, request_options: nil)
|
|
3193
|
+
@transport.request(
|
|
3194
|
+
http_method: "POST",
|
|
3195
|
+
path: "/api/org/{orgId}/deployments/envs",
|
|
3196
|
+
path_params: { "orgId" => org_id },
|
|
3197
|
+
body: body,
|
|
3198
|
+
request_options: request_options
|
|
3199
|
+
)
|
|
3200
|
+
end
|
|
3201
|
+
|
|
3202
|
+
# Preview a deploy without building
|
|
3203
|
+
#
|
|
3204
|
+
# Runs the Infrafile's `plan()` and renders its Dockerfile, then stops.
|
|
3205
|
+
# Nothing is built or deployed.
|
|
3206
|
+
#
|
|
3207
|
+
# _Requires permission: `deployments:plan`._
|
|
3208
|
+
#
|
|
3209
|
+
# POST /api/org/{orgId}/deployments/plan
|
|
3210
|
+
#
|
|
3211
|
+
# Raises on 400: Bad request
|
|
3212
|
+
#
|
|
3213
|
+
# Raises on 401: Unauthenticated
|
|
3214
|
+
#
|
|
3215
|
+
# Raises on 403: Forbidden
|
|
3216
|
+
#
|
|
3217
|
+
# Raises on 404: Not found
|
|
3218
|
+
#
|
|
3219
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3220
|
+
# constructed with.
|
|
3221
|
+
# @param body [Hash, nil] Request body, shaped as `DeployPlanInput`.
|
|
3222
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3223
|
+
# @return [Hash] Parsed JSON, shaped as `DeployPlanResult` — see `sig/infrawrench/sdk.rbs`.
|
|
3224
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3225
|
+
def plan(org_id: nil, body: nil, request_options: nil)
|
|
3226
|
+
@transport.request(
|
|
3227
|
+
http_method: "POST",
|
|
3228
|
+
path: "/api/org/{orgId}/deployments/plan",
|
|
3229
|
+
path_params: { "orgId" => org_id },
|
|
3230
|
+
body: body,
|
|
3231
|
+
request_options: request_options
|
|
3232
|
+
)
|
|
3233
|
+
end
|
|
3234
|
+
|
|
3235
|
+
# List repositories this organization can deploy from
|
|
3236
|
+
#
|
|
3237
|
+
# Repositories visible to the organization's GitHub App installations. Empty
|
|
3238
|
+
# when the app is not configured.
|
|
3239
|
+
#
|
|
3240
|
+
# _Requires permission: `deployments:read`._
|
|
3241
|
+
#
|
|
3242
|
+
# GET /api/org/{orgId}/deployments/repos
|
|
3243
|
+
#
|
|
3244
|
+
# Raises on 401: Unauthenticated
|
|
3245
|
+
#
|
|
3246
|
+
# Raises on 403: Forbidden
|
|
3247
|
+
#
|
|
3248
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3249
|
+
# constructed with.
|
|
3250
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3251
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<DeployRepo>` — see
|
|
3252
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3253
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3254
|
+
def repos(org_id: nil, request_options: nil)
|
|
3255
|
+
@transport.request(
|
|
3256
|
+
http_method: "GET",
|
|
3257
|
+
path: "/api/org/{orgId}/deployments/repos",
|
|
3258
|
+
path_params: { "orgId" => org_id },
|
|
3259
|
+
request_options: request_options
|
|
3260
|
+
)
|
|
3261
|
+
end
|
|
3262
|
+
end
|
|
3263
|
+
|
|
3264
|
+
# `client.digest.recipients`
|
|
3265
|
+
class DigestRecipientsNamespace
|
|
3266
|
+
# @api private
|
|
3267
|
+
# @param transport [Transport]
|
|
3268
|
+
def initialize(transport)
|
|
3269
|
+
@transport = transport
|
|
3270
|
+
end
|
|
3271
|
+
|
|
3272
|
+
# Add a digest email recipient
|
|
3273
|
+
#
|
|
3274
|
+
# Adding an address the organization already has is a no-op that returns the
|
|
3275
|
+
# existing entry, so a double submit cannot double-deliver.
|
|
3276
|
+
#
|
|
3277
|
+
# POST /api/org/{orgId}/digest/recipients
|
|
3278
|
+
#
|
|
3279
|
+
# Raises on 400: Bad request
|
|
3280
|
+
#
|
|
3281
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3282
|
+
# constructed with.
|
|
3283
|
+
# @param body [Hash, nil] Request body, shaped as `DigestEmailRecipientCreate`.
|
|
3284
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3285
|
+
# @return [Hash] Parsed JSON, shaped as `DigestEmailRecipient` — see
|
|
3286
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3287
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3288
|
+
def create(org_id: nil, body: nil, request_options: nil)
|
|
3289
|
+
@transport.request(
|
|
3290
|
+
http_method: "POST",
|
|
3291
|
+
path: "/api/org/{orgId}/digest/recipients",
|
|
3292
|
+
path_params: { "orgId" => org_id },
|
|
3293
|
+
body: body,
|
|
3294
|
+
request_options: request_options
|
|
3295
|
+
)
|
|
3296
|
+
end
|
|
3297
|
+
|
|
3298
|
+
# Remove a digest email recipient
|
|
3299
|
+
#
|
|
3300
|
+
# DELETE /api/org/{orgId}/digest/recipients/{recipientId}
|
|
3301
|
+
#
|
|
3302
|
+
# Raises on 404: Not found
|
|
3303
|
+
#
|
|
3304
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3305
|
+
# constructed with.
|
|
3306
|
+
# @param recipient_id [String] Recipient id
|
|
3307
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3308
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
3309
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3310
|
+
def delete(recipient_id:, org_id: nil, request_options: nil)
|
|
3311
|
+
@transport.request(
|
|
3312
|
+
http_method: "DELETE",
|
|
3313
|
+
path: "/api/org/{orgId}/digest/recipients/{recipientId}",
|
|
3314
|
+
path_params: { "orgId" => org_id, "recipientId" => recipient_id },
|
|
3315
|
+
request_options: request_options
|
|
3316
|
+
)
|
|
3317
|
+
end
|
|
3318
|
+
|
|
3319
|
+
# List the organization's digest email recipients
|
|
3320
|
+
#
|
|
3321
|
+
# Email is a digest-only transport, so its destinations are an
|
|
3322
|
+
# organization-level address list rather than a per-channel trigger.
|
|
3323
|
+
# Addresses need not belong to Infrawrench users — a finance alias is a
|
|
3324
|
+
# valid recipient.
|
|
3325
|
+
#
|
|
3326
|
+
# GET /api/org/{orgId}/digest/recipients
|
|
3327
|
+
#
|
|
3328
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3329
|
+
# constructed with.
|
|
3330
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3331
|
+
# @return [Hash] Parsed JSON, shaped as `DigestEmailRecipientList` — see
|
|
3332
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3333
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3334
|
+
def get(org_id: nil, request_options: nil)
|
|
3335
|
+
@transport.request(
|
|
3336
|
+
http_method: "GET",
|
|
3337
|
+
path: "/api/org/{orgId}/digest/recipients",
|
|
3338
|
+
path_params: { "orgId" => org_id },
|
|
3339
|
+
request_options: request_options
|
|
3340
|
+
)
|
|
3341
|
+
end
|
|
3342
|
+
end
|
|
3343
|
+
|
|
3344
|
+
# `client.digest`
|
|
3345
|
+
class DigestNamespace
|
|
3346
|
+
# @return [DigestRecipientsNamespace] `client.digest.recipients`
|
|
3347
|
+
attr_reader :recipients
|
|
3348
|
+
|
|
3349
|
+
# @api private
|
|
3350
|
+
# @param transport [Transport]
|
|
3351
|
+
def initialize(transport)
|
|
3352
|
+
@transport = transport
|
|
3353
|
+
@recipients = DigestRecipientsNamespace.new(@transport)
|
|
3354
|
+
end
|
|
3355
|
+
|
|
3356
|
+
# Get the organization's weekly digest settings
|
|
3357
|
+
#
|
|
3358
|
+
# The weekly digest is a summary of the last complete Monday-to-Sunday
|
|
3359
|
+
# week's spend (with week-over-week movers), sync incidents, and resource
|
|
3360
|
+
# churn, delivered to the Slack channels and Teams webhooks opted into the
|
|
3361
|
+
# weeklyDigest trigger and to the organization's digest email recipients.
|
|
3362
|
+
# The response also carries the outcome of the most recent delivery attempt
|
|
3363
|
+
# so a silently failing digest is visible.
|
|
3364
|
+
#
|
|
3365
|
+
# GET /api/org/{orgId}/digest
|
|
3366
|
+
#
|
|
3367
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3368
|
+
# constructed with.
|
|
3369
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3370
|
+
# @return [Hash] Parsed JSON, shaped as `DigestSettings` — see `sig/infrawrench/sdk.rbs`.
|
|
3371
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3372
|
+
def get(org_id: nil, request_options: nil)
|
|
3373
|
+
@transport.request(
|
|
3374
|
+
http_method: "GET",
|
|
3375
|
+
path: "/api/org/{orgId}/digest",
|
|
3376
|
+
path_params: { "orgId" => org_id },
|
|
3377
|
+
request_options: request_options
|
|
3378
|
+
)
|
|
3379
|
+
end
|
|
3380
|
+
|
|
3381
|
+
# Compose and send last week's digest now
|
|
3382
|
+
#
|
|
3383
|
+
# Ignores the schedule and the enabled flag — composes the digest for the
|
|
3384
|
+
# last complete week and sends it to every opted-in channel and email
|
|
3385
|
+
# recipient. This is also the manual recovery for a partial delivery, which
|
|
3386
|
+
# is never retried automatically. Fails when nothing is routed to receive
|
|
3387
|
+
# the digest, or when every destination rejected it.
|
|
3388
|
+
#
|
|
3389
|
+
# POST /api/org/{orgId}/digest/send
|
|
3390
|
+
#
|
|
3391
|
+
# Raises on 400: Bad request
|
|
3392
|
+
#
|
|
3393
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3394
|
+
# constructed with.
|
|
3395
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3396
|
+
# @return [Hash] Parsed JSON, shaped as `DigestSendResult` — see `sig/infrawrench/sdk.rbs`.
|
|
3397
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3398
|
+
def post_org_org_id_digest_send(org_id: nil, request_options: nil)
|
|
3399
|
+
@transport.request(
|
|
3400
|
+
http_method: "POST",
|
|
3401
|
+
path: "/api/org/{orgId}/digest/send",
|
|
3402
|
+
path_params: { "orgId" => org_id },
|
|
3403
|
+
request_options: request_options
|
|
3404
|
+
)
|
|
3405
|
+
end
|
|
3406
|
+
|
|
3407
|
+
# Update the weekly digest settings
|
|
3408
|
+
#
|
|
3409
|
+
# Every field is optional. Enabling schedules the first digest for the next
|
|
3410
|
+
# configured send time rather than sending immediately — use POST
|
|
3411
|
+
# /digest/send for an immediate one. The week boundary follows `timezone`,
|
|
3412
|
+
# so the reported window is always the organization's own local
|
|
3413
|
+
# Monday-to-Sunday week. Changing the schedule clears any parked failure
|
|
3414
|
+
# state but never replays a week that already went out.
|
|
3415
|
+
#
|
|
3416
|
+
# PUT /api/org/{orgId}/digest
|
|
3417
|
+
#
|
|
3418
|
+
# Raises on 400: Bad request
|
|
3419
|
+
#
|
|
3420
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3421
|
+
# constructed with.
|
|
3422
|
+
# @param body [Hash, nil] Request body, shaped as `DigestSettingsUpdate`.
|
|
3423
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3424
|
+
# @return [Hash] Parsed JSON, shaped as `DigestSettings` — see `sig/infrawrench/sdk.rbs`.
|
|
3425
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3426
|
+
def update(org_id: nil, body: nil, request_options: nil)
|
|
3427
|
+
@transport.request(
|
|
3428
|
+
http_method: "PUT",
|
|
3429
|
+
path: "/api/org/{orgId}/digest",
|
|
3430
|
+
path_params: { "orgId" => org_id },
|
|
3431
|
+
body: body,
|
|
3432
|
+
request_options: request_options
|
|
3433
|
+
)
|
|
3434
|
+
end
|
|
3435
|
+
end
|
|
3436
|
+
|
|
3437
|
+
# `client.docker`
|
|
3438
|
+
class DockerNamespace
|
|
3439
|
+
# @api private
|
|
3440
|
+
# @param transport [Transport]
|
|
3441
|
+
def initialize(transport)
|
|
3442
|
+
@transport = transport
|
|
3443
|
+
end
|
|
3444
|
+
|
|
3445
|
+
# Run a Docker daemon operation
|
|
3446
|
+
#
|
|
3447
|
+
# _Requires permission: `resources:execute`._
|
|
3448
|
+
#
|
|
3449
|
+
# POST /api/org/{orgId}/docker/command
|
|
3450
|
+
#
|
|
3451
|
+
# Raises on 400: Bad request
|
|
3452
|
+
#
|
|
3453
|
+
# Raises on 404: Not found
|
|
3454
|
+
#
|
|
3455
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3456
|
+
# constructed with.
|
|
3457
|
+
# @param body [Hash] Request body, shaped as `DockerCommandRequest`.
|
|
3458
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3459
|
+
# @return [Hash] Parsed JSON, shaped as `DockerCommandResponse` — see
|
|
3460
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3461
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3462
|
+
def command(body:, org_id: nil, request_options: nil)
|
|
3463
|
+
@transport.request(
|
|
3464
|
+
http_method: "POST",
|
|
3465
|
+
path: "/api/org/{orgId}/docker/command",
|
|
3466
|
+
path_params: { "orgId" => org_id },
|
|
3467
|
+
body: body,
|
|
3468
|
+
request_options: request_options
|
|
3469
|
+
)
|
|
3470
|
+
end
|
|
3471
|
+
end
|
|
3472
|
+
|
|
3473
|
+
# `client.expiring.settings`
|
|
3474
|
+
class ExpiringSettingsNamespace
|
|
3475
|
+
# @api private
|
|
3476
|
+
# @param transport [Transport]
|
|
3477
|
+
def initialize(transport)
|
|
3478
|
+
@transport = transport
|
|
3479
|
+
end
|
|
3480
|
+
|
|
3481
|
+
# Get the organization's expiry alert settings
|
|
3482
|
+
#
|
|
3483
|
+
# The lead time feeds both the feed's `upcoming` bucket and the poller's
|
|
3484
|
+
# daily alert scan. An organization that never saved reads the shipped
|
|
3485
|
+
# defaults (enabled, 60 days).
|
|
3486
|
+
#
|
|
3487
|
+
# _Requires permission: `org:settings:write`._
|
|
3488
|
+
#
|
|
3489
|
+
# GET /api/org/{orgId}/expiring/settings
|
|
3490
|
+
#
|
|
3491
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3492
|
+
# constructed with.
|
|
3493
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3494
|
+
# @return [Hash] Parsed JSON, shaped as `ExpiryAlertSettings` — see
|
|
3495
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3496
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3497
|
+
def get(org_id: nil, request_options: nil)
|
|
3498
|
+
@transport.request(
|
|
3499
|
+
http_method: "GET",
|
|
3500
|
+
path: "/api/org/{orgId}/expiring/settings",
|
|
3501
|
+
path_params: { "orgId" => org_id },
|
|
3502
|
+
request_options: request_options
|
|
3503
|
+
)
|
|
3504
|
+
end
|
|
3505
|
+
|
|
3506
|
+
# Update the expiry alert settings
|
|
3507
|
+
#
|
|
3508
|
+
# Every field is optional so a single toggle can be saved on its own.
|
|
3509
|
+
# `leadDays` must be a whole number from 1 to 365. Saving never resets the
|
|
3510
|
+
# alert cooldown.
|
|
3511
|
+
#
|
|
3512
|
+
# _Requires permission: `org:settings:write`._
|
|
3513
|
+
#
|
|
3514
|
+
# PUT /api/org/{orgId}/expiring/settings
|
|
3515
|
+
#
|
|
3516
|
+
# Raises on 400: Bad request
|
|
3517
|
+
#
|
|
3518
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3519
|
+
# constructed with.
|
|
3520
|
+
# @param body [Hash, nil] Request body, shaped as `ExpiryAlertSettingsUpdate`.
|
|
3521
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3522
|
+
# @return [Hash] Parsed JSON, shaped as `ExpiryAlertSettings` — see
|
|
3523
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3524
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3525
|
+
def update(org_id: nil, body: nil, request_options: nil)
|
|
3526
|
+
@transport.request(
|
|
3527
|
+
http_method: "PUT",
|
|
3528
|
+
path: "/api/org/{orgId}/expiring/settings",
|
|
3529
|
+
path_params: { "orgId" => org_id },
|
|
3530
|
+
body: body,
|
|
3531
|
+
request_options: request_options
|
|
3532
|
+
)
|
|
3533
|
+
end
|
|
3534
|
+
end
|
|
3535
|
+
|
|
3536
|
+
# `client.expiring`
|
|
3537
|
+
class ExpiringNamespace
|
|
3538
|
+
# @return [ExpiringSettingsNamespace] `client.expiring.settings`
|
|
3539
|
+
attr_reader :settings
|
|
3540
|
+
|
|
3541
|
+
# @api private
|
|
3542
|
+
# @param transport [Transport]
|
|
3543
|
+
def initialize(transport)
|
|
3544
|
+
@transport = transport
|
|
3545
|
+
@settings = ExpiringSettingsNamespace.new(@transport)
|
|
3546
|
+
end
|
|
3547
|
+
|
|
3548
|
+
# List approaching deadlines on synced resources
|
|
3549
|
+
#
|
|
3550
|
+
# One cross-provider countdown of everything with a clock on it: TLS
|
|
3551
|
+
# certificate expiries, domain registrations, API token expirations, access
|
|
3552
|
+
# keys past their rotation budget, Kubernetes/SSH credential ages. Plugins
|
|
3553
|
+
# declare which synced fields carry deadlines; the feed is computed over
|
|
3554
|
+
# already-stored state, so no provider API calls are made and results
|
|
3555
|
+
# reflect the last sync. Items are sorted soonest first and bucketed by
|
|
3556
|
+
# severity against the organization's lead time.
|
|
3557
|
+
#
|
|
3558
|
+
# _Requires permission: `resources:read`._
|
|
3559
|
+
#
|
|
3560
|
+
# GET /api/org/{orgId}/expiring
|
|
3561
|
+
#
|
|
3562
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3563
|
+
# constructed with.
|
|
3564
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3565
|
+
# @return [Hash] Parsed JSON, shaped as `ExpiryListResponse` — see
|
|
3566
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3567
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3568
|
+
def get(org_id: nil, request_options: nil)
|
|
3569
|
+
@transport.request(
|
|
3570
|
+
http_method: "GET",
|
|
3571
|
+
path: "/api/org/{orgId}/expiring",
|
|
3572
|
+
path_params: { "orgId" => org_id },
|
|
3573
|
+
request_options: request_options
|
|
3574
|
+
)
|
|
3575
|
+
end
|
|
3576
|
+
end
|
|
3577
|
+
|
|
3578
|
+
# `client.invitations.by_token`
|
|
3579
|
+
class InvitationsByTokenNamespace
|
|
3580
|
+
# @api private
|
|
3581
|
+
# @param transport [Transport]
|
|
3582
|
+
def initialize(transport)
|
|
3583
|
+
@transport = transport
|
|
3584
|
+
end
|
|
3585
|
+
|
|
3586
|
+
# Get invitation details by token
|
|
3587
|
+
#
|
|
3588
|
+
# GET /api/invitations/by-token/{token}
|
|
3589
|
+
#
|
|
3590
|
+
# Raises on 404: Not found
|
|
3591
|
+
#
|
|
3592
|
+
# @param token [String]
|
|
3593
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3594
|
+
# @return [Hash] Parsed JSON, shaped as `InvitationDetail` — see `sig/infrawrench/sdk.rbs`.
|
|
3595
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3596
|
+
def get(token:, request_options: nil)
|
|
3597
|
+
@transport.request(
|
|
3598
|
+
http_method: "GET",
|
|
3599
|
+
path: "/api/invitations/by-token/{token}",
|
|
3600
|
+
path_params: { "token" => token },
|
|
3601
|
+
request_options: request_options
|
|
3602
|
+
)
|
|
3603
|
+
end
|
|
3604
|
+
end
|
|
3605
|
+
|
|
3606
|
+
# `client.invitations`
|
|
3607
|
+
class InvitationsNamespace
|
|
3608
|
+
# @return [InvitationsByTokenNamespace] `client.invitations.by_token`
|
|
3609
|
+
attr_reader :by_token
|
|
3610
|
+
|
|
3611
|
+
# @api private
|
|
3612
|
+
# @param transport [Transport]
|
|
3613
|
+
def initialize(transport)
|
|
3614
|
+
@transport = transport
|
|
3615
|
+
@by_token = InvitationsByTokenNamespace.new(@transport)
|
|
3616
|
+
end
|
|
3617
|
+
|
|
3618
|
+
# Accept an invitation
|
|
3619
|
+
#
|
|
3620
|
+
# POST /api/invitations/accept
|
|
3621
|
+
#
|
|
3622
|
+
# Raises on 400: Bad request
|
|
3623
|
+
#
|
|
3624
|
+
# Raises on 403: Forbidden
|
|
3625
|
+
#
|
|
3626
|
+
# @param body [Hash] Request body, shaped as `AcceptInvitationRequest`.
|
|
3627
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3628
|
+
# @return [Hash] Parsed JSON, shaped as `AcceptInvitationResponse` — see
|
|
3629
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3630
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3631
|
+
def accept(body:, request_options: nil)
|
|
3632
|
+
@transport.request(
|
|
3633
|
+
http_method: "POST",
|
|
3634
|
+
path: "/api/invitations/accept",
|
|
3635
|
+
body: body,
|
|
3636
|
+
request_options: request_options
|
|
3637
|
+
)
|
|
3638
|
+
end
|
|
3639
|
+
end
|
|
3640
|
+
|
|
3641
|
+
# `client.kv`
|
|
3642
|
+
class KvNamespace
|
|
3643
|
+
# @api private
|
|
3644
|
+
# @param transport [Transport]
|
|
3645
|
+
def initialize(transport)
|
|
3646
|
+
@transport = transport
|
|
3647
|
+
end
|
|
3648
|
+
|
|
3649
|
+
# Run a Redis-style KV command
|
|
3650
|
+
#
|
|
3651
|
+
# _Requires permission: `resources:execute`._
|
|
3652
|
+
#
|
|
3653
|
+
# POST /api/org/{orgId}/kv/command
|
|
3654
|
+
#
|
|
3655
|
+
# Raises on 400: Bad request
|
|
3656
|
+
#
|
|
3657
|
+
# Raises on 404: Not found
|
|
3658
|
+
#
|
|
3659
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3660
|
+
# constructed with.
|
|
3661
|
+
# @param body [Hash] Request body, shaped as `KvCommandRequest`.
|
|
3662
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3663
|
+
# @return [Hash] Parsed JSON, shaped as `KvCommandResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
2598
3664
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2599
|
-
def
|
|
3665
|
+
def command(body:, org_id: nil, request_options: nil)
|
|
2600
3666
|
@transport.request(
|
|
2601
3667
|
http_method: "POST",
|
|
2602
|
-
path: "/api/org/{orgId}/
|
|
2603
|
-
path_params: { "orgId" => org_id
|
|
3668
|
+
path: "/api/org/{orgId}/kv/command",
|
|
3669
|
+
path_params: { "orgId" => org_id },
|
|
2604
3670
|
body: body,
|
|
2605
3671
|
request_options: request_options
|
|
2606
3672
|
)
|
|
2607
3673
|
end
|
|
2608
3674
|
end
|
|
2609
3675
|
|
|
2610
|
-
# `client.
|
|
2611
|
-
class
|
|
3676
|
+
# `client.log_workspaces`
|
|
3677
|
+
class LogWorkspacesNamespace
|
|
2612
3678
|
# @api private
|
|
2613
3679
|
# @param transport [Transport]
|
|
2614
3680
|
def initialize(transport)
|
|
2615
3681
|
@transport = transport
|
|
2616
3682
|
end
|
|
2617
3683
|
|
|
2618
|
-
#
|
|
3684
|
+
# Save a log workspace query
|
|
2619
3685
|
#
|
|
2620
|
-
#
|
|
2621
|
-
#
|
|
2622
|
-
#
|
|
2623
|
-
#
|
|
3686
|
+
# Save a named multi-resource tail: up to 8 log streams plus a search
|
|
3687
|
+
# expression, so the workspace can be reopened. With `alertEnabled` the
|
|
3688
|
+
# poller evaluates the query every few minutes over a bounded tail window
|
|
3689
|
+
# and notifies (push/Slack/Teams, `logMatchAlerts` trigger) when a line
|
|
3690
|
+
# matches, with a cooldown between alerts. Alerting requires a non-empty
|
|
3691
|
+
# search expression. Audit-logged.
|
|
2624
3692
|
#
|
|
2625
|
-
# _Requires permission: `
|
|
3693
|
+
# _Requires permission: `resources:write`._
|
|
2626
3694
|
#
|
|
2627
|
-
# POST /api/org/{orgId}/
|
|
3695
|
+
# POST /api/org/{orgId}/log-workspaces
|
|
2628
3696
|
#
|
|
2629
3697
|
# Raises on 400: Bad request
|
|
2630
3698
|
#
|
|
2631
|
-
# Raises on 401: Unauthenticated
|
|
2632
|
-
#
|
|
2633
|
-
# Raises on 403: Forbidden
|
|
2634
|
-
#
|
|
2635
3699
|
# Raises on 404: Not found
|
|
2636
3700
|
#
|
|
3701
|
+
# Raises on 409: A saved query with this name already exists
|
|
3702
|
+
#
|
|
2637
3703
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2638
3704
|
# constructed with.
|
|
2639
|
-
# @param body [Hash
|
|
3705
|
+
# @param body [Hash] Request body, shaped as `LogWorkspaceQueryCreate`.
|
|
2640
3706
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2641
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
3707
|
+
# @return [Hash] Parsed JSON, shaped as `LogWorkspaceQuery` — see `sig/infrawrench/sdk.rbs`.
|
|
2642
3708
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2643
|
-
def create(org_id: nil,
|
|
3709
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
2644
3710
|
@transport.request(
|
|
2645
3711
|
http_method: "POST",
|
|
2646
|
-
path: "/api/org/{orgId}/
|
|
3712
|
+
path: "/api/org/{orgId}/log-workspaces",
|
|
2647
3713
|
path_params: { "orgId" => org_id },
|
|
2648
3714
|
body: body,
|
|
2649
3715
|
request_options: request_options
|
|
2650
3716
|
)
|
|
2651
3717
|
end
|
|
2652
3718
|
|
|
2653
|
-
# Delete a
|
|
3719
|
+
# Delete a saved log query
|
|
2654
3720
|
#
|
|
2655
|
-
#
|
|
3721
|
+
# Remove the saved query and stop any alerting it carried. Audit-logged.
|
|
2656
3722
|
#
|
|
2657
|
-
#
|
|
3723
|
+
# _Requires permission: `resources:write`._
|
|
2658
3724
|
#
|
|
2659
|
-
#
|
|
3725
|
+
# DELETE /api/org/{orgId}/log-workspaces/{queryId}
|
|
2660
3726
|
#
|
|
2661
|
-
# Raises on
|
|
3727
|
+
# Raises on 404: Not found
|
|
2662
3728
|
#
|
|
2663
3729
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2664
3730
|
# constructed with.
|
|
2665
|
-
# @param
|
|
3731
|
+
# @param query_id [String]
|
|
2666
3732
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2667
|
-
# @return [
|
|
3733
|
+
# @return [nil] This endpoint returns no content.
|
|
2668
3734
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2669
|
-
def delete(
|
|
3735
|
+
def delete(query_id:, org_id: nil, request_options: nil)
|
|
2670
3736
|
@transport.request(
|
|
2671
3737
|
http_method: "DELETE",
|
|
2672
|
-
path: "/api/org/{orgId}/
|
|
2673
|
-
path_params: { "orgId" => org_id, "
|
|
3738
|
+
path: "/api/org/{orgId}/log-workspaces/{queryId}",
|
|
3739
|
+
path_params: { "orgId" => org_id, "queryId" => query_id },
|
|
3740
|
+
accept: :empty,
|
|
2674
3741
|
request_options: request_options
|
|
2675
3742
|
)
|
|
2676
3743
|
end
|
|
2677
3744
|
|
|
2678
|
-
# List
|
|
2679
|
-
#
|
|
2680
|
-
# _Requires permission: `deployments:read`._
|
|
3745
|
+
# List saved log queries
|
|
2681
3746
|
#
|
|
2682
|
-
#
|
|
3747
|
+
# Every saved log-workspace query in the organization: its name, the set of
|
|
3748
|
+
# log streams it tails, the search expression, the alert flag and the alert
|
|
3749
|
+
# pass's last evaluation state. Log text itself is fetched per resource via
|
|
3750
|
+
# `POST /api/org/{orgId}/resources/{pluginId}/{typeId}/logs`.
|
|
2683
3751
|
#
|
|
2684
|
-
#
|
|
3752
|
+
# _Requires permission: `resources:read`._
|
|
2685
3753
|
#
|
|
2686
|
-
#
|
|
3754
|
+
# GET /api/org/{orgId}/log-workspaces
|
|
2687
3755
|
#
|
|
2688
3756
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2689
3757
|
# constructed with.
|
|
2690
3758
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2691
|
-
# @return [
|
|
3759
|
+
# @return [Hash] Parsed JSON, shaped as `LogWorkspaceQueryList` — see
|
|
2692
3760
|
# `sig/infrawrench/sdk.rbs`.
|
|
2693
3761
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2694
|
-
def
|
|
3762
|
+
def get(org_id: nil, request_options: nil)
|
|
2695
3763
|
@transport.request(
|
|
2696
3764
|
http_method: "GET",
|
|
2697
|
-
path: "/api/org/{orgId}/
|
|
3765
|
+
path: "/api/org/{orgId}/log-workspaces",
|
|
2698
3766
|
path_params: { "orgId" => org_id },
|
|
2699
3767
|
request_options: request_options
|
|
2700
3768
|
)
|
|
2701
3769
|
end
|
|
2702
3770
|
|
|
2703
|
-
#
|
|
2704
|
-
#
|
|
2705
|
-
# _Requires permission: `deployments:write`._
|
|
2706
|
-
#
|
|
2707
|
-
# PATCH /api/org/{orgId}/deployments/triggers/{id}
|
|
2708
|
-
#
|
|
2709
|
-
# Raises on 401: Unauthenticated
|
|
2710
|
-
#
|
|
2711
|
-
# Raises on 403: Forbidden
|
|
2712
|
-
#
|
|
2713
|
-
# Raises on 404: Not found
|
|
2714
|
-
#
|
|
2715
|
-
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2716
|
-
# constructed with.
|
|
2717
|
-
# @param id [String]
|
|
2718
|
-
# @param body [Hash, nil] Request body, shaped as `Hash`.
|
|
2719
|
-
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2720
|
-
# @return [Hash] Parsed JSON, shaped as `DeployTrigger` — see `sig/infrawrench/sdk.rbs`.
|
|
2721
|
-
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2722
|
-
def update(id:, org_id: nil, body: nil, request_options: nil)
|
|
2723
|
-
@transport.request(
|
|
2724
|
-
http_method: "PATCH",
|
|
2725
|
-
path: "/api/org/{orgId}/deployments/triggers/{id}",
|
|
2726
|
-
path_params: { "orgId" => org_id, "id" => id },
|
|
2727
|
-
body: body,
|
|
2728
|
-
request_options: request_options
|
|
2729
|
-
)
|
|
2730
|
-
end
|
|
2731
|
-
end
|
|
2732
|
-
|
|
2733
|
-
# `client.deployments`
|
|
2734
|
-
class DeploymentsNamespace
|
|
2735
|
-
# @return [DeploymentsRunsNamespace] `client.deployments.runs`
|
|
2736
|
-
attr_reader :runs
|
|
2737
|
-
# @return [DeploymentsTriggersNamespace] `client.deployments.triggers`
|
|
2738
|
-
attr_reader :triggers
|
|
2739
|
-
|
|
2740
|
-
# @api private
|
|
2741
|
-
# @param transport [Transport]
|
|
2742
|
-
def initialize(transport)
|
|
2743
|
-
@transport = transport
|
|
2744
|
-
@runs = DeploymentsRunsNamespace.new(@transport)
|
|
2745
|
-
@triggers = DeploymentsTriggersNamespace.new(@transport)
|
|
2746
|
-
end
|
|
2747
|
-
|
|
2748
|
-
# List the environments a repository's Infrafile declares
|
|
2749
|
-
#
|
|
2750
|
-
# Reads `Infrafile` at the branch head and returns its declared
|
|
2751
|
-
# environments. The file is parsed, not executed.
|
|
2752
|
-
#
|
|
2753
|
-
# _Requires permission: `deployments:read`._
|
|
2754
|
-
#
|
|
2755
|
-
# POST /api/org/{orgId}/deployments/envs
|
|
3771
|
+
# List log-capable resources
|
|
2756
3772
|
#
|
|
2757
|
-
#
|
|
2758
|
-
#
|
|
2759
|
-
#
|
|
3773
|
+
# Synced resources whose rendered detail declares the logs capability — the
|
|
3774
|
+
# candidates a log workspace can tail. Discovered from the plugin contract
|
|
3775
|
+
# (never a hardcoded provider list), capped at 500 results.
|
|
2760
3776
|
#
|
|
2761
|
-
#
|
|
3777
|
+
# _Requires permission: `resources:read`._
|
|
2762
3778
|
#
|
|
2763
|
-
#
|
|
3779
|
+
# GET /api/org/{orgId}/log-workspaces/resources
|
|
2764
3780
|
#
|
|
2765
3781
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2766
3782
|
# constructed with.
|
|
2767
|
-
# @param body [Hash, nil] Request body, shaped as `DeployEnvsInput`.
|
|
2768
3783
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2769
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
3784
|
+
# @return [Hash] Parsed JSON, shaped as `LogCapableResourceList` — see
|
|
3785
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2770
3786
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2771
|
-
def
|
|
3787
|
+
def resources(org_id: nil, request_options: nil)
|
|
2772
3788
|
@transport.request(
|
|
2773
|
-
http_method: "
|
|
2774
|
-
path: "/api/org/{orgId}/
|
|
3789
|
+
http_method: "GET",
|
|
3790
|
+
path: "/api/org/{orgId}/log-workspaces/resources",
|
|
2775
3791
|
path_params: { "orgId" => org_id },
|
|
2776
|
-
body: body,
|
|
2777
3792
|
request_options: request_options
|
|
2778
3793
|
)
|
|
2779
3794
|
end
|
|
2780
3795
|
|
|
2781
|
-
#
|
|
3796
|
+
# Update a saved log query
|
|
2782
3797
|
#
|
|
2783
|
-
#
|
|
2784
|
-
#
|
|
3798
|
+
# Edit the name, resource set, search expression and/or the alert toggle.
|
|
3799
|
+
# Changing the search or the resources resets the alert pass's evaluation
|
|
3800
|
+
# state; turning the alert on makes the query due for evaluation
|
|
3801
|
+
# immediately. Audit-logged.
|
|
2785
3802
|
#
|
|
2786
|
-
# _Requires permission: `
|
|
3803
|
+
# _Requires permission: `resources:write`._
|
|
2787
3804
|
#
|
|
2788
|
-
#
|
|
3805
|
+
# PUT /api/org/{orgId}/log-workspaces/{queryId}
|
|
2789
3806
|
#
|
|
2790
3807
|
# Raises on 400: Bad request
|
|
2791
3808
|
#
|
|
2792
|
-
# Raises on 401: Unauthenticated
|
|
2793
|
-
#
|
|
2794
|
-
# Raises on 403: Forbidden
|
|
2795
|
-
#
|
|
2796
3809
|
# Raises on 404: Not found
|
|
2797
3810
|
#
|
|
2798
|
-
#
|
|
2799
|
-
# constructed with.
|
|
2800
|
-
# @param body [Hash, nil] Request body, shaped as `DeployPlanInput`.
|
|
2801
|
-
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2802
|
-
# @return [Hash] Parsed JSON, shaped as `DeployPlanResult` — see `sig/infrawrench/sdk.rbs`.
|
|
2803
|
-
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2804
|
-
def plan(org_id: nil, body: nil, request_options: nil)
|
|
2805
|
-
@transport.request(
|
|
2806
|
-
http_method: "POST",
|
|
2807
|
-
path: "/api/org/{orgId}/deployments/plan",
|
|
2808
|
-
path_params: { "orgId" => org_id },
|
|
2809
|
-
body: body,
|
|
2810
|
-
request_options: request_options
|
|
2811
|
-
)
|
|
2812
|
-
end
|
|
2813
|
-
|
|
2814
|
-
# List repositories this organization can deploy from
|
|
2815
|
-
#
|
|
2816
|
-
# Repositories visible to the organization's GitHub App installations. Empty
|
|
2817
|
-
# when the app is not configured.
|
|
2818
|
-
#
|
|
2819
|
-
# _Requires permission: `deployments:read`._
|
|
2820
|
-
#
|
|
2821
|
-
# GET /api/org/{orgId}/deployments/repos
|
|
2822
|
-
#
|
|
2823
|
-
# Raises on 401: Unauthenticated
|
|
2824
|
-
#
|
|
2825
|
-
# Raises on 403: Forbidden
|
|
3811
|
+
# Raises on 409: A saved query with this name already exists
|
|
2826
3812
|
#
|
|
2827
3813
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2828
3814
|
# constructed with.
|
|
3815
|
+
# @param query_id [String]
|
|
3816
|
+
# @param body [Hash] Request body, shaped as `LogWorkspaceQueryUpdate`.
|
|
2829
3817
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2830
|
-
# @return [
|
|
2831
|
-
# `sig/infrawrench/sdk.rbs`.
|
|
3818
|
+
# @return [Hash] Parsed JSON, shaped as `LogWorkspaceQuery` — see `sig/infrawrench/sdk.rbs`.
|
|
2832
3819
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2833
|
-
def
|
|
3820
|
+
def update(query_id:, body:, org_id: nil, request_options: nil)
|
|
2834
3821
|
@transport.request(
|
|
2835
|
-
http_method: "
|
|
2836
|
-
path: "/api/org/{orgId}/
|
|
2837
|
-
path_params: { "orgId" => org_id },
|
|
3822
|
+
http_method: "PUT",
|
|
3823
|
+
path: "/api/org/{orgId}/log-workspaces/{queryId}",
|
|
3824
|
+
path_params: { "orgId" => org_id, "queryId" => query_id },
|
|
3825
|
+
body: body,
|
|
2838
3826
|
request_options: request_options
|
|
2839
3827
|
)
|
|
2840
3828
|
end
|
|
2841
3829
|
end
|
|
2842
3830
|
|
|
2843
|
-
# `client.
|
|
2844
|
-
class
|
|
3831
|
+
# `client.metric_alerts`
|
|
3832
|
+
class MetricAlertsNamespace
|
|
2845
3833
|
# @api private
|
|
2846
3834
|
# @param transport [Transport]
|
|
2847
3835
|
def initialize(transport)
|
|
2848
3836
|
@transport = transport
|
|
2849
3837
|
end
|
|
2850
3838
|
|
|
2851
|
-
#
|
|
3839
|
+
# Create a metric alert rule
|
|
2852
3840
|
#
|
|
2853
|
-
#
|
|
2854
|
-
#
|
|
3841
|
+
# Rules select resources by query (plugin + resource type + tag), never by
|
|
3842
|
+
# id list, so a rule automatically covers resources created after it was
|
|
3843
|
+
# written. The poller evaluates enabled rules about once a minute and alerts
|
|
3844
|
+
# when the condition held for the whole trailing window.
|
|
2855
3845
|
#
|
|
2856
|
-
# POST /api/org/{orgId}/
|
|
3846
|
+
# POST /api/org/{orgId}/metric-alerts
|
|
2857
3847
|
#
|
|
2858
3848
|
# Raises on 400: Bad request
|
|
2859
3849
|
#
|
|
2860
3850
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2861
3851
|
# constructed with.
|
|
2862
|
-
# @param body [Hash
|
|
3852
|
+
# @param body [Hash] Request body, shaped as `MetricAlertRuleInput`.
|
|
2863
3853
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2864
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
2865
|
-
# `sig/infrawrench/sdk.rbs`.
|
|
3854
|
+
# @return [Hash] Parsed JSON, shaped as `MetricAlertRule` — see `sig/infrawrench/sdk.rbs`.
|
|
2866
3855
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2867
|
-
def create(org_id: nil,
|
|
3856
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
2868
3857
|
@transport.request(
|
|
2869
3858
|
http_method: "POST",
|
|
2870
|
-
path: "/api/org/{orgId}/
|
|
3859
|
+
path: "/api/org/{orgId}/metric-alerts",
|
|
2871
3860
|
path_params: { "orgId" => org_id },
|
|
2872
3861
|
body: body,
|
|
2873
3862
|
request_options: request_options
|
|
2874
3863
|
)
|
|
2875
3864
|
end
|
|
2876
3865
|
|
|
2877
|
-
#
|
|
3866
|
+
# Delete a metric alert rule
|
|
2878
3867
|
#
|
|
2879
|
-
#
|
|
3868
|
+
# Soft delete. The rule's firing history stays readable via
|
|
3869
|
+
# /metric-alerts/events.
|
|
3870
|
+
#
|
|
3871
|
+
# DELETE /api/org/{orgId}/metric-alerts/{id}
|
|
2880
3872
|
#
|
|
2881
3873
|
# Raises on 404: Not found
|
|
2882
3874
|
#
|
|
2883
3875
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2884
3876
|
# constructed with.
|
|
2885
|
-
# @param
|
|
3877
|
+
# @param id [String]
|
|
2886
3878
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2887
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
3879
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
2888
3880
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2889
|
-
def delete(
|
|
3881
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
2890
3882
|
@transport.request(
|
|
2891
3883
|
http_method: "DELETE",
|
|
2892
|
-
path: "/api/org/{orgId}/
|
|
2893
|
-
path_params: { "orgId" => org_id, "
|
|
3884
|
+
path: "/api/org/{orgId}/metric-alerts/{id}",
|
|
3885
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
2894
3886
|
request_options: request_options
|
|
2895
3887
|
)
|
|
2896
3888
|
end
|
|
2897
3889
|
|
|
2898
|
-
#
|
|
2899
|
-
#
|
|
2900
|
-
# Email is a digest-only transport, so its destinations are an
|
|
2901
|
-
# organization-level address list rather than a per-channel trigger.
|
|
2902
|
-
# Addresses need not belong to Infrawrench users — a finance alias is a
|
|
2903
|
-
# valid recipient.
|
|
3890
|
+
# Recent metric alert firings
|
|
2904
3891
|
#
|
|
2905
|
-
# GET /api/org/{orgId}/
|
|
3892
|
+
# GET /api/org/{orgId}/metric-alerts/events
|
|
2906
3893
|
#
|
|
2907
3894
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2908
3895
|
# constructed with.
|
|
3896
|
+
# @param rule_id [String, nil]
|
|
3897
|
+
# @param limit [Integer, nil]
|
|
2909
3898
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2910
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
3899
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<MetricAlertEvent>` — see
|
|
2911
3900
|
# `sig/infrawrench/sdk.rbs`.
|
|
2912
3901
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2913
|
-
def
|
|
3902
|
+
def events(org_id: nil, rule_id: nil, limit: nil, request_options: nil)
|
|
2914
3903
|
@transport.request(
|
|
2915
3904
|
http_method: "GET",
|
|
2916
|
-
path: "/api/org/{orgId}/
|
|
3905
|
+
path: "/api/org/{orgId}/metric-alerts/events",
|
|
2917
3906
|
path_params: { "orgId" => org_id },
|
|
3907
|
+
query: { "ruleId" => rule_id, "limit" => limit },
|
|
2918
3908
|
request_options: request_options
|
|
2919
3909
|
)
|
|
2920
3910
|
end
|
|
2921
|
-
end
|
|
2922
|
-
|
|
2923
|
-
# `client.digest`
|
|
2924
|
-
class DigestNamespace
|
|
2925
|
-
# @return [DigestRecipientsNamespace] `client.digest.recipients`
|
|
2926
|
-
attr_reader :recipients
|
|
2927
|
-
|
|
2928
|
-
# @api private
|
|
2929
|
-
# @param transport [Transport]
|
|
2930
|
-
def initialize(transport)
|
|
2931
|
-
@transport = transport
|
|
2932
|
-
@recipients = DigestRecipientsNamespace.new(@transport)
|
|
2933
|
-
end
|
|
2934
3911
|
|
|
2935
|
-
# Get
|
|
3912
|
+
# Get a metric alert rule
|
|
2936
3913
|
#
|
|
2937
|
-
#
|
|
2938
|
-
# week's spend (with week-over-week movers), sync incidents, and resource
|
|
2939
|
-
# churn, delivered to the Slack channels and Teams webhooks opted into the
|
|
2940
|
-
# weeklyDigest trigger and to the organization's digest email recipients.
|
|
2941
|
-
# The response also carries the outcome of the most recent delivery attempt
|
|
2942
|
-
# so a silently failing digest is visible.
|
|
3914
|
+
# GET /api/org/{orgId}/metric-alerts/{id}
|
|
2943
3915
|
#
|
|
2944
|
-
#
|
|
3916
|
+
# Raises on 404: Not found
|
|
2945
3917
|
#
|
|
2946
3918
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2947
3919
|
# constructed with.
|
|
3920
|
+
# @param id [String]
|
|
2948
3921
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2949
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
3922
|
+
# @return [Hash] Parsed JSON, shaped as `MetricAlertRule` — see `sig/infrawrench/sdk.rbs`.
|
|
2950
3923
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2951
|
-
def get(org_id: nil, request_options: nil)
|
|
3924
|
+
def get(id:, org_id: nil, request_options: nil)
|
|
2952
3925
|
@transport.request(
|
|
2953
3926
|
http_method: "GET",
|
|
2954
|
-
path: "/api/org/{orgId}/
|
|
2955
|
-
path_params: { "orgId" => org_id },
|
|
3927
|
+
path: "/api/org/{orgId}/metric-alerts/{id}",
|
|
3928
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
2956
3929
|
request_options: request_options
|
|
2957
3930
|
)
|
|
2958
3931
|
end
|
|
2959
3932
|
|
|
2960
|
-
#
|
|
2961
|
-
#
|
|
2962
|
-
# Ignores the schedule and the enabled flag — composes the digest for the
|
|
2963
|
-
# last complete week and sends it to every opted-in channel and email
|
|
2964
|
-
# recipient. This is also the manual recovery for a partial delivery, which
|
|
2965
|
-
# is never retried automatically. Fails when nothing is routed to receive
|
|
2966
|
-
# the digest, or when every destination rejected it.
|
|
2967
|
-
#
|
|
2968
|
-
# POST /api/org/{orgId}/digest/send
|
|
3933
|
+
# List metric alert rules with live firing status
|
|
2969
3934
|
#
|
|
2970
|
-
#
|
|
3935
|
+
# GET /api/org/{orgId}/metric-alerts
|
|
2971
3936
|
#
|
|
2972
3937
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
2973
3938
|
# constructed with.
|
|
2974
3939
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
2975
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
3940
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<MetricAlertRuleWithStatus>` — see
|
|
3941
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
2976
3942
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
2977
|
-
def
|
|
3943
|
+
def list(org_id: nil, request_options: nil)
|
|
2978
3944
|
@transport.request(
|
|
2979
|
-
http_method: "
|
|
2980
|
-
path: "/api/org/{orgId}/
|
|
3945
|
+
http_method: "GET",
|
|
3946
|
+
path: "/api/org/{orgId}/metric-alerts",
|
|
2981
3947
|
path_params: { "orgId" => org_id },
|
|
2982
3948
|
request_options: request_options
|
|
2983
|
-
)
|
|
2984
|
-
end
|
|
2985
|
-
|
|
2986
|
-
#
|
|
2987
|
-
#
|
|
2988
|
-
# Every field is optional. Enabling schedules the first digest for the next
|
|
2989
|
-
# configured send time rather than sending immediately — use POST
|
|
2990
|
-
# /digest/send for an immediate one. The week boundary follows `timezone`,
|
|
2991
|
-
# so the reported window is always the organization's own local
|
|
2992
|
-
# Monday-to-Sunday week. Changing the schedule clears any parked failure
|
|
2993
|
-
# state but never replays a week that already went out.
|
|
3949
|
+
)
|
|
3950
|
+
end
|
|
3951
|
+
|
|
3952
|
+
# List metric series that actually exist
|
|
2994
3953
|
#
|
|
2995
|
-
#
|
|
3954
|
+
# The series labels resources reported in the last 7 days, optionally
|
|
3955
|
+
# narrowed to one plugin and resource type — what the rule builder's metric
|
|
3956
|
+
# picker is fed from.
|
|
2996
3957
|
#
|
|
2997
|
-
#
|
|
3958
|
+
# GET /api/org/{orgId}/metric-alerts/metric-keys
|
|
2998
3959
|
#
|
|
2999
3960
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3000
3961
|
# constructed with.
|
|
3001
|
-
# @param
|
|
3962
|
+
# @param plugin_id [String, nil]
|
|
3963
|
+
# @param resource_type_id [String, nil]
|
|
3002
3964
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3003
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
3965
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<MetricSeriesKey>` — see
|
|
3966
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3004
3967
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3005
|
-
def
|
|
3968
|
+
def metric_keys(org_id: nil, plugin_id: nil, resource_type_id: nil, request_options: nil)
|
|
3006
3969
|
@transport.request(
|
|
3007
|
-
http_method: "
|
|
3008
|
-
path: "/api/org/{orgId}/
|
|
3970
|
+
http_method: "GET",
|
|
3971
|
+
path: "/api/org/{orgId}/metric-alerts/metric-keys",
|
|
3009
3972
|
path_params: { "orgId" => org_id },
|
|
3010
|
-
|
|
3973
|
+
query: { "pluginId" => plugin_id, "resourceTypeId" => resource_type_id },
|
|
3011
3974
|
request_options: request_options
|
|
3012
3975
|
)
|
|
3013
3976
|
end
|
|
3014
|
-
end
|
|
3015
|
-
|
|
3016
|
-
# `client.docker`
|
|
3017
|
-
class DockerNamespace
|
|
3018
|
-
# @api private
|
|
3019
|
-
# @param transport [Transport]
|
|
3020
|
-
def initialize(transport)
|
|
3021
|
-
@transport = transport
|
|
3022
|
-
end
|
|
3023
3977
|
|
|
3024
|
-
#
|
|
3025
|
-
#
|
|
3026
|
-
# _Requires permission: `resources:execute`._
|
|
3027
|
-
#
|
|
3028
|
-
# POST /api/org/{orgId}/docker/command
|
|
3029
|
-
#
|
|
3030
|
-
# Raises on 400: Bad request
|
|
3978
|
+
# List what the organization's resources offer to select on
|
|
3031
3979
|
#
|
|
3032
|
-
#
|
|
3980
|
+
# GET /api/org/{orgId}/metric-alerts/selector-options
|
|
3033
3981
|
#
|
|
3034
3982
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3035
3983
|
# constructed with.
|
|
3036
|
-
# @param body [Hash] Request body, shaped as `DockerCommandRequest`.
|
|
3037
3984
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3038
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
3985
|
+
# @return [Hash] Parsed JSON, shaped as `MetricAlertSelectorOptions` — see
|
|
3039
3986
|
# `sig/infrawrench/sdk.rbs`.
|
|
3040
3987
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3041
|
-
def
|
|
3988
|
+
def selector_options(org_id: nil, request_options: nil)
|
|
3042
3989
|
@transport.request(
|
|
3043
|
-
http_method: "
|
|
3044
|
-
path: "/api/org/{orgId}/
|
|
3990
|
+
http_method: "GET",
|
|
3991
|
+
path: "/api/org/{orgId}/metric-alerts/selector-options",
|
|
3045
3992
|
path_params: { "orgId" => org_id },
|
|
3046
|
-
body: body,
|
|
3047
3993
|
request_options: request_options
|
|
3048
3994
|
)
|
|
3049
3995
|
end
|
|
3050
|
-
end
|
|
3051
|
-
|
|
3052
|
-
# `client.invitations.by_token`
|
|
3053
|
-
class InvitationsByTokenNamespace
|
|
3054
|
-
# @api private
|
|
3055
|
-
# @param transport [Transport]
|
|
3056
|
-
def initialize(transport)
|
|
3057
|
-
@transport = transport
|
|
3058
|
-
end
|
|
3059
3996
|
|
|
3060
|
-
#
|
|
3997
|
+
# Preview which resources a selector matches right now
|
|
3061
3998
|
#
|
|
3062
|
-
# GET /api/
|
|
3999
|
+
# GET /api/org/{orgId}/metric-alerts/selector-preview
|
|
3063
4000
|
#
|
|
3064
|
-
# Raises on
|
|
4001
|
+
# Raises on 400: Bad request
|
|
3065
4002
|
#
|
|
3066
|
-
# @param
|
|
4003
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
4004
|
+
# constructed with.
|
|
4005
|
+
# @param plugin_id [String, nil]
|
|
4006
|
+
# @param resource_type_id [String, nil]
|
|
4007
|
+
# @param tag_key [String, nil]
|
|
4008
|
+
# @param tag_value [String, nil]
|
|
3067
4009
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3068
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
4010
|
+
# @return [Hash] Parsed JSON, shaped as `MetricAlertSelectorPreview` — see
|
|
4011
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
3069
4012
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3070
|
-
def
|
|
4013
|
+
def selector_preview(
|
|
4014
|
+
org_id: nil,
|
|
4015
|
+
plugin_id: nil,
|
|
4016
|
+
resource_type_id: nil,
|
|
4017
|
+
tag_key: nil,
|
|
4018
|
+
tag_value: nil,
|
|
4019
|
+
request_options: nil
|
|
4020
|
+
)
|
|
3071
4021
|
@transport.request(
|
|
3072
4022
|
http_method: "GET",
|
|
3073
|
-
path: "/api/
|
|
3074
|
-
path_params: { "
|
|
4023
|
+
path: "/api/org/{orgId}/metric-alerts/selector-preview",
|
|
4024
|
+
path_params: { "orgId" => org_id },
|
|
4025
|
+
query: {
|
|
4026
|
+
"pluginId" => plugin_id,
|
|
4027
|
+
"resourceTypeId" => resource_type_id,
|
|
4028
|
+
"tagKey" => tag_key,
|
|
4029
|
+
"tagValue" => tag_value
|
|
4030
|
+
},
|
|
3075
4031
|
request_options: request_options
|
|
3076
4032
|
)
|
|
3077
4033
|
end
|
|
3078
|
-
end
|
|
3079
|
-
|
|
3080
|
-
# `client.invitations`
|
|
3081
|
-
class InvitationsNamespace
|
|
3082
|
-
# @return [InvitationsByTokenNamespace] `client.invitations.by_token`
|
|
3083
|
-
attr_reader :by_token
|
|
3084
|
-
|
|
3085
|
-
# @api private
|
|
3086
|
-
# @param transport [Transport]
|
|
3087
|
-
def initialize(transport)
|
|
3088
|
-
@transport = transport
|
|
3089
|
-
@by_token = InvitationsByTokenNamespace.new(@transport)
|
|
3090
|
-
end
|
|
3091
4034
|
|
|
3092
|
-
#
|
|
4035
|
+
# Update a metric alert rule
|
|
3093
4036
|
#
|
|
3094
|
-
#
|
|
4037
|
+
# PUT /api/org/{orgId}/metric-alerts/{id}
|
|
3095
4038
|
#
|
|
3096
4039
|
# Raises on 400: Bad request
|
|
3097
4040
|
#
|
|
3098
|
-
# Raises on
|
|
4041
|
+
# Raises on 404: Not found
|
|
3099
4042
|
#
|
|
3100
|
-
# @param
|
|
4043
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
4044
|
+
# constructed with.
|
|
4045
|
+
# @param id [String]
|
|
4046
|
+
# @param body [Hash] Request body, shaped as `MetricAlertRuleInput`.
|
|
3101
4047
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3102
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
3103
|
-
# `sig/infrawrench/sdk.rbs`.
|
|
4048
|
+
# @return [Hash] Parsed JSON, shaped as `MetricAlertRule` — see `sig/infrawrench/sdk.rbs`.
|
|
3104
4049
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3105
|
-
def
|
|
4050
|
+
def update(id:, body:, org_id: nil, request_options: nil)
|
|
3106
4051
|
@transport.request(
|
|
3107
|
-
http_method: "
|
|
3108
|
-
path: "/api/
|
|
4052
|
+
http_method: "PUT",
|
|
4053
|
+
path: "/api/org/{orgId}/metric-alerts/{id}",
|
|
4054
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
3109
4055
|
body: body,
|
|
3110
4056
|
request_options: request_options
|
|
3111
4057
|
)
|
|
3112
4058
|
end
|
|
3113
4059
|
end
|
|
3114
4060
|
|
|
3115
|
-
# `client.
|
|
3116
|
-
class
|
|
4061
|
+
# `client.moment`
|
|
4062
|
+
class MomentNamespace
|
|
3117
4063
|
# @api private
|
|
3118
4064
|
# @param transport [Transport]
|
|
3119
4065
|
def initialize(transport)
|
|
3120
4066
|
@transport = transport
|
|
3121
4067
|
end
|
|
3122
4068
|
|
|
3123
|
-
#
|
|
4069
|
+
# Everything that happened around a timestamp
|
|
3124
4070
|
#
|
|
3125
|
-
#
|
|
4071
|
+
# "What changed around 03:14?" — one merged, chronological narrative of
|
|
4072
|
+
# everything the platform knows happened in a window: resource changes
|
|
4073
|
+
# (including sleep/wake schedule attribution), provider status incidents
|
|
4074
|
+
# that started/resolved in or overlap the window, cost anomalies, workflow
|
|
4075
|
+
# runs, deployments, audit-log entries, change freezes, and the drift/expiry
|
|
4076
|
+
# alert deliveries. Each feed is gated on the same permission its own
|
|
4077
|
+
# endpoint requires; feeds the caller cannot read are reported as `omitted`,
|
|
4078
|
+
# and a feed whose query fails is reported as `error` without blanking the
|
|
4079
|
+
# rest of the response.
|
|
3126
4080
|
#
|
|
3127
|
-
#
|
|
4081
|
+
# _Requires permission: `resources:read`._
|
|
3128
4082
|
#
|
|
3129
|
-
#
|
|
4083
|
+
# GET /api/org/{orgId}/moment
|
|
3130
4084
|
#
|
|
3131
|
-
# Raises on
|
|
4085
|
+
# Raises on 400: Bad request
|
|
3132
4086
|
#
|
|
3133
4087
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
3134
4088
|
# constructed with.
|
|
3135
|
-
# @param
|
|
4089
|
+
# @param at [String, nil] Centre of the window. Defaults to now.
|
|
4090
|
+
# @param window [Integer, nil] Half-window in minutes (the ± around `at`). Default 60, max
|
|
4091
|
+
# 4320 (±3 days).
|
|
3136
4092
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
3137
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
4093
|
+
# @return [Hash] Parsed JSON, shaped as `MomentResponse` — see `sig/infrawrench/sdk.rbs`.
|
|
3138
4094
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
3139
|
-
def
|
|
4095
|
+
def get(org_id: nil, at: nil, window: nil, request_options: nil)
|
|
3140
4096
|
@transport.request(
|
|
3141
|
-
http_method: "
|
|
3142
|
-
path: "/api/org/{orgId}/
|
|
4097
|
+
http_method: "GET",
|
|
4098
|
+
path: "/api/org/{orgId}/moment",
|
|
3143
4099
|
path_params: { "orgId" => org_id },
|
|
3144
|
-
|
|
4100
|
+
query: { "at" => at, "window" => window },
|
|
3145
4101
|
request_options: request_options
|
|
3146
4102
|
)
|
|
3147
4103
|
end
|
|
@@ -4126,6 +5082,11 @@ module Infrawrench
|
|
|
4126
5082
|
#
|
|
4127
5083
|
# Raises on 404: Not found
|
|
4128
5084
|
#
|
|
5085
|
+
# Raises on 422: Blocked by the organization's tag policy: the submitted
|
|
5086
|
+
# fields are missing a required tag (or carry a disallowed value). Retry
|
|
5087
|
+
# with the `x-tag-policy-override: true` header if you hold
|
|
5088
|
+
# `tag-policy:override`; both blocks and overrides are audit-logged.
|
|
5089
|
+
#
|
|
4129
5090
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
4130
5091
|
# constructed with.
|
|
4131
5092
|
# @param body [Hash] Request body, shaped as `CreateResourceRequest`.
|
|
@@ -4562,44 +5523,249 @@ module Infrawrench
|
|
|
4562
5523
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
4563
5524
|
def peer_panes(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
|
|
4564
5525
|
@transport.request(
|
|
4565
|
-
http_method: "POST",
|
|
4566
|
-
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/peer-panes",
|
|
4567
|
-
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
4568
|
-
body: body,
|
|
5526
|
+
http_method: "POST",
|
|
5527
|
+
path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/peer-panes",
|
|
5528
|
+
path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
|
|
5529
|
+
body: body,
|
|
5530
|
+
request_options: request_options
|
|
5531
|
+
)
|
|
5532
|
+
end
|
|
5533
|
+
|
|
5534
|
+
# Fetch options for a `resource-picker` field
|
|
5535
|
+
#
|
|
5536
|
+
# _Requires permission: `resources:read`._
|
|
5537
|
+
#
|
|
5538
|
+
# POST /api/org/{orgId}/resources/picker-resources
|
|
5539
|
+
#
|
|
5540
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
5541
|
+
# constructed with.
|
|
5542
|
+
# @param body [Hash] Request body, shaped as `PickerResourcesRequest`.
|
|
5543
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
5544
|
+
# @return [Array<Hash>] Parsed JSON, shaped as `Array<PickerResource>` — see
|
|
5545
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
5546
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
5547
|
+
def picker_resources(body:, org_id: nil, request_options: nil)
|
|
5548
|
+
@transport.request(
|
|
5549
|
+
http_method: "POST",
|
|
5550
|
+
path: "/api/org/{orgId}/resources/picker-resources",
|
|
5551
|
+
path_params: { "orgId" => org_id },
|
|
5552
|
+
body: body,
|
|
5553
|
+
request_options: request_options
|
|
5554
|
+
)
|
|
5555
|
+
end
|
|
5556
|
+
|
|
5557
|
+
# Update a resource via its plugin
|
|
5558
|
+
#
|
|
5559
|
+
# Applies the supplied field changes upstream and persists the refreshed
|
|
5560
|
+
# fields/display name to the DB. The body's `fields` map only carries the
|
|
5561
|
+
# keys the caller actually changed. Blocked with `423` while an org change
|
|
5562
|
+
# freeze is in effect (this is also the path that applies right-sizing
|
|
5563
|
+
# recommendations); every applied update is audit-logged.
|
|
5564
|
+
#
|
|
5565
|
+
# POST /api/org/{orgId}/resources/update
|
|
5566
|
+
#
|
|
5567
|
+
# Raises on 400: Bad request
|
|
5568
|
+
#
|
|
5569
|
+
# Raises on 404: Not found
|
|
5570
|
+
#
|
|
5571
|
+
# Raises on 423: Blocked by an active change freeze. Retry with the
|
|
5572
|
+
# `x-change-freeze-override: true` header if you hold `freezes:override`;
|
|
5573
|
+
# both blocks and overrides are audit-logged.
|
|
5574
|
+
#
|
|
5575
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
5576
|
+
# constructed with.
|
|
5577
|
+
# @param body [Hash] Request body, shaped as `UpdateResourceRequest`.
|
|
5578
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
5579
|
+
# @return [Hash] Parsed JSON, shaped as `UpdateResourceResponse` — see
|
|
5580
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
5581
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
5582
|
+
def update(body:, org_id: nil, request_options: nil)
|
|
5583
|
+
@transport.request(
|
|
5584
|
+
http_method: "POST",
|
|
5585
|
+
path: "/api/org/{orgId}/resources/update",
|
|
5586
|
+
path_params: { "orgId" => org_id },
|
|
5587
|
+
body: body,
|
|
5588
|
+
request_options: request_options
|
|
5589
|
+
)
|
|
5590
|
+
end
|
|
5591
|
+
end
|
|
5592
|
+
|
|
5593
|
+
# `client.rightsizing`
|
|
5594
|
+
class RightsizingNamespace
|
|
5595
|
+
# @api private
|
|
5596
|
+
# @param transport [Transport]
|
|
5597
|
+
def initialize(transport)
|
|
5598
|
+
@transport = transport
|
|
5599
|
+
end
|
|
5600
|
+
|
|
5601
|
+
# List oversized resources with resize recommendations
|
|
5602
|
+
#
|
|
5603
|
+
# Computes p95 CPU/memory utilisation over the last 14 days of stored
|
|
5604
|
+
# metrics for every resource whose plugin declares right-sizing support, and
|
|
5605
|
+
# matches under-utilised ones against the plugin's real size catalog (the
|
|
5606
|
+
# create form's size options, live-priced). Each recommendation names the
|
|
5607
|
+
# cheapest smaller size that still clears a headroom margin and quotes the
|
|
5608
|
+
# monthly saving. Apply one by submitting `sizeFieldKey` with the
|
|
5609
|
+
# recommended size id through the resource-update endpoint — which enforces
|
|
5610
|
+
# change freezes and writes the audit trail. Results are cached for a few
|
|
5611
|
+
# minutes; pass `refresh=true` to recompute.
|
|
5612
|
+
#
|
|
5613
|
+
# _Requires permission: `resources:read`._
|
|
5614
|
+
#
|
|
5615
|
+
# GET /api/org/{orgId}/rightsizing
|
|
5616
|
+
#
|
|
5617
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
5618
|
+
# constructed with.
|
|
5619
|
+
# @param refresh [String, nil] Bypass the short server-side cache and recompute now.
|
|
5620
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
5621
|
+
# @return [Hash] Parsed JSON, shaped as `RightsizingListResponse` — see
|
|
5622
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
5623
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
5624
|
+
def get(org_id: nil, refresh: nil, request_options: nil)
|
|
5625
|
+
@transport.request(
|
|
5626
|
+
http_method: "GET",
|
|
5627
|
+
path: "/api/org/{orgId}/rightsizing",
|
|
5628
|
+
path_params: { "orgId" => org_id },
|
|
5629
|
+
query: { "refresh" => refresh },
|
|
5630
|
+
request_options: request_options
|
|
5631
|
+
)
|
|
5632
|
+
end
|
|
5633
|
+
end
|
|
5634
|
+
|
|
5635
|
+
# `client.schedules`
|
|
5636
|
+
class SchedulesNamespace
|
|
5637
|
+
# @api private
|
|
5638
|
+
# @param transport [Transport]
|
|
5639
|
+
def initialize(transport)
|
|
5640
|
+
@transport = transport
|
|
5641
|
+
end
|
|
5642
|
+
|
|
5643
|
+
# Create a sleep/wake schedule
|
|
5644
|
+
#
|
|
5645
|
+
# Attach an off-at/on-at weekly window to a resource. The resource's type
|
|
5646
|
+
# must declare lifecycle start/stop actions (see the resource type
|
|
5647
|
+
# metadata); one schedule per resource. Times are wall-clock in the given
|
|
5648
|
+
# IANA timezone and remain correct across DST. Audit-logged.
|
|
5649
|
+
#
|
|
5650
|
+
# _Requires permission: `resources:write`._
|
|
5651
|
+
#
|
|
5652
|
+
# POST /api/org/{orgId}/schedules
|
|
5653
|
+
#
|
|
5654
|
+
# Raises on 400: Bad request
|
|
5655
|
+
#
|
|
5656
|
+
# Raises on 404: Not found
|
|
5657
|
+
#
|
|
5658
|
+
# Raises on 409: The resource already has a schedule
|
|
5659
|
+
#
|
|
5660
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
5661
|
+
# constructed with.
|
|
5662
|
+
# @param body [Hash, nil] Request body, shaped as `SleepScheduleCreate`.
|
|
5663
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
5664
|
+
# @return [Hash] Parsed JSON, shaped as `SleepSchedule` — see `sig/infrawrench/sdk.rbs`.
|
|
5665
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
5666
|
+
def create(org_id: nil, body: nil, request_options: nil)
|
|
5667
|
+
@transport.request(
|
|
5668
|
+
http_method: "POST",
|
|
5669
|
+
path: "/api/org/{orgId}/schedules",
|
|
5670
|
+
path_params: { "orgId" => org_id },
|
|
5671
|
+
body: body,
|
|
5672
|
+
request_options: request_options
|
|
5673
|
+
)
|
|
5674
|
+
end
|
|
5675
|
+
|
|
5676
|
+
# Delete a schedule
|
|
5677
|
+
#
|
|
5678
|
+
# Remove the schedule. The resource is left in whatever state it is in.
|
|
5679
|
+
# Audit-logged.
|
|
5680
|
+
#
|
|
5681
|
+
# _Requires permission: `resources:write`._
|
|
5682
|
+
#
|
|
5683
|
+
# DELETE /api/org/{orgId}/schedules/{scheduleId}
|
|
5684
|
+
#
|
|
5685
|
+
# Raises on 404: Not found
|
|
5686
|
+
#
|
|
5687
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
5688
|
+
# constructed with.
|
|
5689
|
+
# @param schedule_id [String]
|
|
5690
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
5691
|
+
# @return [nil] This endpoint returns no content.
|
|
5692
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
5693
|
+
def delete(schedule_id:, org_id: nil, request_options: nil)
|
|
5694
|
+
@transport.request(
|
|
5695
|
+
http_method: "DELETE",
|
|
5696
|
+
path: "/api/org/{orgId}/schedules/{scheduleId}",
|
|
5697
|
+
path_params: { "orgId" => org_id, "scheduleId" => schedule_id },
|
|
5698
|
+
accept: :empty,
|
|
5699
|
+
request_options: request_options
|
|
5700
|
+
)
|
|
5701
|
+
end
|
|
5702
|
+
|
|
5703
|
+
# List sleep/wake schedules
|
|
5704
|
+
#
|
|
5705
|
+
# Every schedule in the organization with its next transition, last run
|
|
5706
|
+
# outcome and a projected monthly saving computed from trailing per-resource
|
|
5707
|
+
# spend and the weekly off-hours fraction. Schedules attach to resources
|
|
5708
|
+
# whose plugin declares lifecycle start/stop actions; the poller executes
|
|
5709
|
+
# due transitions server-side.
|
|
5710
|
+
#
|
|
5711
|
+
# _Requires permission: `resources:read`._
|
|
5712
|
+
#
|
|
5713
|
+
# GET /api/org/{orgId}/schedules
|
|
5714
|
+
#
|
|
5715
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
5716
|
+
# constructed with.
|
|
5717
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
5718
|
+
# @return [Hash] Parsed JSON, shaped as `SleepScheduleList` — see `sig/infrawrench/sdk.rbs`.
|
|
5719
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
5720
|
+
def get(org_id: nil, request_options: nil)
|
|
5721
|
+
@transport.request(
|
|
5722
|
+
http_method: "GET",
|
|
5723
|
+
path: "/api/org/{orgId}/schedules",
|
|
5724
|
+
path_params: { "orgId" => org_id },
|
|
4569
5725
|
request_options: request_options
|
|
4570
5726
|
)
|
|
4571
5727
|
end
|
|
4572
5728
|
|
|
4573
|
-
#
|
|
5729
|
+
# Preview a schedule's projected saving
|
|
5730
|
+
#
|
|
5731
|
+
# Quote a timing against a resource before saving: the weekly off-hours
|
|
5732
|
+
# fraction, the resource's trailing spend normalized to a month, the
|
|
5733
|
+
# projected monthly saving, and the next few transitions. Makes no provider
|
|
5734
|
+
# API calls and changes nothing.
|
|
4574
5735
|
#
|
|
4575
5736
|
# _Requires permission: `resources:read`._
|
|
4576
5737
|
#
|
|
4577
|
-
# POST /api/org/{orgId}/
|
|
5738
|
+
# POST /api/org/{orgId}/schedules/preview
|
|
5739
|
+
#
|
|
5740
|
+
# Raises on 400: Bad request
|
|
5741
|
+
#
|
|
5742
|
+
# Raises on 404: Not found
|
|
4578
5743
|
#
|
|
4579
5744
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
4580
5745
|
# constructed with.
|
|
4581
|
-
# @param body [Hash] Request body, shaped as `
|
|
5746
|
+
# @param body [Hash, nil] Request body, shaped as `SleepSchedulePreviewRequest`.
|
|
4582
5747
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
4583
|
-
# @return [
|
|
5748
|
+
# @return [Hash] Parsed JSON, shaped as `SleepSchedulePreview` — see
|
|
4584
5749
|
# `sig/infrawrench/sdk.rbs`.
|
|
4585
5750
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
4586
|
-
def
|
|
5751
|
+
def preview(org_id: nil, body: nil, request_options: nil)
|
|
4587
5752
|
@transport.request(
|
|
4588
5753
|
http_method: "POST",
|
|
4589
|
-
path: "/api/org/{orgId}/
|
|
5754
|
+
path: "/api/org/{orgId}/schedules/preview",
|
|
4590
5755
|
path_params: { "orgId" => org_id },
|
|
4591
5756
|
body: body,
|
|
4592
5757
|
request_options: request_options
|
|
4593
5758
|
)
|
|
4594
5759
|
end
|
|
4595
5760
|
|
|
4596
|
-
# Update
|
|
5761
|
+
# Update or pause a schedule
|
|
4597
5762
|
#
|
|
4598
|
-
#
|
|
4599
|
-
#
|
|
4600
|
-
# keys the caller actually changed.
|
|
5763
|
+
# Edit the timing and/or toggle `paused`. Any change recomputes the next
|
|
5764
|
+
# transition; pausing clears it. Audit-logged.
|
|
4601
5765
|
#
|
|
4602
|
-
#
|
|
5766
|
+
# _Requires permission: `resources:write`._
|
|
5767
|
+
#
|
|
5768
|
+
# PUT /api/org/{orgId}/schedules/{scheduleId}
|
|
4603
5769
|
#
|
|
4604
5770
|
# Raises on 400: Bad request
|
|
4605
5771
|
#
|
|
@@ -4607,16 +5773,16 @@ module Infrawrench
|
|
|
4607
5773
|
#
|
|
4608
5774
|
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
4609
5775
|
# constructed with.
|
|
4610
|
-
# @param
|
|
5776
|
+
# @param schedule_id [String]
|
|
5777
|
+
# @param body [Hash, nil] Request body, shaped as `SleepScheduleUpdate`.
|
|
4611
5778
|
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
4612
|
-
# @return [Hash] Parsed JSON, shaped as `
|
|
4613
|
-
# `sig/infrawrench/sdk.rbs`.
|
|
5779
|
+
# @return [Hash] Parsed JSON, shaped as `SleepSchedule` — see `sig/infrawrench/sdk.rbs`.
|
|
4614
5780
|
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
4615
|
-
def update(
|
|
5781
|
+
def update(schedule_id:, org_id: nil, body: nil, request_options: nil)
|
|
4616
5782
|
@transport.request(
|
|
4617
|
-
http_method: "
|
|
4618
|
-
path: "/api/org/{orgId}/
|
|
4619
|
-
path_params: { "orgId" => org_id },
|
|
5783
|
+
http_method: "PUT",
|
|
5784
|
+
path: "/api/org/{orgId}/schedules/{scheduleId}",
|
|
5785
|
+
path_params: { "orgId" => org_id, "scheduleId" => schedule_id },
|
|
4620
5786
|
body: body,
|
|
4621
5787
|
request_options: request_options
|
|
4622
5788
|
)
|
|
@@ -5136,6 +6302,187 @@ module Infrawrench
|
|
|
5136
6302
|
end
|
|
5137
6303
|
end
|
|
5138
6304
|
|
|
6305
|
+
# `client.ssh_fanout.snippets`
|
|
6306
|
+
class SshFanoutSnippetsNamespace
|
|
6307
|
+
# @api private
|
|
6308
|
+
# @param transport [Transport]
|
|
6309
|
+
def initialize(transport)
|
|
6310
|
+
@transport = transport
|
|
6311
|
+
end
|
|
6312
|
+
|
|
6313
|
+
# Save a command snippet
|
|
6314
|
+
#
|
|
6315
|
+
# _Requires permission: `resources:execute`._
|
|
6316
|
+
#
|
|
6317
|
+
# POST /api/org/{orgId}/ssh-fanout/snippets
|
|
6318
|
+
#
|
|
6319
|
+
# Raises on 400: Bad request
|
|
6320
|
+
#
|
|
6321
|
+
# Raises on 409: Conflict
|
|
6322
|
+
#
|
|
6323
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6324
|
+
# constructed with.
|
|
6325
|
+
# @param body [Hash] Request body, shaped as `SshSnippetInput`.
|
|
6326
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6327
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
6328
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6329
|
+
def create(body:, org_id: nil, request_options: nil)
|
|
6330
|
+
@transport.request(
|
|
6331
|
+
http_method: "POST",
|
|
6332
|
+
path: "/api/org/{orgId}/ssh-fanout/snippets",
|
|
6333
|
+
path_params: { "orgId" => org_id },
|
|
6334
|
+
body: body,
|
|
6335
|
+
request_options: request_options
|
|
6336
|
+
)
|
|
6337
|
+
end
|
|
6338
|
+
|
|
6339
|
+
# Delete a saved command snippet
|
|
6340
|
+
#
|
|
6341
|
+
# _Requires permission: `resources:execute`._
|
|
6342
|
+
#
|
|
6343
|
+
# DELETE /api/org/{orgId}/ssh-fanout/snippets/{id}
|
|
6344
|
+
#
|
|
6345
|
+
# Raises on 404: Not found
|
|
6346
|
+
#
|
|
6347
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6348
|
+
# constructed with.
|
|
6349
|
+
# @param id [String]
|
|
6350
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6351
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
6352
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6353
|
+
def delete(id:, org_id: nil, request_options: nil)
|
|
6354
|
+
@transport.request(
|
|
6355
|
+
http_method: "DELETE",
|
|
6356
|
+
path: "/api/org/{orgId}/ssh-fanout/snippets/{id}",
|
|
6357
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
6358
|
+
request_options: request_options
|
|
6359
|
+
)
|
|
6360
|
+
end
|
|
6361
|
+
|
|
6362
|
+
# List saved command snippets
|
|
6363
|
+
#
|
|
6364
|
+
# Org-shared saved commands for reuse from the fan-out screen and CLI.
|
|
6365
|
+
#
|
|
6366
|
+
# _Requires permission: `resources:read`._
|
|
6367
|
+
#
|
|
6368
|
+
# GET /api/org/{orgId}/ssh-fanout/snippets
|
|
6369
|
+
#
|
|
6370
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6371
|
+
# constructed with.
|
|
6372
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6373
|
+
# @return [Hash] Parsed JSON, shaped as `Hash` — see `sig/infrawrench/sdk.rbs`.
|
|
6374
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6375
|
+
def get(org_id: nil, request_options: nil)
|
|
6376
|
+
@transport.request(
|
|
6377
|
+
http_method: "GET",
|
|
6378
|
+
path: "/api/org/{orgId}/ssh-fanout/snippets",
|
|
6379
|
+
path_params: { "orgId" => org_id },
|
|
6380
|
+
request_options: request_options
|
|
6381
|
+
)
|
|
6382
|
+
end
|
|
6383
|
+
|
|
6384
|
+
# Update a saved command snippet
|
|
6385
|
+
#
|
|
6386
|
+
# _Requires permission: `resources:execute`._
|
|
6387
|
+
#
|
|
6388
|
+
# PUT /api/org/{orgId}/ssh-fanout/snippets/{id}
|
|
6389
|
+
#
|
|
6390
|
+
# Raises on 400: Bad request
|
|
6391
|
+
#
|
|
6392
|
+
# Raises on 404: Not found
|
|
6393
|
+
#
|
|
6394
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6395
|
+
# constructed with.
|
|
6396
|
+
# @param id [String]
|
|
6397
|
+
# @param body [Hash] Request body, shaped as `SshSnippetInput`.
|
|
6398
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6399
|
+
# @return [Hash] Parsed JSON, shaped as `Ok` — see `sig/infrawrench/sdk.rbs`.
|
|
6400
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6401
|
+
def update(id:, body:, org_id: nil, request_options: nil)
|
|
6402
|
+
@transport.request(
|
|
6403
|
+
http_method: "PUT",
|
|
6404
|
+
path: "/api/org/{orgId}/ssh-fanout/snippets/{id}",
|
|
6405
|
+
path_params: { "orgId" => org_id, "id" => id },
|
|
6406
|
+
body: body,
|
|
6407
|
+
request_options: request_options
|
|
6408
|
+
)
|
|
6409
|
+
end
|
|
6410
|
+
end
|
|
6411
|
+
|
|
6412
|
+
# `client.ssh_fanout`
|
|
6413
|
+
class SshFanoutNamespace
|
|
6414
|
+
# @return [SshFanoutSnippetsNamespace] `client.ssh_fanout.snippets`
|
|
6415
|
+
attr_reader :snippets
|
|
6416
|
+
|
|
6417
|
+
# @api private
|
|
6418
|
+
# @param transport [Transport]
|
|
6419
|
+
def initialize(transport)
|
|
6420
|
+
@transport = transport
|
|
6421
|
+
@snippets = SshFanoutSnippetsNamespace.new(@transport)
|
|
6422
|
+
end
|
|
6423
|
+
|
|
6424
|
+
# Run one command across many SSH hosts
|
|
6425
|
+
#
|
|
6426
|
+
# Executes the command on every selected target under a concurrency cap
|
|
6427
|
+
# (default 8, max 16). Per-host results carry stdout, stderr, and exit code;
|
|
6428
|
+
# transport failures (unreachable, untrusted host key, blocked internal
|
|
6429
|
+
# host) are per-host too. Resource targets need `sshKeyId` (an org SSH key
|
|
6430
|
+
# owned by the caller). Blocked with HTTP 423 while a change freeze is in
|
|
6431
|
+
# effect; audit-logged.
|
|
6432
|
+
#
|
|
6433
|
+
# _Requires permission: `resources:execute`._
|
|
6434
|
+
#
|
|
6435
|
+
# POST /api/org/{orgId}/ssh-fanout/run
|
|
6436
|
+
#
|
|
6437
|
+
# Raises on 400: Bad request
|
|
6438
|
+
#
|
|
6439
|
+
# Raises on 423: Blocked by an active change freeze. Retry with the
|
|
6440
|
+
# `x-change-freeze-override: true` header if you hold `freezes:override`;
|
|
6441
|
+
# both blocks and overrides are audit-logged.
|
|
6442
|
+
#
|
|
6443
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6444
|
+
# constructed with.
|
|
6445
|
+
# @param body [Hash] Request body, shaped as `SshFanoutRunRequest`.
|
|
6446
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6447
|
+
# @return [Hash] Parsed JSON, shaped as `SshFanoutRunResponse` — see
|
|
6448
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
6449
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6450
|
+
def run(body:, org_id: nil, request_options: nil)
|
|
6451
|
+
@transport.request(
|
|
6452
|
+
http_method: "POST",
|
|
6453
|
+
path: "/api/org/{orgId}/ssh-fanout/run",
|
|
6454
|
+
path_params: { "orgId" => org_id },
|
|
6455
|
+
body: body,
|
|
6456
|
+
request_options: request_options
|
|
6457
|
+
)
|
|
6458
|
+
end
|
|
6459
|
+
|
|
6460
|
+
# List SSH-capable fan-out targets
|
|
6461
|
+
#
|
|
6462
|
+
# Every SSH-capable target in the org: `ssh` plugin accounts (native
|
|
6463
|
+
# credentials) plus resources whose type declares an sshEndpoint with a
|
|
6464
|
+
# resolvable host (EC2 instances, droplets, Hetzner servers, …).
|
|
6465
|
+
#
|
|
6466
|
+
# _Requires permission: `resources:read`._
|
|
6467
|
+
#
|
|
6468
|
+
# GET /api/org/{orgId}/ssh-fanout/targets
|
|
6469
|
+
#
|
|
6470
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6471
|
+
# constructed with.
|
|
6472
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6473
|
+
# @return [Hash] Parsed JSON, shaped as `SshFanoutTargetsResponse` — see
|
|
6474
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
6475
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6476
|
+
def targets(org_id: nil, request_options: nil)
|
|
6477
|
+
@transport.request(
|
|
6478
|
+
http_method: "GET",
|
|
6479
|
+
path: "/api/org/{orgId}/ssh-fanout/targets",
|
|
6480
|
+
path_params: { "orgId" => org_id },
|
|
6481
|
+
request_options: request_options
|
|
6482
|
+
)
|
|
6483
|
+
end
|
|
6484
|
+
end
|
|
6485
|
+
|
|
5139
6486
|
# `client.ssh_keys`
|
|
5140
6487
|
class SshKeysNamespace
|
|
5141
6488
|
# @api private
|
|
@@ -5365,6 +6712,47 @@ module Infrawrench
|
|
|
5365
6712
|
end
|
|
5366
6713
|
end
|
|
5367
6714
|
|
|
6715
|
+
# `client.status_incidents`
|
|
6716
|
+
class StatusIncidentsNamespace
|
|
6717
|
+
# @api private
|
|
6718
|
+
# @param transport [Transport]
|
|
6719
|
+
def initialize(transport)
|
|
6720
|
+
@transport = transport
|
|
6721
|
+
end
|
|
6722
|
+
|
|
6723
|
+
# Provider incidents overlapping your resources
|
|
6724
|
+
#
|
|
6725
|
+
# The "is it me or is it them?" feed. The poller watches each provider
|
|
6726
|
+
# plugin's public status feed (declared on its manifest — zero credentials,
|
|
6727
|
+
# zero rate-limit risk), caches active incidents, and this endpoint
|
|
6728
|
+
# correlates them against the resources the organization holds: an incident
|
|
6729
|
+
# matches a resource when it is provider-wide, names the resource's region,
|
|
6730
|
+
# or names its resource type. Includes incidents resolved within the last 24
|
|
6731
|
+
# hours so recent drift can still be correlated. Active incidents first,
|
|
6732
|
+
# most severe first.
|
|
6733
|
+
#
|
|
6734
|
+
# _Requires permission: `resources:read`._
|
|
6735
|
+
#
|
|
6736
|
+
# GET /api/org/{orgId}/status-incidents
|
|
6737
|
+
#
|
|
6738
|
+
# Raises on 400: Bad request
|
|
6739
|
+
#
|
|
6740
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6741
|
+
# constructed with.
|
|
6742
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6743
|
+
# @return [Hash] Parsed JSON, shaped as `OrgStatusIncidentsResponse` — see
|
|
6744
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
6745
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6746
|
+
def get(org_id: nil, request_options: nil)
|
|
6747
|
+
@transport.request(
|
|
6748
|
+
http_method: "GET",
|
|
6749
|
+
path: "/api/org/{orgId}/status-incidents",
|
|
6750
|
+
path_params: { "orgId" => org_id },
|
|
6751
|
+
request_options: request_options
|
|
6752
|
+
)
|
|
6753
|
+
end
|
|
6754
|
+
end
|
|
6755
|
+
|
|
5368
6756
|
# `client.storage`
|
|
5369
6757
|
class StorageNamespace
|
|
5370
6758
|
# @api private
|
|
@@ -5513,6 +6901,89 @@ module Infrawrench
|
|
|
5513
6901
|
end
|
|
5514
6902
|
end
|
|
5515
6903
|
|
|
6904
|
+
# `client.tag_policy`
|
|
6905
|
+
class TagPolicyNamespace
|
|
6906
|
+
# @api private
|
|
6907
|
+
# @param transport [Transport]
|
|
6908
|
+
def initialize(transport)
|
|
6909
|
+
@transport = transport
|
|
6910
|
+
end
|
|
6911
|
+
|
|
6912
|
+
# Per-account tag compliance scores
|
|
6913
|
+
#
|
|
6914
|
+
# For each account: how many of its resources expose tags and how many of
|
|
6915
|
+
# those carry every required tag with an allowed value. `score` is over the
|
|
6916
|
+
# evaluated (tag-capable) set so untaggable resource types don't drag it.
|
|
6917
|
+
#
|
|
6918
|
+
# _Requires permission: `resources:read`._
|
|
6919
|
+
#
|
|
6920
|
+
# GET /api/org/{orgId}/tag-policy/compliance
|
|
6921
|
+
#
|
|
6922
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6923
|
+
# constructed with.
|
|
6924
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6925
|
+
# @return [Hash] Parsed JSON, shaped as `TagComplianceReport` — see
|
|
6926
|
+
# `sig/infrawrench/sdk.rbs`.
|
|
6927
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6928
|
+
def compliance(org_id: nil, request_options: nil)
|
|
6929
|
+
@transport.request(
|
|
6930
|
+
http_method: "GET",
|
|
6931
|
+
path: "/api/org/{orgId}/tag-policy/compliance",
|
|
6932
|
+
path_params: { "orgId" => org_id },
|
|
6933
|
+
request_options: request_options
|
|
6934
|
+
)
|
|
6935
|
+
end
|
|
6936
|
+
|
|
6937
|
+
# The org's required-tag policy
|
|
6938
|
+
#
|
|
6939
|
+
# _Requires permission: `resources:read`._
|
|
6940
|
+
#
|
|
6941
|
+
# GET /api/org/{orgId}/tag-policy
|
|
6942
|
+
#
|
|
6943
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6944
|
+
# constructed with.
|
|
6945
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6946
|
+
# @return [Hash] Parsed JSON, shaped as `TagPolicy` — see `sig/infrawrench/sdk.rbs`.
|
|
6947
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6948
|
+
def get(org_id: nil, request_options: nil)
|
|
6949
|
+
@transport.request(
|
|
6950
|
+
http_method: "GET",
|
|
6951
|
+
path: "/api/org/{orgId}/tag-policy",
|
|
6952
|
+
path_params: { "orgId" => org_id },
|
|
6953
|
+
request_options: request_options
|
|
6954
|
+
)
|
|
6955
|
+
end
|
|
6956
|
+
|
|
6957
|
+
# Replace the org's tag policy
|
|
6958
|
+
#
|
|
6959
|
+
# Sets the required tag keys (each optionally restricted to allowed values)
|
|
6960
|
+
# and whether resource creation is blocked when they are missing. Keys are
|
|
6961
|
+
# matched case-insensitively against the generic `tags`/`labels` field
|
|
6962
|
+
# convention.
|
|
6963
|
+
#
|
|
6964
|
+
# _Requires permission: `org:settings:write`._
|
|
6965
|
+
#
|
|
6966
|
+
# PUT /api/org/{orgId}/tag-policy
|
|
6967
|
+
#
|
|
6968
|
+
# Raises on 400: Bad request
|
|
6969
|
+
#
|
|
6970
|
+
# @param org_id [String, nil] Organization id. Defaults to the `org_id` the client was
|
|
6971
|
+
# constructed with.
|
|
6972
|
+
# @param body [Hash] Request body, shaped as `TagPolicy`.
|
|
6973
|
+
# @param request_options [Hash, nil] Per-call `:headers`, `:timeout` and `:open_timeout`.
|
|
6974
|
+
# @return [Hash] Parsed JSON, shaped as `TagPolicy` — see `sig/infrawrench/sdk.rbs`.
|
|
6975
|
+
# @raise [Infrawrench::ApiError] On any non-2xx response.
|
|
6976
|
+
def update(body:, org_id: nil, request_options: nil)
|
|
6977
|
+
@transport.request(
|
|
6978
|
+
http_method: "PUT",
|
|
6979
|
+
path: "/api/org/{orgId}/tag-policy",
|
|
6980
|
+
path_params: { "orgId" => org_id },
|
|
6981
|
+
body: body,
|
|
6982
|
+
request_options: request_options
|
|
6983
|
+
)
|
|
6984
|
+
end
|
|
6985
|
+
end
|
|
6986
|
+
|
|
5516
6987
|
# `client.team.invitations`
|
|
5517
6988
|
class TeamInvitationsNamespace
|
|
5518
6989
|
# @api private
|
|
@@ -6072,6 +7543,8 @@ module Infrawrench
|
|
|
6072
7543
|
attr_reader :changes
|
|
6073
7544
|
# @return [ConnectNamespace] `client.connect`
|
|
6074
7545
|
attr_reader :connect
|
|
7546
|
+
# @return [CostCentresNamespace] `client.cost_centres`
|
|
7547
|
+
attr_reader :cost_centres
|
|
6075
7548
|
# @return [CostsNamespace] `client.costs`
|
|
6076
7549
|
attr_reader :costs
|
|
6077
7550
|
# @return [CustomGraphsNamespace] `client.custom_graphs`
|
|
@@ -6086,10 +7559,18 @@ module Infrawrench
|
|
|
6086
7559
|
attr_reader :digest
|
|
6087
7560
|
# @return [DockerNamespace] `client.docker`
|
|
6088
7561
|
attr_reader :docker
|
|
7562
|
+
# @return [ExpiringNamespace] `client.expiring`
|
|
7563
|
+
attr_reader :expiring
|
|
6089
7564
|
# @return [InvitationsNamespace] `client.invitations`
|
|
6090
7565
|
attr_reader :invitations
|
|
6091
7566
|
# @return [KvNamespace] `client.kv`
|
|
6092
7567
|
attr_reader :kv
|
|
7568
|
+
# @return [LogWorkspacesNamespace] `client.log_workspaces`
|
|
7569
|
+
attr_reader :log_workspaces
|
|
7570
|
+
# @return [MetricAlertsNamespace] `client.metric_alerts`
|
|
7571
|
+
attr_reader :metric_alerts
|
|
7572
|
+
# @return [MomentNamespace] `client.moment`
|
|
7573
|
+
attr_reader :moment
|
|
6093
7574
|
# @return [MsteamsNamespace] `client.msteams`
|
|
6094
7575
|
attr_reader :msteams
|
|
6095
7576
|
# @return [OrgsNamespace] `client.orgs`
|
|
@@ -6102,6 +7583,10 @@ module Infrawrench
|
|
|
6102
7583
|
attr_reader :profile
|
|
6103
7584
|
# @return [ResourcesNamespace] `client.resources`
|
|
6104
7585
|
attr_reader :resources
|
|
7586
|
+
# @return [RightsizingNamespace] `client.rightsizing`
|
|
7587
|
+
attr_reader :rightsizing
|
|
7588
|
+
# @return [SchedulesNamespace] `client.schedules`
|
|
7589
|
+
attr_reader :schedules
|
|
6105
7590
|
# @return [SearchNamespace] `client.search`
|
|
6106
7591
|
attr_reader :search
|
|
6107
7592
|
# @return [SftpNamespace] `client.sftp`
|
|
@@ -6110,12 +7595,18 @@ module Infrawrench
|
|
|
6110
7595
|
attr_reader :slack
|
|
6111
7596
|
# @return [SqlNamespace] `client.sql`
|
|
6112
7597
|
attr_reader :sql
|
|
7598
|
+
# @return [SshFanoutNamespace] `client.ssh_fanout`
|
|
7599
|
+
attr_reader :ssh_fanout
|
|
6113
7600
|
# @return [SshKeysNamespace] `client.ssh_keys`
|
|
6114
7601
|
attr_reader :ssh_keys
|
|
6115
7602
|
# @return [SshTunnelsNamespace] `client.ssh_tunnels`
|
|
6116
7603
|
attr_reader :ssh_tunnels
|
|
7604
|
+
# @return [StatusIncidentsNamespace] `client.status_incidents`
|
|
7605
|
+
attr_reader :status_incidents
|
|
6117
7606
|
# @return [StorageNamespace] `client.storage`
|
|
6118
7607
|
attr_reader :storage
|
|
7608
|
+
# @return [TagPolicyNamespace] `client.tag_policy`
|
|
7609
|
+
attr_reader :tag_policy
|
|
6119
7610
|
# @return [TeamNamespace] `client.team`
|
|
6120
7611
|
attr_reader :team
|
|
6121
7612
|
# @return [WorkflowApprovalsNamespace] `client.workflow_approvals`
|
|
@@ -6141,6 +7632,7 @@ module Infrawrench
|
|
|
6141
7632
|
@change_freezes = ChangeFreezesNamespace.new(@transport)
|
|
6142
7633
|
@changes = ChangesNamespace.new(@transport)
|
|
6143
7634
|
@connect = ConnectNamespace.new(@transport)
|
|
7635
|
+
@cost_centres = CostCentresNamespace.new(@transport)
|
|
6144
7636
|
@costs = CostsNamespace.new(@transport)
|
|
6145
7637
|
@custom_graphs = CustomGraphsNamespace.new(@transport)
|
|
6146
7638
|
@dashboards = DashboardsNamespace.new(@transport)
|
|
@@ -6148,21 +7640,30 @@ module Infrawrench
|
|
|
6148
7640
|
@deployments = DeploymentsNamespace.new(@transport)
|
|
6149
7641
|
@digest = DigestNamespace.new(@transport)
|
|
6150
7642
|
@docker = DockerNamespace.new(@transport)
|
|
7643
|
+
@expiring = ExpiringNamespace.new(@transport)
|
|
6151
7644
|
@invitations = InvitationsNamespace.new(@transport)
|
|
6152
7645
|
@kv = KvNamespace.new(@transport)
|
|
7646
|
+
@log_workspaces = LogWorkspacesNamespace.new(@transport)
|
|
7647
|
+
@metric_alerts = MetricAlertsNamespace.new(@transport)
|
|
7648
|
+
@moment = MomentNamespace.new(@transport)
|
|
6153
7649
|
@msteams = MsteamsNamespace.new(@transport)
|
|
6154
7650
|
@orgs = OrgsNamespace.new(@transport)
|
|
6155
7651
|
@orphans = OrphansNamespace.new(@transport)
|
|
6156
7652
|
@pages = PagesNamespace.new(@transport)
|
|
6157
7653
|
@profile = ProfileNamespace.new(@transport)
|
|
6158
7654
|
@resources = ResourcesNamespace.new(@transport)
|
|
7655
|
+
@rightsizing = RightsizingNamespace.new(@transport)
|
|
7656
|
+
@schedules = SchedulesNamespace.new(@transport)
|
|
6159
7657
|
@search = SearchNamespace.new(@transport)
|
|
6160
7658
|
@sftp = SftpNamespace.new(@transport)
|
|
6161
7659
|
@slack = SlackNamespace.new(@transport)
|
|
6162
7660
|
@sql = SqlNamespace.new(@transport)
|
|
7661
|
+
@ssh_fanout = SshFanoutNamespace.new(@transport)
|
|
6163
7662
|
@ssh_keys = SshKeysNamespace.new(@transport)
|
|
6164
7663
|
@ssh_tunnels = SshTunnelsNamespace.new(@transport)
|
|
7664
|
+
@status_incidents = StatusIncidentsNamespace.new(@transport)
|
|
6165
7665
|
@storage = StorageNamespace.new(@transport)
|
|
7666
|
+
@tag_policy = TagPolicyNamespace.new(@transport)
|
|
6166
7667
|
@team = TeamNamespace.new(@transport)
|
|
6167
7668
|
@workflow_approvals = WorkflowApprovalsNamespace.new(@transport)
|
|
6168
7669
|
@workflows = WorkflowsNamespace.new(@transport)
|