harness-mcp-v2 3.2.35 → 3.2.37
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.
- package/README.md +6 -5
- package/build/client/harness-client.d.ts.map +1 -1
- package/build/client/harness-client.js +59 -2
- package/build/client/harness-client.js.map +1 -1
- package/build/client/types.d.ts +6 -0
- package/build/client/types.d.ts.map +1 -1
- package/build/config.d.ts +63 -63
- package/build/prompts/access-control-audit.js +1 -1
- package/build/prompts/chaos-resilience.js +1 -1
- package/build/prompts/chaos-resilience.js.map +1 -1
- package/build/registry/extractors.d.ts +27 -0
- package/build/registry/extractors.d.ts.map +1 -1
- package/build/registry/extractors.js +70 -0
- package/build/registry/extractors.js.map +1 -1
- package/build/registry/toolsets/access-control.d.ts.map +1 -1
- package/build/registry/toolsets/access-control.js +42 -8
- package/build/registry/toolsets/access-control.js.map +1 -1
- package/build/registry/toolsets/chaos-descriptions.d.ts +22 -21
- package/build/registry/toolsets/chaos-descriptions.d.ts.map +1 -1
- package/build/registry/toolsets/chaos-descriptions.js +51 -37
- package/build/registry/toolsets/chaos-descriptions.js.map +1 -1
- package/build/registry/toolsets/chaos.d.ts.map +1 -1
- package/build/registry/toolsets/chaos.js +121 -18
- package/build/registry/toolsets/chaos.js.map +1 -1
- package/build/registry/toolsets/gitops.d.ts.map +1 -1
- package/build/registry/toolsets/gitops.js +115 -1
- package/build/registry/toolsets/gitops.js.map +1 -1
- package/build/registry/toolsets/logs.d.ts.map +1 -1
- package/build/registry/toolsets/logs.js +10 -7
- package/build/registry/toolsets/logs.js.map +1 -1
- package/build/tools/diagnose/pipeline.d.ts.map +1 -1
- package/build/tools/diagnose/pipeline.js +15 -1
- package/build/tools/diagnose/pipeline.js.map +1 -1
- package/build/tools/harness-get.d.ts.map +1 -1
- package/build/tools/harness-get.js +7 -2
- package/build/tools/harness-get.js.map +1 -1
- package/build/utils/log-prefix.d.ts +14 -2
- package/build/utils/log-prefix.d.ts.map +1 -1
- package/build/utils/log-prefix.js +40 -17
- package/build/utils/log-prefix.js.map +1 -1
- package/build/utils/log-resolver.d.ts +32 -3
- package/build/utils/log-resolver.d.ts.map +1 -1
- package/build/utils/log-resolver.js +128 -171
- package/build/utils/log-resolver.js.map +1 -1
- package/build/utils/url-parser.d.ts.map +1 -1
- package/build/utils/url-parser.js +1 -0
- package/build/utils/url-parser.js.map +1 -1
- package/npm-shrinkwrap.json +40 -84
- package/package.json +7 -6
|
@@ -7,7 +7,7 @@ descChaosExperiment, descChaosExperimentRun, descChaosProbe, descChaosExperiment
|
|
|
7
7
|
// Operation descriptions
|
|
8
8
|
descListExperiments, descGetExperiment, descGetExperimentRun, descListProbes, descGetProbe, descCreateProbe, descListExperimentTemplates, descGetExperimentTemplate, descDeleteExperimentTemplate, descListExperimentVariables, descGetComponentVariable, descCreateExperiment, descListLinuxInfra, descListLoadtests, descGetLoadtest, descCreateLoadtest, descUpdateLoadtest, descDeleteLoadtest, descListChaosServices, descGetChaosService, descDeleteChaosService, descCreateChaosService, descUpdateChaosService, descChaosServiceEnvironmentIds, descChaosServiceInfrastructureIds, descChaosServiceTags, descChaosServiceIncludeAllScope, descChaosServiceProbeIds, descChaosServiceOnboardingIdFilter, descListChaosServiceExperimentRuns, descListChaosServiceLoadTests, descChaosServiceSearch, descChaosServiceIdentity, descBodyChaosServiceCreate, descBodyChaosServiceUpdate, descChaosServiceName, descChaosServiceDescription, descChaosServiceTagsBody, descChaosServiceExternalServiceId, descChaosServiceAgentId, descChaosServiceEnvironmentId, descChaosServiceInfrastructureId, descChaosServiceInfrastructureType, descChaosServiceOnboardingId, descChaosServiceLinkedDiscoveredService, descChaosServiceProbes, descCustomService, descListCustomServices, descGetCustomService, descCreateCustomService, descBodyCustomServiceCreate, descCustomServiceIdentity, descCustomServiceName, descCustomServiceType, descCustomServiceRepoURL, descCustomServiceModule, descCustomServiceSpec, descUpdateCustomService, descBodyCustomServiceUpdate, descCustomServiceTypeFilter, descCustomServiceCategoryFilter, descChaosServiceProbesUpdate, descListK8sInfra, descGetK8sInfra, descCreateK8sInfra, descListChaosEnabledInfra, descBodyK8sInfraCreate, descK8sInfraIdentityCreate, descK8sInfraNameCreate, descK8sInfraEnvironmentIdCreate, descK8sInfraInfraIdCreate, descK8sInfraConnectorIdCreate, descK8sInfraNamespaceCreate, descK8sInfraServiceAccountCreate, descK8sInfraScopeCreate, descK8sInfraTypeCreate, descK8sInfraAiEnabledCreate, descListHubs, descGetHub, descCreateHub, descUpdateHub, descDeleteHub, descListFaults, descGetFault, descListFaultTemplates, descGetFaultTemplate, descDeleteFaultTemplate, descListProbeTemplates, descGetProbeTemplate, descDeleteProbeTemplate, descListActionTemplates, descGetActionTemplate, descDeleteActionTemplate, descListHubFaults, descListChaosEnvironments, descListApplicationMaps, descGetApplicationMap, descAppMapSearch, descAppMapEnvironmentId, descAppMapInfraId, descAppMapAll, descAppMapMinimal, descListDiscoveredNetworkMaps, descSDNetworkMapSearch, descListGuardConditions, descGetGuardCondition, descDeleteGuardCondition, descListGuardRules, descGetGuardRule, descDeleteGuardRule, descListRecommendations, descGetRecommendation, descListRisks, descGetRisk, descListDRTests, descDeleteProbe, descGetProbeManifest, descListProbesInRun, descGetFaultVariables, descGetFaultYaml, descListFaultExperimentRuns, descDeleteFault, descListActions, descGetAction, descGetActionManifest, descDeleteAction, descCreateAction, descBodyActionCreate, descActionName, descActionIdentityCreate, descActionEntityTypeCreate, descActionInfraTypeCreate, descActionPropertiesBody, descActionDurationShorthand, descActionDescriptionCreate, descActionTagsCreate, descActionVariablesBody, descActionRunPropertiesBody, descActionInputsBody,
|
|
9
9
|
// Action descriptions
|
|
10
|
-
descRunExperiment, descStopExperiment, descDeleteExperiment, descEnableProbe, descVerifyProbe, descCreateFromTemplate, descListRevisions, descGetVariables, descGetYaml, descCompareRevisions, descRunLoadtest, descStopLoadtest, descCheckK8sHealth, descEnableGuardRule, descGetProbeTemplateVariables, descListActionTemplateRevisions, descGetActionTemplateVariables, descCompareActionTemplateRevisions,
|
|
10
|
+
descRunExperiment, descStopExperiment, descDeleteExperiment, descEnableProbe, descVerifyProbe, descCreateFromTemplate, descListRevisions, descListExperimentTemplateRevisions, descGetVariables, descGetYaml, descCompareRevisions, descRunLoadtest, descStopLoadtest, descCheckK8sHealth, descEnableGuardRule, descGetProbeTemplateVariables, descListActionTemplateRevisions, descGetActionTemplateVariables, descCompareActionTemplateRevisions,
|
|
11
11
|
// Body schema descriptions
|
|
12
12
|
descBodyExperimentRun, descBodyNoBody, descBodyExperimentCreate, descBodyCreateFromTemplate, descBodyLoadtestDefinition, descBodyProbeEnable, descBodyProbeVerify, descBodyProbesInRun, descBodyProbeCreate,
|
|
13
13
|
// Field descriptions
|
|
@@ -41,6 +41,13 @@ const SD_V2 = "/gateway/servicediscovery/api/v2";
|
|
|
41
41
|
const CUSTOM_DISCOVERY_AGENT = "custom-discovery-agent";
|
|
42
42
|
/** Chaos scope override — Chaos REST API uses organizationIdentifier (not orgIdentifier). */
|
|
43
43
|
const CHAOS_SCOPE = { org: "organizationIdentifier" };
|
|
44
|
+
/** template_id and hub_identity are required on every experiment-template call except list and list_revisions. */
|
|
45
|
+
const experimentTemplateParams = {
|
|
46
|
+
fields: [
|
|
47
|
+
{ name: "template_id", required: true, description: "Template identity. Pass as resource_id or params.template_id." },
|
|
48
|
+
{ name: "hub_identity", required: true, description: "hubIdentity from the same list row. Pass as params.hub_identity." },
|
|
49
|
+
],
|
|
50
|
+
};
|
|
44
51
|
/** Unwrap single-item response from get-chaos-component-variable endpoint. */
|
|
45
52
|
const chaosComponentVarExtract = (raw) => {
|
|
46
53
|
const r = raw;
|
|
@@ -79,6 +86,30 @@ function compactDiscoveredAgent(item) {
|
|
|
79
86
|
}
|
|
80
87
|
return slim;
|
|
81
88
|
}
|
|
89
|
+
// Generic compact drops hubIdentity, environmentID, and infraID (they do not
|
|
90
|
+
// match the *Id / *Identifier whitelist). Later gets need those exact fields.
|
|
91
|
+
function compactExperimentTemplate(item) {
|
|
92
|
+
const slim = {};
|
|
93
|
+
for (const key of [
|
|
94
|
+
"identity", "name", "description", "tags", "hubIdentity",
|
|
95
|
+
"revision", "infraType", "isDefault", "openInHarness",
|
|
96
|
+
]) {
|
|
97
|
+
if (item[key] !== undefined)
|
|
98
|
+
slim[key] = item[key];
|
|
99
|
+
}
|
|
100
|
+
return slim;
|
|
101
|
+
}
|
|
102
|
+
function compactK8sInfra(item) {
|
|
103
|
+
const slim = {};
|
|
104
|
+
for (const key of [
|
|
105
|
+
"identity", "name", "description", "tags", "environmentID", "infraID", "status",
|
|
106
|
+
"isChaosEnabled", "infraType", "infraScope", "createdAt", "updatedAt", "openInHarness",
|
|
107
|
+
]) {
|
|
108
|
+
if (item[key] !== undefined)
|
|
109
|
+
slim[key] = item[key];
|
|
110
|
+
}
|
|
111
|
+
return slim;
|
|
112
|
+
}
|
|
82
113
|
function optionalText(value) {
|
|
83
114
|
if (value == null)
|
|
84
115
|
return undefined;
|
|
@@ -958,6 +989,17 @@ export const chaosToolset = {
|
|
|
958
989
|
operationPolicy: { risk: "read", retryPolicy: "safe" },
|
|
959
990
|
pathParams: { experiment_id: "experimentId" },
|
|
960
991
|
queryParams: { run_id: "experimentRunId", notify_id: "notifyId" },
|
|
992
|
+
// OpenAPI marks both experimentRunId and notifyId required. The handler
|
|
993
|
+
// (GetExperimentDetails) applies experimentRunId when set, otherwise
|
|
994
|
+
// notifyId, and only omits the run filter when both are empty. Either
|
|
995
|
+
// id selects one run. Both empty returns an arbitrary run, or an error
|
|
996
|
+
// when the experiment has none.
|
|
997
|
+
preflight: async ({ input }) => {
|
|
998
|
+
if (!input.run_id && !input.notify_id) {
|
|
999
|
+
throw new Error("Missing required param for chaos_experiment_run.get: run_id or notify_id. " +
|
|
1000
|
+
"Read experimentRunID or notifyID from harness_get resource_type=chaos_experiment.");
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
961
1003
|
responseExtractor: passthrough,
|
|
962
1004
|
description: descGetExperimentRun,
|
|
963
1005
|
},
|
|
@@ -1545,6 +1587,7 @@ export const chaosToolset = {
|
|
|
1545
1587
|
scope: "project",
|
|
1546
1588
|
scopeParams: CHAOS_SCOPE,
|
|
1547
1589
|
identifierFields: ["template_id"],
|
|
1590
|
+
compactItem: compactExperimentTemplate,
|
|
1548
1591
|
listFilterFields: [
|
|
1549
1592
|
{ name: "hub_identity", description: descHubIdentity },
|
|
1550
1593
|
{ name: "infrastructure_type", description: descInfraType },
|
|
@@ -1586,6 +1629,7 @@ export const chaosToolset = {
|
|
|
1586
1629
|
hub_identity: "hubIdentity",
|
|
1587
1630
|
revision: "revision",
|
|
1588
1631
|
},
|
|
1632
|
+
paramsSchema: experimentTemplateParams,
|
|
1589
1633
|
responseExtractor: passthrough,
|
|
1590
1634
|
description: descGetExperimentTemplate,
|
|
1591
1635
|
},
|
|
@@ -1595,6 +1639,7 @@ export const chaosToolset = {
|
|
|
1595
1639
|
operationPolicy: { risk: "destructive", retryPolicy: "do_not_retry" },
|
|
1596
1640
|
pathParams: { template_id: "templateId" },
|
|
1597
1641
|
queryParams: { hub_identity: "hubIdentity" },
|
|
1642
|
+
paramsSchema: experimentTemplateParams,
|
|
1598
1643
|
responseExtractor: passthrough,
|
|
1599
1644
|
description: descDeleteExperimentTemplate,
|
|
1600
1645
|
},
|
|
@@ -1606,29 +1651,38 @@ export const chaosToolset = {
|
|
|
1606
1651
|
operationPolicy: { risk: "low_write", retryPolicy: "do_not_retry" },
|
|
1607
1652
|
pathParams: { template_id: "templateId" },
|
|
1608
1653
|
queryParams: { hub_identity: "hubIdentity", revision: "revision" },
|
|
1609
|
-
|
|
1654
|
+
paramsSchema: experimentTemplateParams,
|
|
1655
|
+
injectAccountInBody: true,
|
|
1656
|
+
bodyBuilder: (input, config) => {
|
|
1610
1657
|
const b = coerceBody(input);
|
|
1611
1658
|
let infraRef = b.infra_ref;
|
|
1612
1659
|
if (!infraRef && b.infra_id) {
|
|
1613
1660
|
const envId = b.environment_id;
|
|
1614
1661
|
const infraId = b.infra_id;
|
|
1615
|
-
if (
|
|
1616
|
-
infraRef = `${envId}/${infraId}`;
|
|
1617
|
-
}
|
|
1618
|
-
else {
|
|
1662
|
+
if (infraId.includes("/")) {
|
|
1619
1663
|
infraRef = infraId;
|
|
1620
1664
|
}
|
|
1665
|
+
else if (envId) {
|
|
1666
|
+
infraRef = `${envId}/${infraId}`;
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
if (!infraRef || !infraRef.includes("/")) {
|
|
1670
|
+
throw new Error("Missing required field infra_ref for chaos_experiment_template.create_from_template. " +
|
|
1671
|
+
"Pass infra_ref as environmentID/infraID, or pass infra_id and environment_id.");
|
|
1621
1672
|
}
|
|
1622
1673
|
return {
|
|
1623
1674
|
name: b.name,
|
|
1624
1675
|
identity: b.identity,
|
|
1625
1676
|
infraRef,
|
|
1677
|
+
// Snake-case alias so the required-field check, which reads the built
|
|
1678
|
+
// body, sees infra_ref. The launch API reads infraRef.
|
|
1679
|
+
infra_ref: infraRef,
|
|
1626
1680
|
importType: b.import_type ?? "LOCAL",
|
|
1627
1681
|
...(b.description ? { description: b.description } : {}),
|
|
1628
1682
|
...(b.tags ? { tags: b.tags } : {}),
|
|
1629
1683
|
accountIdentifier: b.account_id ?? input.account_id,
|
|
1630
|
-
organizationIdentifier: b.org_id ?? input.org_id,
|
|
1631
|
-
projectIdentifier: b.project_id ?? input.project_id,
|
|
1684
|
+
organizationIdentifier: b.org_id ?? input.org_id ?? config.HARNESS_ORG,
|
|
1685
|
+
projectIdentifier: b.project_id ?? input.project_id ?? config.HARNESS_PROJECT,
|
|
1632
1686
|
};
|
|
1633
1687
|
},
|
|
1634
1688
|
responseExtractor: passthrough,
|
|
@@ -1641,7 +1695,7 @@ export const chaosToolset = {
|
|
|
1641
1695
|
{ name: "project_id", type: "string", required: false, description: descProjectIdBody },
|
|
1642
1696
|
{ name: "name", type: "string", required: true, description: descExperimentName },
|
|
1643
1697
|
{ name: "identity", type: "string", required: true, description: descExperimentIdentity },
|
|
1644
|
-
{ name: "infra_ref", type: "string", required:
|
|
1698
|
+
{ name: "infra_ref", type: "string", required: true, description: descInfraRef },
|
|
1645
1699
|
{ name: "infra_id", type: "string", required: false, description: descInfraIdCreate },
|
|
1646
1700
|
{ name: "environment_id", type: "string", required: false, description: descEnvironmentIdCreate },
|
|
1647
1701
|
{ name: "description", type: "string", required: false, description: descExperimentDescription },
|
|
@@ -1661,7 +1715,8 @@ export const chaosToolset = {
|
|
|
1661
1715
|
limit: "limit",
|
|
1662
1716
|
},
|
|
1663
1717
|
responseExtractor: passthrough,
|
|
1664
|
-
|
|
1718
|
+
// ListExperimentTemplateQuery.Validate does not require hubIdentity.
|
|
1719
|
+
actionDescription: descListExperimentTemplateRevisions,
|
|
1665
1720
|
},
|
|
1666
1721
|
get_variables: {
|
|
1667
1722
|
method: "GET",
|
|
@@ -1672,6 +1727,7 @@ export const chaosToolset = {
|
|
|
1672
1727
|
hub_identity: "hubIdentity",
|
|
1673
1728
|
revision: "revision",
|
|
1674
1729
|
},
|
|
1730
|
+
paramsSchema: experimentTemplateParams,
|
|
1675
1731
|
responseExtractor: passthrough,
|
|
1676
1732
|
actionDescription: descGetVariables,
|
|
1677
1733
|
},
|
|
@@ -1684,6 +1740,7 @@ export const chaosToolset = {
|
|
|
1684
1740
|
hub_identity: "hubIdentity",
|
|
1685
1741
|
revision: "revision",
|
|
1686
1742
|
},
|
|
1743
|
+
paramsSchema: experimentTemplateParams,
|
|
1687
1744
|
responseExtractor: passthrough,
|
|
1688
1745
|
actionDescription: descGetYaml,
|
|
1689
1746
|
},
|
|
@@ -1697,6 +1754,13 @@ export const chaosToolset = {
|
|
|
1697
1754
|
revision1: "revision1",
|
|
1698
1755
|
revision2: "revision2",
|
|
1699
1756
|
},
|
|
1757
|
+
paramsSchema: {
|
|
1758
|
+
fields: [
|
|
1759
|
+
...experimentTemplateParams.fields,
|
|
1760
|
+
{ name: "revision1", required: true, description: "First revision to compare." },
|
|
1761
|
+
{ name: "revision2", required: true, description: "Second revision to compare." },
|
|
1762
|
+
],
|
|
1763
|
+
},
|
|
1700
1764
|
responseExtractor: passthrough,
|
|
1701
1765
|
actionDescription: descCompareRevisions,
|
|
1702
1766
|
},
|
|
@@ -2603,7 +2667,8 @@ export const chaosToolset = {
|
|
|
2603
2667
|
toolset: "chaos",
|
|
2604
2668
|
scope: "project",
|
|
2605
2669
|
scopeParams: CHAOS_SCOPE,
|
|
2606
|
-
identifierFields: ["
|
|
2670
|
+
identifierFields: ["identity"],
|
|
2671
|
+
compactItem: compactK8sInfra,
|
|
2607
2672
|
deepLinkTemplate: "/ng/account/{accountId}/module/chaos/orgs/{orgIdentifier}/projects/{projectIdentifier}/settings/chaos/infrastructures/{infraId}",
|
|
2608
2673
|
diagnosticHint: "An infrastructure can only create chaos experiments when status is ACTIVE and isChaosEnabled is true. Filter out any infrastructure that does not meet both conditions.",
|
|
2609
2674
|
relatedResources: [
|
|
@@ -2612,7 +2677,12 @@ export const chaosToolset = {
|
|
|
2612
2677
|
{ resourceType: "chaos_enabled_infrastructure", relationship: "child", description: "After install completes, the registered infra appears here once status=ACTIVE and isChaosEnabled=true." },
|
|
2613
2678
|
],
|
|
2614
2679
|
listFilterFields: [
|
|
2615
|
-
|
|
2680
|
+
// OpenAPI marks environmentIdentifier optional on POST /rest/v2/infrastructures.
|
|
2681
|
+
// Chaos manager forwards it to k8s-ifs ListInfra, which always calls
|
|
2682
|
+
// harness.ListInfraURL. An empty environment returns "missing envID",
|
|
2683
|
+
// wrapped as HTTP 500 "failed to generate list harness infrastructure url,
|
|
2684
|
+
// missing envID". A list with no environment is chaos_enabled_infrastructure.
|
|
2685
|
+
{ name: "environment_id", description: descEnvironmentId, required: true },
|
|
2616
2686
|
{ name: "status", description: descK8sInfraStatus, enum: ["ACTIVE", "INACTIVE", "PENDING", "All"] },
|
|
2617
2687
|
{ name: "infra_type", description: descInfraType, enum: ["Kubernetes", "KubernetesV2", "Linux", "Windows", "CloudFoundry", "Container"] },
|
|
2618
2688
|
{ name: "include_legacy_infra", description: descIncludeLegacyInfra, type: "boolean" },
|
|
@@ -2647,9 +2717,25 @@ export const chaosToolset = {
|
|
|
2647
2717
|
},
|
|
2648
2718
|
get: {
|
|
2649
2719
|
method: "GET",
|
|
2650
|
-
path: `${CHAOS}/rest/
|
|
2720
|
+
path: `${CHAOS}/rest/v2/infrastructure/{identity}`,
|
|
2651
2721
|
operationPolicy: { risk: "read", retryPolicy: "safe" },
|
|
2652
|
-
|
|
2722
|
+
// Path value is the row's identity. Create allows infraID to differ.
|
|
2723
|
+
// identity wins when both are set. infra_id is only a fallback when identity was not sent.
|
|
2724
|
+
pathParams: { identity: "identity" },
|
|
2725
|
+
pathBuilder: (input) => {
|
|
2726
|
+
const id = input.identity ?? input.infra_id;
|
|
2727
|
+
if (!id) {
|
|
2728
|
+
throw new Error("Missing required field identity for chaos_k8s_infrastructure.get. " +
|
|
2729
|
+
"Pass the list row's identity as resource_id. Do not substitute infraID.");
|
|
2730
|
+
}
|
|
2731
|
+
return `${CHAOS}/rest/v2/infrastructure/${encodeURIComponent(String(id))}`;
|
|
2732
|
+
},
|
|
2733
|
+
queryParams: { environment_id: "environmentIdentifier" },
|
|
2734
|
+
paramsSchema: {
|
|
2735
|
+
fields: [
|
|
2736
|
+
{ name: "environment_id", required: true, description: "environmentID from the same list row. Pass as params.environment_id." },
|
|
2737
|
+
],
|
|
2738
|
+
},
|
|
2653
2739
|
responseExtractor: passthrough,
|
|
2654
2740
|
description: descGetK8sInfra,
|
|
2655
2741
|
},
|
|
@@ -2723,9 +2809,25 @@ export const chaosToolset = {
|
|
|
2723
2809
|
executeActions: {
|
|
2724
2810
|
check_health: {
|
|
2725
2811
|
method: "GET",
|
|
2812
|
+
// Published OpenAPI operationId testLegacyKubernetesChaosInfraConnection:
|
|
2813
|
+
// GET /rest/kubernetes/infra/{id}/health
|
|
2814
|
+
// (graphql/server/apidocs/all/openapi.yaml and rest_router.go
|
|
2815
|
+
// GET /kubernetes/infra/:id/health). There is no
|
|
2816
|
+
// /rest/kubernetes/infra/health/{id} route.
|
|
2817
|
+
// The segment is infraID. Create allows that to differ from identity.
|
|
2818
|
+
// harness_execute writes resource_id onto identity, so identity is the
|
|
2819
|
+
// fallback only when infra_id is omitted. When both are set, infraID wins.
|
|
2726
2820
|
path: `${CHAOS}/rest/kubernetes/infra/{infraId}/health`,
|
|
2727
2821
|
operationPolicy: { risk: "read", retryPolicy: "safe" },
|
|
2728
2822
|
pathParams: { infra_id: "infraId" },
|
|
2823
|
+
pathBuilder: (input) => {
|
|
2824
|
+
const id = optionalText(input.infra_id) ?? optionalText(input.identity);
|
|
2825
|
+
if (!id) {
|
|
2826
|
+
throw new Error("Missing required field infra_id for chaos_k8s_infrastructure.check_health. " +
|
|
2827
|
+
"Pass the list row's infraID as infra_id. resource_id (identity) is used only when infra_id is omitted.");
|
|
2828
|
+
}
|
|
2829
|
+
return `${CHAOS}/rest/kubernetes/infra/${encodeURIComponent(id)}/health`;
|
|
2830
|
+
},
|
|
2729
2831
|
responseExtractor: passthrough,
|
|
2730
2832
|
actionDescription: descCheckK8sHealth,
|
|
2731
2833
|
bodySchema: { description: descBodyNoBody, fields: [] },
|
|
@@ -2741,19 +2843,20 @@ export const chaosToolset = {
|
|
|
2741
2843
|
scope: "project",
|
|
2742
2844
|
scopeParams: CHAOS_SCOPE,
|
|
2743
2845
|
identifierFields: ["infra_id"],
|
|
2846
|
+
compactItem: compactK8sInfra,
|
|
2744
2847
|
diagnosticHint: "Returns only infrastructures that are ready to run chaos experiments (chaos-enabled AND ACTIVE). " +
|
|
2745
2848
|
"Empty result usually means no chaos infrastructure is installed/connected for this project/environment yet — " +
|
|
2746
|
-
"register/connect one
|
|
2849
|
+
"register/connect one. chaos_k8s_infrastructure lists every status in one environment and requires filters.environment_id.",
|
|
2747
2850
|
relatedResources: [
|
|
2748
2851
|
{
|
|
2749
2852
|
resourceType: "chaos_k8s_infrastructure",
|
|
2750
2853
|
relationship: "alternative",
|
|
2751
|
-
description: "
|
|
2854
|
+
description: "One environment, including infrastructures that are not ready to run an experiment, plus get and check_health. filters.environment_id is required: an empty environment returns HTTP 500 missing envID. This is not a project-wide inventory. Use chaos_enabled_infrastructure when no environment is known.",
|
|
2752
2855
|
},
|
|
2753
2856
|
{
|
|
2754
2857
|
resourceType: "chaos_experiment",
|
|
2755
2858
|
relationship: "used_by",
|
|
2756
|
-
description: "
|
|
2859
|
+
description: "Launch uses environmentID/infraID from this list as infra_ref. A bare infraID is not enough.",
|
|
2757
2860
|
},
|
|
2758
2861
|
],
|
|
2759
2862
|
listFilterFields: [
|
|
@@ -3128,7 +3231,7 @@ export const chaosToolset = {
|
|
|
3128
3231
|
description: "No body required. Fault template identified by path parameter.",
|
|
3129
3232
|
fields: [
|
|
3130
3233
|
{ name: "template_identity", type: "string", required: true, description: descTemplateIdentity },
|
|
3131
|
-
{ name: "hub_identity", type: "string", required:
|
|
3234
|
+
{ name: "hub_identity", type: "string", required: false, description: descHubIdentity },
|
|
3132
3235
|
],
|
|
3133
3236
|
},
|
|
3134
3237
|
},
|