shipeasy-sdk 3.8.0 → 4.0.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/docs/skill/SKILL.md +7 -4
- data/lib/shipeasy/admin.rb +23 -20
- data/lib/shipeasy/sdk/see.rb +7 -5
- data/lib/shipeasy/sdk/version.rb +1 -1
- data/lib/shipeasy_admin/api/flags_api.rb +127 -214
- data/lib/shipeasy_admin/api/killswitch_api.rb +25 -525
- data/lib/shipeasy_admin/api/ops_api.rb +44 -351
- data/lib/shipeasy_admin/api_client.rb +2 -2
- data/lib/shipeasy_admin/api_error.rb +2 -2
- data/lib/shipeasy_admin/api_model_base.rb +2 -2
- data/lib/shipeasy_admin/configuration.rb +29 -2
- data/lib/shipeasy_admin/models/{set_killswitch_value_request.rb → add_to_gate_whitelist_request.rb} +37 -42
- data/lib/shipeasy_admin/models/create_public_bug_request.rb +464 -0
- data/lib/shipeasy_admin/models/create_public_feature_request_request.rb +407 -0
- data/lib/shipeasy_admin/models/{file_error_ticket_response.rb → create_public_ticket_response.rb} +22 -29
- data/lib/shipeasy_admin/models/env.rb +2 -2
- data/lib/shipeasy_admin/models/error.rb +41 -7
- data/lib/shipeasy_admin/models/error_code.rb +14 -3
- data/lib/shipeasy_admin/models/{get_experiment_timeseries_response_experiment.rb → gate_whitelist.rb} +51 -42
- data/lib/shipeasy_admin/models/gate_whitelist_attr.rb +40 -0
- data/lib/shipeasy_admin/models/killswitch_value.rb +2 -2
- data/lib/shipeasy_admin/models/notification_target.rb +2 -2
- data/lib/shipeasy_admin/models/notification_target_slack_channel.rb +2 -2
- data/lib/shipeasy_admin/models/ops_item_priority.rb +42 -0
- data/lib/shipeasy_admin/models/ops_item_status.rb +46 -0
- data/lib/shipeasy_admin/models/{discard_config_draft_request.rb → remove_from_gate_whitelist_request.rb} +34 -44
- data/lib/shipeasy_admin/models/{delete_alert_rule_response.rb → set_gate_whitelist_request.rb} +37 -25
- data/lib/shipeasy_admin/models/{set_killswitch_switch_request.rb → toggle_killswitch_request.rb} +30 -72
- data/lib/shipeasy_admin/models/{set_killswitch_value_response.rb → toggle_killswitch_response.rb} +100 -6
- data/lib/shipeasy_admin/version.rb +2 -2
- data/lib/shipeasy_admin.rb +14 -195
- metadata +13 -194
- data/lib/shipeasy_admin/api/alerts_api.rb +0 -352
- data/lib/shipeasy_admin/api/api_keys_api.rb +0 -229
- data/lib/shipeasy_admin/api/attributes_api.rb +0 -82
- data/lib/shipeasy_admin/api/configs_api.rb +0 -757
- data/lib/shipeasy_admin/api/connectors_api.rb +0 -497
- data/lib/shipeasy_admin/api/drafts_api.rb +0 -82
- data/lib/shipeasy_admin/api/errors_api.rb +0 -389
- data/lib/shipeasy_admin/api/events_api.rb +0 -438
- data/lib/shipeasy_admin/api/experiments_api.rb +0 -727
- data/lib/shipeasy_admin/api/keys_api.rb +0 -317
- data/lib/shipeasy_admin/api/metrics_api.rb +0 -281
- data/lib/shipeasy_admin/api/profiles_api.rb +0 -222
- data/lib/shipeasy_admin/api/projects_api.rb +0 -216
- data/lib/shipeasy_admin/api/universes_api.rb +0 -306
- data/lib/shipeasy_admin/models/approve_event_request.rb +0 -198
- data/lib/shipeasy_admin/models/approve_event_response.rb +0 -166
- data/lib/shipeasy_admin/models/claude_trigger_config.rb +0 -204
- data/lib/shipeasy_admin/models/connector_event.rb +0 -40
- data/lib/shipeasy_admin/models/connector_provider.rb +0 -45
- data/lib/shipeasy_admin/models/connector_record.rb +0 -468
- data/lib/shipeasy_admin/models/copilot_trigger_config.rb +0 -276
- data/lib/shipeasy_admin/models/create_alert_rule_request.rb +0 -383
- data/lib/shipeasy_admin/models/create_alert_rule_response.rb +0 -165
- data/lib/shipeasy_admin/models/create_claude_trigger_request.rb +0 -309
- data/lib/shipeasy_admin/models/create_config_request.rb +0 -291
- data/lib/shipeasy_admin/models/create_config_response.rb +0 -201
- data/lib/shipeasy_admin/models/create_connector_request.rb +0 -64
- data/lib/shipeasy_admin/models/create_connector_response.rb +0 -165
- data/lib/shipeasy_admin/models/create_copilot_trigger_request.rb +0 -316
- data/lib/shipeasy_admin/models/create_cursor_trigger_request.rb +0 -352
- data/lib/shipeasy_admin/models/create_event_request.rb +0 -236
- data/lib/shipeasy_admin/models/create_event_response.rb +0 -193
- data/lib/shipeasy_admin/models/create_experiment_request.rb +0 -807
- data/lib/shipeasy_admin/models/create_experiment_response.rb +0 -212
- data/lib/shipeasy_admin/models/create_gate_request.rb +0 -492
- data/lib/shipeasy_admin/models/create_gate_response.rb +0 -212
- data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +0 -188
- data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +0 -193
- data/lib/shipeasy_admin/models/create_jules_trigger_request.rb +0 -352
- data/lib/shipeasy_admin/models/create_key_request.rb +0 -297
- data/lib/shipeasy_admin/models/create_key_response.rb +0 -286
- data/lib/shipeasy_admin/models/create_killswitch_request.rb +0 -274
- data/lib/shipeasy_admin/models/create_killswitch_response.rb +0 -201
- data/lib/shipeasy_admin/models/create_metric_request.rb +0 -403
- data/lib/shipeasy_admin/models/create_metric_response.rb +0 -193
- data/lib/shipeasy_admin/models/create_o_auth_connector_request.rb +0 -273
- data/lib/shipeasy_admin/models/create_ops_item_request.rb +0 -287
- data/lib/shipeasy_admin/models/create_ops_item_response.rb +0 -177
- data/lib/shipeasy_admin/models/create_universe_request.rb +0 -272
- data/lib/shipeasy_admin/models/create_universe_response.rb +0 -212
- data/lib/shipeasy_admin/models/cursor_trigger_config.rb +0 -231
- data/lib/shipeasy_admin/models/delete_config_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_connector_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_event_response.rb +0 -189
- data/lib/shipeasy_admin/models/delete_experiment_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_gate_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_killswitch_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_metric_response.rb +0 -189
- data/lib/shipeasy_admin/models/delete_universe_response.rb +0 -188
- data/lib/shipeasy_admin/models/disable_gate_response.rb +0 -190
- data/lib/shipeasy_admin/models/discard_config_draft_response.rb +0 -188
- data/lib/shipeasy_admin/models/enable_gate_response.rb +0 -190
- data/lib/shipeasy_admin/models/error_record.rb +0 -597
- data/lib/shipeasy_admin/models/error_series_request.rb +0 -251
- data/lib/shipeasy_admin/models/error_series_response.rb +0 -195
- data/lib/shipeasy_admin/models/error_series_response_rows_inner.rb +0 -192
- data/lib/shipeasy_admin/models/experiment_inline_metric.rb +0 -337
- data/lib/shipeasy_admin/models/fire_connector_request.rb +0 -149
- data/lib/shipeasy_admin/models/fire_connector_response.rb +0 -176
- data/lib/shipeasy_admin/models/get_config_response.rb +0 -351
- data/lib/shipeasy_admin/models/get_current_project_response.rb +0 -606
- data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +0 -104
- data/lib/shipeasy_admin/models/get_event_response.rb +0 -344
- data/lib/shipeasy_admin/models/get_experiment_response.rb +0 -688
- data/lib/shipeasy_admin/models/get_experiment_results_response.rb +0 -243
- data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +0 -248
- data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +0 -252
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +0 -192
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +0 -278
- data/lib/shipeasy_admin/models/get_killswitch_response.rb +0 -270
- data/lib/shipeasy_admin/models/get_metric_response.rb +0 -378
- data/lib/shipeasy_admin/models/get_ops_item_response.rb +0 -349
- data/lib/shipeasy_admin/models/jules_trigger_config.rb +0 -240
- data/lib/shipeasy_admin/models/key_record.rb +0 -353
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +0 -186
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +0 -166
- data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +0 -478
- data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +0 -176
- data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +0 -280
- data/lib/shipeasy_admin/models/list_configs_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +0 -351
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +0 -237
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +0 -237
- data/lib/shipeasy_admin/models/list_events_response_inner.rb +0 -344
- data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +0 -259
- data/lib/shipeasy_admin/models/list_experiments_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +0 -688
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +0 -241
- data/lib/shipeasy_admin/models/list_gates_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +0 -395
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +0 -104
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +0 -238
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +0 -105
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +0 -358
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +0 -331
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +0 -319
- data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +0 -272
- data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +0 -195
- data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +0 -274
- data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +0 -224
- data/lib/shipeasy_admin/models/list_keys_response.rb +0 -180
- data/lib/shipeasy_admin/models/list_killswitches_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +0 -270
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +0 -248
- data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +0 -378
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +0 -288
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +0 -113
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +0 -217
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +0 -233
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +0 -240
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +0 -266
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +0 -264
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +0 -228
- data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +0 -349
- data/lib/shipeasy_admin/models/list_slack_channels_response.rb +0 -195
- data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +0 -203
- data/lib/shipeasy_admin/models/list_universes_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +0 -305
- data/lib/shipeasy_admin/models/notify_ops_request.rb +0 -261
- data/lib/shipeasy_admin/models/notify_ops_response.rb +0 -193
- data/lib/shipeasy_admin/models/publish_config_draft_request.rb +0 -187
- data/lib/shipeasy_admin/models/publish_config_draft_response.rb +0 -257
- data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +0 -391
- data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +0 -195
- data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +0 -192
- data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +0 -251
- data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +0 -214
- data/lib/shipeasy_admin/models/revoke_key_response.rb +0 -216
- data/lib/shipeasy_admin/models/save_config_draft_request.rb +0 -199
- data/lib/shipeasy_admin/models/save_config_draft_response.rb +0 -283
- data/lib/shipeasy_admin/models/search_hit.rb +0 -284
- data/lib/shipeasy_admin/models/search_response.rb +0 -167
- data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +0 -168
- data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +0 -216
- data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +0 -179
- data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +0 -201
- data/lib/shipeasy_admin/models/set_experiment_status_request.rb +0 -190
- data/lib/shipeasy_admin/models/set_experiment_status_response.rb +0 -214
- data/lib/shipeasy_admin/models/set_i18n_label_request.rb +0 -213
- data/lib/shipeasy_admin/models/set_i18n_label_response.rb +0 -472
- data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +0 -285
- data/lib/shipeasy_admin/models/test_connector_response.rb +0 -189
- data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +0 -234
- data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +0 -286
- data/lib/shipeasy_admin/models/update_alert_rule_request.rb +0 -304
- data/lib/shipeasy_admin/models/update_alert_rule_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_config_request.rb +0 -198
- data/lib/shipeasy_admin/models/update_config_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_config_schema_request.rb +0 -168
- data/lib/shipeasy_admin/models/update_config_schema_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_connector_request.rb +0 -211
- data/lib/shipeasy_admin/models/update_connector_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_error_status_request.rb +0 -190
- data/lib/shipeasy_admin/models/update_event_request.rb +0 -198
- data/lib/shipeasy_admin/models/update_event_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_experiment_request.rb +0 -747
- data/lib/shipeasy_admin/models/update_experiment_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_gate_request.rb +0 -403
- data/lib/shipeasy_admin/models/update_gate_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_i18n_key_request.rb +0 -176
- data/lib/shipeasy_admin/models/update_i18n_key_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_killswitch_request.rb +0 -224
- data/lib/shipeasy_admin/models/update_killswitch_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_ops_item_request.rb +0 -205
- data/lib/shipeasy_admin/models/update_ops_item_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_universe_request.rb +0 -213
- data/lib/shipeasy_admin/models/update_universe_response.rb +0 -165
- data/lib/shipeasy_admin/models/upsert_project_request.rb +0 -222
- data/lib/shipeasy_admin/models/upsert_project_response.rb +0 -260
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
|
-
#Shipeasy Admin API
|
|
2
|
+
#Shipeasy Admin API (server-SDK surface)
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The slice of the Shipeasy admin API that the published server SDKs expose as their optional `AdminClient`. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Three capabilities, nothing else: - **File a public ticket** — a bug or a feature request onto the project's ops queue. - **Toggle a kill switch** — flip the switch itself, or one of its named sub-switches, on one environment. - **Manage a flag's whitelist** — read, replace, add to, or remove from the allowlist that admits specific identities ahead of every targeting rule. Everything else in the admin API is reachable through the Shipeasy CLI and MCP server, which speak the complete contract (`openapi.yaml`).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 2.0.0
|
|
7
7
|
|
|
@@ -19,466 +19,43 @@ module Shipeasy::Admin::Generated
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
# @param create_killswitch_request [CreateKillswitchRequest]
|
|
25
|
-
# @param [Hash] opts the optional parameters
|
|
26
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
27
|
-
# @return [CreateKillswitchResponse]
|
|
28
|
-
def create_killswitch(create_killswitch_request, opts = {})
|
|
29
|
-
data, _status_code, _headers = create_killswitch_with_http_info(create_killswitch_request, opts)
|
|
30
|
-
data
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# Create a killswitch
|
|
34
|
-
# Creates a new killswitch with `value` (default `false`) applied to **every** env at version 1. Returns `409` if `name` already exists in the project. **Use cases** - **Untripped create** — `{ \"name\": \"payments.checkout\" }`. Provision the kill ahead of an incident. - **Pre-tripped** — `{ \"value\": true }` to ship the killswitch already engaged. - **With switches** — seed `switches` to carve out per-region/per-tenant kills from day one.
|
|
35
|
-
# @param create_killswitch_request [CreateKillswitchRequest]
|
|
36
|
-
# @param [Hash] opts the optional parameters
|
|
37
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
38
|
-
# @return [Array<(CreateKillswitchResponse, Integer, Hash)>] CreateKillswitchResponse data, response status code and response headers
|
|
39
|
-
def create_killswitch_with_http_info(create_killswitch_request, opts = {})
|
|
40
|
-
if @api_client.config.debugging
|
|
41
|
-
@api_client.config.logger.debug 'Calling API: KillswitchApi.create_killswitch ...'
|
|
42
|
-
end
|
|
43
|
-
# verify the required parameter 'create_killswitch_request' is set
|
|
44
|
-
if @api_client.config.client_side_validation && create_killswitch_request.nil?
|
|
45
|
-
fail ArgumentError, "Missing the required parameter 'create_killswitch_request' when calling KillswitchApi.create_killswitch"
|
|
46
|
-
end
|
|
47
|
-
# resource path
|
|
48
|
-
local_var_path = '/api/admin/killswitches'
|
|
49
|
-
|
|
50
|
-
# query parameters
|
|
51
|
-
query_params = opts[:query_params] || {}
|
|
52
|
-
|
|
53
|
-
# header parameters
|
|
54
|
-
header_params = opts[:header_params] || {}
|
|
55
|
-
# HTTP header 'Accept' (if needed)
|
|
56
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
57
|
-
# HTTP header 'Content-Type'
|
|
58
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
59
|
-
if !content_type.nil?
|
|
60
|
-
header_params['Content-Type'] = content_type
|
|
61
|
-
end
|
|
62
|
-
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
63
|
-
|
|
64
|
-
# form parameters
|
|
65
|
-
form_params = opts[:form_params] || {}
|
|
66
|
-
|
|
67
|
-
# http body (model)
|
|
68
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_killswitch_request)
|
|
69
|
-
|
|
70
|
-
# return_type
|
|
71
|
-
return_type = opts[:debug_return_type] || 'CreateKillswitchResponse'
|
|
72
|
-
|
|
73
|
-
# auth_names
|
|
74
|
-
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
75
|
-
|
|
76
|
-
new_options = opts.merge(
|
|
77
|
-
:operation => :"KillswitchApi.create_killswitch",
|
|
78
|
-
:header_params => header_params,
|
|
79
|
-
:query_params => query_params,
|
|
80
|
-
:form_params => form_params,
|
|
81
|
-
:body => post_body,
|
|
82
|
-
:auth_names => auth_names,
|
|
83
|
-
:return_type => return_type
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
87
|
-
if @api_client.config.debugging
|
|
88
|
-
@api_client.config.logger.debug "API called: KillswitchApi#create_killswitch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
89
|
-
end
|
|
90
|
-
return data, status_code, headers
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
# Delete a killswitch
|
|
94
|
-
# Soft-deletes the killswitch and rebuilds the project's flags KV blob so SDKs stop seeing it. **Use case:** Tear down a killswitch after the feature it protected has been removed.
|
|
22
|
+
# Toggle a killswitch or one of its switches
|
|
23
|
+
# Flips a killswitch on one environment and publishes a new version there. This is the one-call incident verb: it reads the current value, flips it, and publishes, so you don't have to fetch the killswitch first. Every body field is optional, which is what makes the call widen cleanly: - **Flip the killswitch** — `{}`. Flips the flat `value` on `prod`. - **Flip one sub-switch** — `{ \"switchKey\": \"eu_region\" }`. Flips that entry on `prod`, creating it (from `false`) if it isn't in the map yet. - **Set it idempotently** — `{ \"switchKey\": \"eu_region\", \"value\": true }`. Publishes exactly that value, so a retried call can't undo the first one. A `null` `value` means \"flip\", not \"set to null\". - **Choose the environment** — add `\"env\": \"staging\"`. Omitted, `env` is `prod`. The response reports both `previous` and `value`, so a caller that asked for a flip can see what it actually changed. Prefer this over `PUT /{id}/value` and `PUT /{id}/switch` unless you specifically need those endpoints' unconditional set semantics.
|
|
95
24
|
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
96
25
|
# @param [Hash] opts the optional parameters
|
|
97
26
|
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
98
|
-
# @
|
|
99
|
-
|
|
100
|
-
|
|
27
|
+
# @option opts [ToggleKillswitchRequest] :toggle_killswitch_request
|
|
28
|
+
# @return [ToggleKillswitchResponse]
|
|
29
|
+
def toggle_killswitch(id, opts = {})
|
|
30
|
+
data, _status_code, _headers = toggle_killswitch_with_http_info(id, opts)
|
|
101
31
|
data
|
|
102
32
|
end
|
|
103
33
|
|
|
104
|
-
#
|
|
105
|
-
#
|
|
34
|
+
# Toggle a killswitch or one of its switches
|
|
35
|
+
# Flips a killswitch on one environment and publishes a new version there. This is the one-call incident verb: it reads the current value, flips it, and publishes, so you don't have to fetch the killswitch first. Every body field is optional, which is what makes the call widen cleanly: - **Flip the killswitch** — `{}`. Flips the flat `value` on `prod`. - **Flip one sub-switch** — `{ \"switchKey\": \"eu_region\" }`. Flips that entry on `prod`, creating it (from `false`) if it isn't in the map yet. - **Set it idempotently** — `{ \"switchKey\": \"eu_region\", \"value\": true }`. Publishes exactly that value, so a retried call can't undo the first one. A `null` `value` means \"flip\", not \"set to null\". - **Choose the environment** — add `\"env\": \"staging\"`. Omitted, `env` is `prod`. The response reports both `previous` and `value`, so a caller that asked for a flip can see what it actually changed. Prefer this over `PUT /{id}/value` and `PUT /{id}/switch` unless you specifically need those endpoints' unconditional set semantics.
|
|
106
36
|
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
107
37
|
# @param [Hash] opts the optional parameters
|
|
108
38
|
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
109
|
-
# @
|
|
110
|
-
|
|
39
|
+
# @option opts [ToggleKillswitchRequest] :toggle_killswitch_request
|
|
40
|
+
# @return [Array<(ToggleKillswitchResponse, Integer, Hash)>] ToggleKillswitchResponse data, response status code and response headers
|
|
41
|
+
def toggle_killswitch_with_http_info(id, opts = {})
|
|
111
42
|
if @api_client.config.debugging
|
|
112
|
-
@api_client.config.logger.debug 'Calling API: KillswitchApi.
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: KillswitchApi.toggle_killswitch ...'
|
|
113
44
|
end
|
|
114
45
|
# verify the required parameter 'id' is set
|
|
115
46
|
if @api_client.config.client_side_validation && id.nil?
|
|
116
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.toggle_killswitch"
|
|
117
48
|
end
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
# query parameters
|
|
122
|
-
query_params = opts[:query_params] || {}
|
|
123
|
-
|
|
124
|
-
# header parameters
|
|
125
|
-
header_params = opts[:header_params] || {}
|
|
126
|
-
# HTTP header 'Accept' (if needed)
|
|
127
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
128
|
-
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
129
|
-
|
|
130
|
-
# form parameters
|
|
131
|
-
form_params = opts[:form_params] || {}
|
|
132
|
-
|
|
133
|
-
# http body (model)
|
|
134
|
-
post_body = opts[:debug_body]
|
|
135
|
-
|
|
136
|
-
# return_type
|
|
137
|
-
return_type = opts[:debug_return_type] || 'DeleteKillswitchResponse'
|
|
138
|
-
|
|
139
|
-
# auth_names
|
|
140
|
-
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
141
|
-
|
|
142
|
-
new_options = opts.merge(
|
|
143
|
-
:operation => :"KillswitchApi.delete_killswitch",
|
|
144
|
-
:header_params => header_params,
|
|
145
|
-
:query_params => query_params,
|
|
146
|
-
:form_params => form_params,
|
|
147
|
-
:body => post_body,
|
|
148
|
-
:auth_names => auth_names,
|
|
149
|
-
:return_type => return_type
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
153
|
-
if @api_client.config.debugging
|
|
154
|
-
@api_client.config.logger.debug "API called: KillswitchApi#delete_killswitch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
49
|
+
if @api_client.config.client_side_validation && id.to_s.length > 128
|
|
50
|
+
fail ArgumentError, 'invalid value for "id" when calling KillswitchApi.toggle_killswitch, the character length must be smaller than or equal to 128.'
|
|
155
51
|
end
|
|
156
|
-
return data, status_code, headers
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
# Get one killswitch
|
|
160
|
-
# Returns the killswitch metadata plus the latest published `value`/`switches`/`version` per env. **Use case:** Fetch the current state of one killswitch — e.g. to verify a trip propagated before declaring an incident mitigated.
|
|
161
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
162
|
-
# @param [Hash] opts the optional parameters
|
|
163
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
164
|
-
# @return [GetKillswitchResponse]
|
|
165
|
-
def get_killswitch(id, opts = {})
|
|
166
|
-
data, _status_code, _headers = get_killswitch_with_http_info(id, opts)
|
|
167
|
-
data
|
|
168
|
-
end
|
|
169
52
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
173
|
-
# @param [Hash] opts the optional parameters
|
|
174
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
175
|
-
# @return [Array<(GetKillswitchResponse, Integer, Hash)>] GetKillswitchResponse data, response status code and response headers
|
|
176
|
-
def get_killswitch_with_http_info(id, opts = {})
|
|
177
|
-
if @api_client.config.debugging
|
|
178
|
-
@api_client.config.logger.debug 'Calling API: KillswitchApi.get_killswitch ...'
|
|
179
|
-
end
|
|
180
|
-
# resource path
|
|
181
|
-
local_var_path = '/api/admin/killswitches/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
182
|
-
|
|
183
|
-
# query parameters
|
|
184
|
-
query_params = opts[:query_params] || {}
|
|
185
|
-
|
|
186
|
-
# header parameters
|
|
187
|
-
header_params = opts[:header_params] || {}
|
|
188
|
-
# HTTP header 'Accept' (if needed)
|
|
189
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
190
|
-
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
191
|
-
|
|
192
|
-
# form parameters
|
|
193
|
-
form_params = opts[:form_params] || {}
|
|
194
|
-
|
|
195
|
-
# http body (model)
|
|
196
|
-
post_body = opts[:debug_body]
|
|
197
|
-
|
|
198
|
-
# return_type
|
|
199
|
-
return_type = opts[:debug_return_type] || 'GetKillswitchResponse'
|
|
200
|
-
|
|
201
|
-
# auth_names
|
|
202
|
-
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
203
|
-
|
|
204
|
-
new_options = opts.merge(
|
|
205
|
-
:operation => :"KillswitchApi.get_killswitch",
|
|
206
|
-
:header_params => header_params,
|
|
207
|
-
:query_params => query_params,
|
|
208
|
-
:form_params => form_params,
|
|
209
|
-
:body => post_body,
|
|
210
|
-
:auth_names => auth_names,
|
|
211
|
-
:return_type => return_type
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
215
|
-
if @api_client.config.debugging
|
|
216
|
-
@api_client.config.logger.debug "API called: KillswitchApi#get_killswitch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
217
|
-
end
|
|
218
|
-
return data, status_code, headers
|
|
219
|
-
end
|
|
220
|
-
|
|
221
|
-
# List killswitches
|
|
222
|
-
# Returns a single page of killswitches ordered by `updated_at desc, id desc`. Each row includes the latest published `value`/`switches`/`version` per env. **Use case:** Snapshot every killswitch in the project — e.g. to render an incident-response runbook listing every kill and its current trip state.
|
|
223
|
-
# @param [Hash] opts the optional parameters
|
|
224
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
225
|
-
# @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
|
|
226
|
-
# @option opts [String] :cursor Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page.
|
|
227
|
-
# @return [ListKillswitchesResponse]
|
|
228
|
-
def list_killswitches(opts = {})
|
|
229
|
-
data, _status_code, _headers = list_killswitches_with_http_info(opts)
|
|
230
|
-
data
|
|
231
|
-
end
|
|
232
|
-
|
|
233
|
-
# List killswitches
|
|
234
|
-
# Returns a single page of killswitches ordered by `updated_at desc, id desc`. Each row includes the latest published `value`/`switches`/`version` per env. **Use case:** Snapshot every killswitch in the project — e.g. to render an incident-response runbook listing every kill and its current trip state.
|
|
235
|
-
# @param [Hash] opts the optional parameters
|
|
236
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
237
|
-
# @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
|
|
238
|
-
# @option opts [String] :cursor Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page.
|
|
239
|
-
# @return [Array<(ListKillswitchesResponse, Integer, Hash)>] ListKillswitchesResponse data, response status code and response headers
|
|
240
|
-
def list_killswitches_with_http_info(opts = {})
|
|
241
|
-
if @api_client.config.debugging
|
|
242
|
-
@api_client.config.logger.debug 'Calling API: KillswitchApi.list_killswitches ...'
|
|
243
|
-
end
|
|
244
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
|
245
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling KillswitchApi.list_killswitches, must be smaller than or equal to 500.'
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
249
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling KillswitchApi.list_killswitches, must be greater than or equal to 1.'
|
|
53
|
+
if @api_client.config.client_side_validation && id.to_s.length < 1
|
|
54
|
+
fail ArgumentError, 'invalid value for "id" when calling KillswitchApi.toggle_killswitch, the character length must be greater than or equal to 1.'
|
|
250
55
|
end
|
|
251
56
|
|
|
252
57
|
# resource path
|
|
253
|
-
local_var_path = '/api/admin/killswitches'
|
|
254
|
-
|
|
255
|
-
# query parameters
|
|
256
|
-
query_params = opts[:query_params] || {}
|
|
257
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
258
|
-
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
259
|
-
|
|
260
|
-
# header parameters
|
|
261
|
-
header_params = opts[:header_params] || {}
|
|
262
|
-
# HTTP header 'Accept' (if needed)
|
|
263
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
264
|
-
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
265
|
-
|
|
266
|
-
# form parameters
|
|
267
|
-
form_params = opts[:form_params] || {}
|
|
268
|
-
|
|
269
|
-
# http body (model)
|
|
270
|
-
post_body = opts[:debug_body]
|
|
271
|
-
|
|
272
|
-
# return_type
|
|
273
|
-
return_type = opts[:debug_return_type] || 'ListKillswitchesResponse'
|
|
274
|
-
|
|
275
|
-
# auth_names
|
|
276
|
-
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
277
|
-
|
|
278
|
-
new_options = opts.merge(
|
|
279
|
-
:operation => :"KillswitchApi.list_killswitches",
|
|
280
|
-
:header_params => header_params,
|
|
281
|
-
:query_params => query_params,
|
|
282
|
-
:form_params => form_params,
|
|
283
|
-
:body => post_body,
|
|
284
|
-
:auth_names => auth_names,
|
|
285
|
-
:return_type => return_type
|
|
286
|
-
)
|
|
287
|
-
|
|
288
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
289
|
-
if @api_client.config.debugging
|
|
290
|
-
@api_client.config.logger.debug "API called: KillswitchApi#list_killswitches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
291
|
-
end
|
|
292
|
-
return data, status_code, headers
|
|
293
|
-
end
|
|
294
|
-
|
|
295
|
-
# Set one switch entry
|
|
296
|
-
# Sets or updates a single `switchKey` on a single `env`. Publishes one new version on that env only — other envs untouched. Use this for surgical per-env, per-key flips during incident response (e.g. trip `eu_region` on prod without touching the flat `value` or other envs). **Use cases** - **Trip a region** — `{ \"env\": \"prod\", \"switchKey\": \"eu_region\", \"value\": true }`. - **Untrip without removing** — same payload with `value: false`. To remove the entry entirely use `DELETE /{id}/switch`.
|
|
297
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
298
|
-
# @param set_killswitch_switch_request [SetKillswitchSwitchRequest]
|
|
299
|
-
# @param [Hash] opts the optional parameters
|
|
300
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
301
|
-
# @return [SetKillswitchSwitchResponse]
|
|
302
|
-
def set_killswitch_switch(id, set_killswitch_switch_request, opts = {})
|
|
303
|
-
data, _status_code, _headers = set_killswitch_switch_with_http_info(id, set_killswitch_switch_request, opts)
|
|
304
|
-
data
|
|
305
|
-
end
|
|
306
|
-
|
|
307
|
-
# Set one switch entry
|
|
308
|
-
# Sets or updates a single `switchKey` on a single `env`. Publishes one new version on that env only — other envs untouched. Use this for surgical per-env, per-key flips during incident response (e.g. trip `eu_region` on prod without touching the flat `value` or other envs). **Use cases** - **Trip a region** — `{ \"env\": \"prod\", \"switchKey\": \"eu_region\", \"value\": true }`. - **Untrip without removing** — same payload with `value: false`. To remove the entry entirely use `DELETE /{id}/switch`.
|
|
309
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
310
|
-
# @param set_killswitch_switch_request [SetKillswitchSwitchRequest]
|
|
311
|
-
# @param [Hash] opts the optional parameters
|
|
312
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
313
|
-
# @return [Array<(SetKillswitchSwitchResponse, Integer, Hash)>] SetKillswitchSwitchResponse data, response status code and response headers
|
|
314
|
-
def set_killswitch_switch_with_http_info(id, set_killswitch_switch_request, opts = {})
|
|
315
|
-
if @api_client.config.debugging
|
|
316
|
-
@api_client.config.logger.debug 'Calling API: KillswitchApi.set_killswitch_switch ...'
|
|
317
|
-
end
|
|
318
|
-
# verify the required parameter 'id' is set
|
|
319
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
320
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.set_killswitch_switch"
|
|
321
|
-
end
|
|
322
|
-
# verify the required parameter 'set_killswitch_switch_request' is set
|
|
323
|
-
if @api_client.config.client_side_validation && set_killswitch_switch_request.nil?
|
|
324
|
-
fail ArgumentError, "Missing the required parameter 'set_killswitch_switch_request' when calling KillswitchApi.set_killswitch_switch"
|
|
325
|
-
end
|
|
326
|
-
# resource path
|
|
327
|
-
local_var_path = '/api/admin/killswitches/{id}/switch'.sub('{id}', CGI.escape(id.to_s))
|
|
328
|
-
|
|
329
|
-
# query parameters
|
|
330
|
-
query_params = opts[:query_params] || {}
|
|
331
|
-
|
|
332
|
-
# header parameters
|
|
333
|
-
header_params = opts[:header_params] || {}
|
|
334
|
-
# HTTP header 'Accept' (if needed)
|
|
335
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
336
|
-
# HTTP header 'Content-Type'
|
|
337
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
338
|
-
if !content_type.nil?
|
|
339
|
-
header_params['Content-Type'] = content_type
|
|
340
|
-
end
|
|
341
|
-
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
342
|
-
|
|
343
|
-
# form parameters
|
|
344
|
-
form_params = opts[:form_params] || {}
|
|
345
|
-
|
|
346
|
-
# http body (model)
|
|
347
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(set_killswitch_switch_request)
|
|
348
|
-
|
|
349
|
-
# return_type
|
|
350
|
-
return_type = opts[:debug_return_type] || 'SetKillswitchSwitchResponse'
|
|
351
|
-
|
|
352
|
-
# auth_names
|
|
353
|
-
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
354
|
-
|
|
355
|
-
new_options = opts.merge(
|
|
356
|
-
:operation => :"KillswitchApi.set_killswitch_switch",
|
|
357
|
-
:header_params => header_params,
|
|
358
|
-
:query_params => query_params,
|
|
359
|
-
:form_params => form_params,
|
|
360
|
-
:body => post_body,
|
|
361
|
-
:auth_names => auth_names,
|
|
362
|
-
:return_type => return_type
|
|
363
|
-
)
|
|
364
|
-
|
|
365
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
366
|
-
if @api_client.config.debugging
|
|
367
|
-
@api_client.config.logger.debug "API called: KillswitchApi#set_killswitch_switch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
368
|
-
end
|
|
369
|
-
return data, status_code, headers
|
|
370
|
-
end
|
|
371
|
-
|
|
372
|
-
# Set the flat value on one env
|
|
373
|
-
# Sets the flat `value` on a single `env`, publishing one new version on that env only. `switches` and other envs are untouched. Use this to trip (or untrip) a killswitch on one environment without replacing its per-key overrides. **Use cases** - **Trip on prod** — `{ \"env\": \"prod\", \"value\": true }`. - **Untrip on prod** — `{ \"env\": \"prod\", \"value\": false }`.
|
|
374
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
375
|
-
# @param set_killswitch_value_request [SetKillswitchValueRequest]
|
|
376
|
-
# @param [Hash] opts the optional parameters
|
|
377
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
378
|
-
# @return [SetKillswitchValueResponse]
|
|
379
|
-
def set_killswitch_value(id, set_killswitch_value_request, opts = {})
|
|
380
|
-
data, _status_code, _headers = set_killswitch_value_with_http_info(id, set_killswitch_value_request, opts)
|
|
381
|
-
data
|
|
382
|
-
end
|
|
383
|
-
|
|
384
|
-
# Set the flat value on one env
|
|
385
|
-
# Sets the flat `value` on a single `env`, publishing one new version on that env only. `switches` and other envs are untouched. Use this to trip (or untrip) a killswitch on one environment without replacing its per-key overrides. **Use cases** - **Trip on prod** — `{ \"env\": \"prod\", \"value\": true }`. - **Untrip on prod** — `{ \"env\": \"prod\", \"value\": false }`.
|
|
386
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
387
|
-
# @param set_killswitch_value_request [SetKillswitchValueRequest]
|
|
388
|
-
# @param [Hash] opts the optional parameters
|
|
389
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
390
|
-
# @return [Array<(SetKillswitchValueResponse, Integer, Hash)>] SetKillswitchValueResponse data, response status code and response headers
|
|
391
|
-
def set_killswitch_value_with_http_info(id, set_killswitch_value_request, opts = {})
|
|
392
|
-
if @api_client.config.debugging
|
|
393
|
-
@api_client.config.logger.debug 'Calling API: KillswitchApi.set_killswitch_value ...'
|
|
394
|
-
end
|
|
395
|
-
# verify the required parameter 'id' is set
|
|
396
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
397
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.set_killswitch_value"
|
|
398
|
-
end
|
|
399
|
-
# verify the required parameter 'set_killswitch_value_request' is set
|
|
400
|
-
if @api_client.config.client_side_validation && set_killswitch_value_request.nil?
|
|
401
|
-
fail ArgumentError, "Missing the required parameter 'set_killswitch_value_request' when calling KillswitchApi.set_killswitch_value"
|
|
402
|
-
end
|
|
403
|
-
# resource path
|
|
404
|
-
local_var_path = '/api/admin/killswitches/{id}/value'.sub('{id}', CGI.escape(id.to_s))
|
|
405
|
-
|
|
406
|
-
# query parameters
|
|
407
|
-
query_params = opts[:query_params] || {}
|
|
408
|
-
|
|
409
|
-
# header parameters
|
|
410
|
-
header_params = opts[:header_params] || {}
|
|
411
|
-
# HTTP header 'Accept' (if needed)
|
|
412
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
413
|
-
# HTTP header 'Content-Type'
|
|
414
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
415
|
-
if !content_type.nil?
|
|
416
|
-
header_params['Content-Type'] = content_type
|
|
417
|
-
end
|
|
418
|
-
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
419
|
-
|
|
420
|
-
# form parameters
|
|
421
|
-
form_params = opts[:form_params] || {}
|
|
422
|
-
|
|
423
|
-
# http body (model)
|
|
424
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(set_killswitch_value_request)
|
|
425
|
-
|
|
426
|
-
# return_type
|
|
427
|
-
return_type = opts[:debug_return_type] || 'SetKillswitchValueResponse'
|
|
428
|
-
|
|
429
|
-
# auth_names
|
|
430
|
-
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
431
|
-
|
|
432
|
-
new_options = opts.merge(
|
|
433
|
-
:operation => :"KillswitchApi.set_killswitch_value",
|
|
434
|
-
:header_params => header_params,
|
|
435
|
-
:query_params => query_params,
|
|
436
|
-
:form_params => form_params,
|
|
437
|
-
:body => post_body,
|
|
438
|
-
:auth_names => auth_names,
|
|
439
|
-
:return_type => return_type
|
|
440
|
-
)
|
|
441
|
-
|
|
442
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
443
|
-
if @api_client.config.debugging
|
|
444
|
-
@api_client.config.logger.debug "API called: KillswitchApi#set_killswitch_value\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
445
|
-
end
|
|
446
|
-
return data, status_code, headers
|
|
447
|
-
end
|
|
448
|
-
|
|
449
|
-
# Remove one switch entry
|
|
450
|
-
# Removes a single `switchKey` from the `switches` map on a single `env`. Publishes a new version on that env. Returns `{ removed: false }` if the entry didn't exist (idempotent no-op). **Use case:** Clean up a per-region override after the incident is resolved so the flat `value` governs again.
|
|
451
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
452
|
-
# @param unset_killswitch_switch_request [UnsetKillswitchSwitchRequest]
|
|
453
|
-
# @param [Hash] opts the optional parameters
|
|
454
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
455
|
-
# @return [UnsetKillswitchSwitchResponse]
|
|
456
|
-
def unset_killswitch_switch(id, unset_killswitch_switch_request, opts = {})
|
|
457
|
-
data, _status_code, _headers = unset_killswitch_switch_with_http_info(id, unset_killswitch_switch_request, opts)
|
|
458
|
-
data
|
|
459
|
-
end
|
|
460
|
-
|
|
461
|
-
# Remove one switch entry
|
|
462
|
-
# Removes a single `switchKey` from the `switches` map on a single `env`. Publishes a new version on that env. Returns `{ removed: false }` if the entry didn't exist (idempotent no-op). **Use case:** Clean up a per-region override after the incident is resolved so the flat `value` governs again.
|
|
463
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
464
|
-
# @param unset_killswitch_switch_request [UnsetKillswitchSwitchRequest]
|
|
465
|
-
# @param [Hash] opts the optional parameters
|
|
466
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
467
|
-
# @return [Array<(UnsetKillswitchSwitchResponse, Integer, Hash)>] UnsetKillswitchSwitchResponse data, response status code and response headers
|
|
468
|
-
def unset_killswitch_switch_with_http_info(id, unset_killswitch_switch_request, opts = {})
|
|
469
|
-
if @api_client.config.debugging
|
|
470
|
-
@api_client.config.logger.debug 'Calling API: KillswitchApi.unset_killswitch_switch ...'
|
|
471
|
-
end
|
|
472
|
-
# verify the required parameter 'id' is set
|
|
473
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
474
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.unset_killswitch_switch"
|
|
475
|
-
end
|
|
476
|
-
# verify the required parameter 'unset_killswitch_switch_request' is set
|
|
477
|
-
if @api_client.config.client_side_validation && unset_killswitch_switch_request.nil?
|
|
478
|
-
fail ArgumentError, "Missing the required parameter 'unset_killswitch_switch_request' when calling KillswitchApi.unset_killswitch_switch"
|
|
479
|
-
end
|
|
480
|
-
# resource path
|
|
481
|
-
local_var_path = '/api/admin/killswitches/{id}/switch'.sub('{id}', CGI.escape(id.to_s))
|
|
58
|
+
local_var_path = '/api/admin/killswitches/{id}/toggle'.sub('{id}', CGI.escape(id.to_s))
|
|
482
59
|
|
|
483
60
|
# query parameters
|
|
484
61
|
query_params = opts[:query_params] || {}
|
|
@@ -498,16 +75,16 @@ module Shipeasy::Admin::Generated
|
|
|
498
75
|
form_params = opts[:form_params] || {}
|
|
499
76
|
|
|
500
77
|
# http body (model)
|
|
501
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
|
78
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'toggle_killswitch_request'])
|
|
502
79
|
|
|
503
80
|
# return_type
|
|
504
|
-
return_type = opts[:debug_return_type] || '
|
|
81
|
+
return_type = opts[:debug_return_type] || 'ToggleKillswitchResponse'
|
|
505
82
|
|
|
506
83
|
# auth_names
|
|
507
84
|
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
508
85
|
|
|
509
86
|
new_options = opts.merge(
|
|
510
|
-
:operation => :"KillswitchApi.
|
|
87
|
+
:operation => :"KillswitchApi.toggle_killswitch",
|
|
511
88
|
:header_params => header_params,
|
|
512
89
|
:query_params => query_params,
|
|
513
90
|
:form_params => form_params,
|
|
@@ -516,86 +93,9 @@ module Shipeasy::Admin::Generated
|
|
|
516
93
|
:return_type => return_type
|
|
517
94
|
)
|
|
518
95
|
|
|
519
|
-
data, status_code, headers = @api_client.call_api(:
|
|
520
|
-
if @api_client.config.debugging
|
|
521
|
-
@api_client.config.logger.debug "API called: KillswitchApi#unset_killswitch_switch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
522
|
-
end
|
|
523
|
-
return data, status_code, headers
|
|
524
|
-
end
|
|
525
|
-
|
|
526
|
-
# Update a killswitch
|
|
527
|
-
# Partial update applied to **every** env. Setting `value`/`switches` publishes a new version per env. Description-only patches don't bump versions. To change a single switch on a single env, use `PUT /{id}/switch` instead. **Use cases** - **Trip everywhere** — `{ \"value\": true }`. Kills the feature across dev/stage/prod in one call. - **Untrip everywhere** — `{ \"value\": false }`. - **Replace switches** — send the full new map; per-key edits use `PUT /{id}/switch`. - **Update description** — metadata-only patches don't bump versions.
|
|
528
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
529
|
-
# @param update_killswitch_request [UpdateKillswitchRequest]
|
|
530
|
-
# @param [Hash] opts the optional parameters
|
|
531
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
532
|
-
# @return [UpdateKillswitchResponse]
|
|
533
|
-
def update_killswitch(id, update_killswitch_request, opts = {})
|
|
534
|
-
data, _status_code, _headers = update_killswitch_with_http_info(id, update_killswitch_request, opts)
|
|
535
|
-
data
|
|
536
|
-
end
|
|
537
|
-
|
|
538
|
-
# Update a killswitch
|
|
539
|
-
# Partial update applied to **every** env. Setting `value`/`switches` publishes a new version per env. Description-only patches don't bump versions. To change a single switch on a single env, use `PUT /{id}/switch` instead. **Use cases** - **Trip everywhere** — `{ \"value\": true }`. Kills the feature across dev/stage/prod in one call. - **Untrip everywhere** — `{ \"value\": false }`. - **Replace switches** — send the full new map; per-key edits use `PUT /{id}/switch`. - **Update description** — metadata-only patches don't bump versions.
|
|
540
|
-
# @param id [String] Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
|
|
541
|
-
# @param update_killswitch_request [UpdateKillswitchRequest]
|
|
542
|
-
# @param [Hash] opts the optional parameters
|
|
543
|
-
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
544
|
-
# @return [Array<(UpdateKillswitchResponse, Integer, Hash)>] UpdateKillswitchResponse data, response status code and response headers
|
|
545
|
-
def update_killswitch_with_http_info(id, update_killswitch_request, opts = {})
|
|
546
|
-
if @api_client.config.debugging
|
|
547
|
-
@api_client.config.logger.debug 'Calling API: KillswitchApi.update_killswitch ...'
|
|
548
|
-
end
|
|
549
|
-
# verify the required parameter 'id' is set
|
|
550
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
551
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.update_killswitch"
|
|
552
|
-
end
|
|
553
|
-
# verify the required parameter 'update_killswitch_request' is set
|
|
554
|
-
if @api_client.config.client_side_validation && update_killswitch_request.nil?
|
|
555
|
-
fail ArgumentError, "Missing the required parameter 'update_killswitch_request' when calling KillswitchApi.update_killswitch"
|
|
556
|
-
end
|
|
557
|
-
# resource path
|
|
558
|
-
local_var_path = '/api/admin/killswitches/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
559
|
-
|
|
560
|
-
# query parameters
|
|
561
|
-
query_params = opts[:query_params] || {}
|
|
562
|
-
|
|
563
|
-
# header parameters
|
|
564
|
-
header_params = opts[:header_params] || {}
|
|
565
|
-
# HTTP header 'Accept' (if needed)
|
|
566
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
567
|
-
# HTTP header 'Content-Type'
|
|
568
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
569
|
-
if !content_type.nil?
|
|
570
|
-
header_params['Content-Type'] = content_type
|
|
571
|
-
end
|
|
572
|
-
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
573
|
-
|
|
574
|
-
# form parameters
|
|
575
|
-
form_params = opts[:form_params] || {}
|
|
576
|
-
|
|
577
|
-
# http body (model)
|
|
578
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_killswitch_request)
|
|
579
|
-
|
|
580
|
-
# return_type
|
|
581
|
-
return_type = opts[:debug_return_type] || 'UpdateKillswitchResponse'
|
|
582
|
-
|
|
583
|
-
# auth_names
|
|
584
|
-
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
585
|
-
|
|
586
|
-
new_options = opts.merge(
|
|
587
|
-
:operation => :"KillswitchApi.update_killswitch",
|
|
588
|
-
:header_params => header_params,
|
|
589
|
-
:query_params => query_params,
|
|
590
|
-
:form_params => form_params,
|
|
591
|
-
:body => post_body,
|
|
592
|
-
:auth_names => auth_names,
|
|
593
|
-
:return_type => return_type
|
|
594
|
-
)
|
|
595
|
-
|
|
596
|
-
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
96
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
597
97
|
if @api_client.config.debugging
|
|
598
|
-
@api_client.config.logger.debug "API called: KillswitchApi#
|
|
98
|
+
@api_client.config.logger.debug "API called: KillswitchApi#toggle_killswitch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
599
99
|
end
|
|
600
100
|
return data, status_code, headers
|
|
601
101
|
end
|