@stolostron/multicluster-sdk 0.6.1 → 0.7.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.
- package/README.md +167 -88
- package/lib/api/constants.d.ts +1 -0
- package/lib/api/constants.d.ts.map +1 -1
- package/lib/api/constants.js +2 -1
- package/lib/api/constants.js.map +1 -1
- package/lib/api/getFleetK8sAPIPath.d.ts.map +1 -1
- package/lib/api/getFleetK8sAPIPath.js +1 -2
- package/lib/api/getFleetK8sAPIPath.js.map +1 -1
- package/lib/api/index.d.ts +0 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js +0 -1
- package/lib/api/index.js.map +1 -1
- package/lib/api/useFleetClusterNames.d.ts +47 -2
- package/lib/api/useFleetClusterNames.d.ts.map +1 -1
- package/lib/api/useFleetClusterNames.js +65 -5
- package/lib/api/useFleetClusterNames.js.map +1 -1
- package/lib/api/useFleetK8sAPIPath.d.ts +1 -2
- package/lib/api/useFleetK8sAPIPath.d.ts.map +1 -1
- package/lib/api/useFleetK8sAPIPath.js +5 -6
- package/lib/api/useFleetK8sAPIPath.js.map +1 -1
- package/lib/api/useFleetK8sWatchResource.d.ts +3 -2
- package/lib/api/useFleetK8sWatchResource.d.ts.map +1 -1
- package/lib/api/useFleetK8sWatchResource.js +5 -6
- package/lib/api/useFleetK8sWatchResource.js.map +1 -1
- package/lib/api/useFleetPrometheusPoll.d.ts +3 -5
- package/lib/api/useFleetPrometheusPoll.d.ts.map +1 -1
- package/lib/api/useFleetPrometheusPoll.js +1 -2
- package/lib/api/useFleetPrometheusPoll.js.map +1 -1
- package/lib/api/useFleetSearchPoll.d.ts +3 -2
- package/lib/api/useFleetSearchPoll.d.ts.map +1 -1
- package/lib/api/useFleetSearchPoll.js +81 -7
- package/lib/api/useFleetSearchPoll.js.map +1 -1
- package/lib/api/useHubClusterName.d.ts +1 -2
- package/lib/api/useHubClusterName.d.ts.map +1 -1
- package/lib/api/useHubClusterName.js +5 -3
- package/lib/api/useHubClusterName.js.map +1 -1
- package/lib/api/useIsFleetAvailable.d.ts +1 -2
- package/lib/api/useIsFleetAvailable.d.ts.map +1 -1
- package/lib/api/useIsFleetAvailable.js +3 -4
- package/lib/api/useIsFleetAvailable.js.map +1 -1
- package/lib/api/useIsFleetObservabilityInstalled.d.ts +5 -2
- package/lib/api/useIsFleetObservabilityInstalled.d.ts.map +1 -1
- package/lib/api/useIsFleetObservabilityInstalled.js +5 -3
- package/lib/api/useIsFleetObservabilityInstalled.js.map +1 -1
- package/lib/components/FleetResourceEventStream.d.ts +2 -4
- package/lib/components/FleetResourceEventStream.d.ts.map +1 -1
- package/lib/components/FleetResourceEventStream.js.map +1 -1
- package/lib/components/FleetResourceLink.d.ts +53 -0
- package/lib/components/FleetResourceLink.d.ts.map +1 -0
- package/lib/components/FleetResourceLink.js +161 -0
- package/lib/components/FleetResourceLink.js.map +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/extensions/index.d.ts +2 -0
- package/lib/extensions/index.d.ts.map +1 -0
- package/lib/extensions/index.js +3 -0
- package/lib/extensions/index.js.map +1 -0
- package/lib/extensions/resource.d.ts +25 -0
- package/lib/extensions/resource.d.ts.map +1 -0
- package/lib/extensions/resource.js +3 -0
- package/lib/extensions/resource.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/internal/apiRequests.js +1 -1
- package/lib/internal/apiRequests.js.map +1 -1
- package/lib/internal/cachedHubConfiguration.js +2 -2
- package/lib/internal/cachedHubConfiguration.js.map +1 -1
- package/lib/internal/constants.d.ts +1 -0
- package/lib/internal/constants.d.ts.map +1 -1
- package/lib/internal/constants.js +2 -1
- package/lib/internal/constants.js.map +1 -1
- package/lib/internal/requirements.d.ts +3 -0
- package/lib/internal/requirements.d.ts.map +1 -0
- package/lib/{api/utils → internal}/requirements.js +5 -8
- package/lib/internal/requirements.js.map +1 -0
- package/lib/internal/resourceRouteUtils.d.ts +38 -0
- package/lib/internal/resourceRouteUtils.d.ts.map +1 -0
- package/lib/internal/resourceRouteUtils.js +68 -0
- package/lib/internal/resourceRouteUtils.js.map +1 -0
- package/lib/internal/search/search-client.js +2 -2
- package/lib/internal/search/search-client.js.map +1 -1
- package/lib/internal/search/searchPaths.d.ts.map +1 -0
- package/lib/internal/search/searchPaths.js.map +1 -0
- package/lib/internal/useHubConfigurationItem.js +2 -2
- package/lib/internal/useHubConfigurationItem.js.map +1 -1
- package/lib/internal/useURLPoll.d.ts +1 -3
- package/lib/internal/useURLPoll.d.ts.map +1 -1
- package/lib/internal/useURLPoll.js +9 -13
- package/lib/internal/useURLPoll.js.map +1 -1
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/types/fleet.d.ts +4 -19
- package/lib/types/fleet.d.ts.map +1 -1
- package/lib/types/search.d.ts +2 -1
- package/lib/types/search.d.ts.map +1 -1
- package/package.json +5 -2
- package/lib/api/FleetResourceLink.d.ts +0 -4
- package/lib/api/FleetResourceLink.d.ts.map +0 -1
- package/lib/api/FleetResourceLink.js +0 -49
- package/lib/api/FleetResourceLink.js.map +0 -1
- package/lib/api/utils/requirements.d.ts +0 -6
- package/lib/api/utils/requirements.d.ts.map +0 -1
- package/lib/api/utils/requirements.js.map +0 -1
- package/lib/api/utils/searchPaths.d.ts.map +0 -1
- package/lib/api/utils/searchPaths.js.map +0 -1
- /package/lib/{api/utils → internal/search}/searchPaths.d.ts +0 -0
- /package/lib/{api/utils → internal/search}/searchPaths.js +0 -0
package/README.md
CHANGED
|
@@ -277,7 +277,7 @@ Returns:
|
|
|
277
277
|
A promise that resolves to the response of the resource updated.
|
|
278
278
|
In case of failure promise gets rejected with HTTP error response.
|
|
279
279
|
|
|
280
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/fleetK8sUpdate.ts#
|
|
280
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/fleetK8sUpdate.ts#L29)
|
|
281
281
|
|
|
282
282
|
### :gear: FleetResourceEventStream
|
|
283
283
|
|
|
@@ -291,7 +291,7 @@ it falls back to the standard OpenShift console ResourceEventStream component.
|
|
|
291
291
|
|
|
292
292
|
| Function | Type |
|
|
293
293
|
| ---------- | ---------- |
|
|
294
|
-
| `FleetResourceEventStream` | `FC<
|
|
294
|
+
| `FleetResourceEventStream` | `FC<FleetResourceEventStreamProps>` |
|
|
295
295
|
|
|
296
296
|
Parameters:
|
|
297
297
|
|
|
@@ -336,11 +336,62 @@ Examples:
|
|
|
336
336
|
|
|
337
337
|
### :gear: FleetResourceLink
|
|
338
338
|
|
|
339
|
+
Enhanced ResourceLink component for ACM fleet environments.
|
|
340
|
+
|
|
341
|
+
Unlike the standard OpenShift ResourceLink which always links to the OpenShift console,
|
|
342
|
+
FleetResourceLink provides intelligent routing based on cluster context:
|
|
343
|
+
- First-class ACM resources (ManagedCluster) get direct links in all cases
|
|
344
|
+
- For hub clusters: Extension-based routing first, then fallback to OpenShift console
|
|
345
|
+
- For managed clusters: Extension-based routing first, then fallback to ACM search results
|
|
346
|
+
|
|
347
|
+
This prevents users from having to jump between different consoles when managing
|
|
348
|
+
multi-cluster resources.
|
|
349
|
+
|
|
339
350
|
| Function | Type |
|
|
340
351
|
| ---------- | ---------- |
|
|
341
352
|
| `FleetResourceLink` | `React.FC<FleetResourceLinkProps>` |
|
|
342
353
|
|
|
343
|
-
|
|
354
|
+
Parameters:
|
|
355
|
+
|
|
356
|
+
* `props`: - FleetResourceLinkProps extending ResourceLinkProps with cluster information
|
|
357
|
+
* `props.cluster`: - the target cluster name for the resource
|
|
358
|
+
* `props.groupVersionKind`: - K8s GroupVersionKind for the resource
|
|
359
|
+
* `props.name`: - the resource name
|
|
360
|
+
* `props.namespace`: - the resource namespace (required for namespaced resources)
|
|
361
|
+
* `props.displayName`: - optional display name override
|
|
362
|
+
* `props.className`: - additional CSS classes
|
|
363
|
+
* `props.inline`: - whether to display inline
|
|
364
|
+
* `props.hideIcon`: - whether to hide the resource icon
|
|
365
|
+
* `props.children`: - additional content to render
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
Examples:
|
|
369
|
+
|
|
370
|
+
```typescript
|
|
371
|
+
// Hub cluster VirtualMachine - routes to ACM VM page via extension system
|
|
372
|
+
<FleetResourceLink
|
|
373
|
+
name="my-vm"
|
|
374
|
+
namespace="default"
|
|
375
|
+
groupVersionKind={{ group: 'kubevirt.io', version: 'v1', kind: 'VirtualMachine' }}
|
|
376
|
+
/>
|
|
377
|
+
|
|
378
|
+
// Managed cluster VirtualMachine - routes to ACM search results
|
|
379
|
+
<FleetResourceLink
|
|
380
|
+
name="remote-vm"
|
|
381
|
+
namespace="default"
|
|
382
|
+
cluster="prod-cluster"
|
|
383
|
+
groupVersionKind={{ group: 'kubevirt.io', version: 'v1', kind: 'VirtualMachine' }}
|
|
384
|
+
/>
|
|
385
|
+
|
|
386
|
+
// ManagedCluster resource (lives on hub) - cluster prop omitted
|
|
387
|
+
<FleetResourceLink
|
|
388
|
+
name="prod-cluster"
|
|
389
|
+
groupVersionKind={{ group: 'cluster.open-cluster-management.io', version: 'v1', kind: 'ManagedCluster' }}
|
|
390
|
+
/>
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/components/FleetResourceLink.tsx#L61)
|
|
344
395
|
|
|
345
396
|
### :gear: getFleetK8sAPIPath
|
|
346
397
|
|
|
@@ -359,7 +410,7 @@ Returns:
|
|
|
359
410
|
|
|
360
411
|
The k8s API path for the fleet.
|
|
361
412
|
|
|
362
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/getFleetK8sAPIPath.ts#
|
|
413
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/getFleetK8sAPIPath.ts#L13)
|
|
363
414
|
|
|
364
415
|
### :gear: useFleetAccessReview
|
|
365
416
|
|
|
@@ -389,11 +440,63 @@ Array with `isAllowed` and `loading` values.
|
|
|
389
440
|
|
|
390
441
|
### :gear: useFleetClusterNames
|
|
391
442
|
|
|
443
|
+
Hook that returns names of managed clusters with optional filtering by cluster proxy addon and availability status.
|
|
444
|
+
|
|
445
|
+
This hook watches ManagedCluster resources and by default filters them to only include clusters
|
|
446
|
+
that have both the label `feature.open-cluster-management.io/addon-cluster-proxy: available` AND
|
|
447
|
+
the condition `ManagedClusterConditionAvailable` with status `True`.
|
|
448
|
+
|
|
392
449
|
| Function | Type |
|
|
393
450
|
| ---------- | ---------- |
|
|
394
|
-
| `useFleetClusterNames` | `
|
|
451
|
+
| `useFleetClusterNames` | `(returnAllClusters?: boolean) => [string[], boolean, any]` |
|
|
452
|
+
|
|
453
|
+
Parameters:
|
|
454
|
+
|
|
455
|
+
* `returnAllClusters`: - Optional boolean to return all cluster names regardless of labels and conditions.
|
|
456
|
+
Defaults to false. When false (default), only returns clusters with the
|
|
457
|
+
'feature.open-cluster-management.io/addon-cluster-proxy: available' label AND
|
|
458
|
+
'ManagedClusterConditionAvailable' status: 'True'.
|
|
459
|
+
When true, returns all cluster names regardless of labels and conditions.
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
Returns:
|
|
463
|
+
|
|
464
|
+
A tuple containing:
|
|
465
|
+
- clusterNames: Array of cluster names (filtered by default, or all clusters if specified)
|
|
466
|
+
- loaded: Boolean indicating if the resource watch has loaded
|
|
467
|
+
- error: Any error that occurred during the watch operation
|
|
468
|
+
|
|
469
|
+
Examples:
|
|
470
|
+
|
|
471
|
+
```tsx
|
|
472
|
+
// Get only clusters with cluster proxy addon available AND ManagedClusterConditionAvailable: 'True' (default behavior)
|
|
473
|
+
const [availableClusterNames, loaded, error] = useFleetClusterNames()
|
|
474
|
+
|
|
475
|
+
// Get all cluster names regardless of labels and conditions
|
|
476
|
+
const [allClusterNames, loaded, error] = useFleetClusterNames(true)
|
|
395
477
|
|
|
396
|
-
|
|
478
|
+
// Explicitly filter by cluster proxy addon and availability (same as default)
|
|
479
|
+
const [filteredClusterNames, loaded, error] = useFleetClusterNames(false)
|
|
480
|
+
|
|
481
|
+
if (!loaded) {
|
|
482
|
+
return <Loading />
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
if (error) {
|
|
486
|
+
return <ErrorState error={error} />
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
return (
|
|
490
|
+
<div>
|
|
491
|
+
{availableClusterNames.map(name => (
|
|
492
|
+
<div key={name}>{name}</div>
|
|
493
|
+
))}
|
|
494
|
+
</div>
|
|
495
|
+
)
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useFleetClusterNames.ts#L56)
|
|
397
500
|
|
|
398
501
|
### :gear: useFleetK8sAPIPath
|
|
399
502
|
|
|
@@ -401,7 +504,7 @@ Hook that provides the k8s API path for the fleet.
|
|
|
401
504
|
|
|
402
505
|
| Function | Type |
|
|
403
506
|
| ---------- | ---------- |
|
|
404
|
-
| `useFleetK8sAPIPath` | `
|
|
507
|
+
| `useFleetK8sAPIPath` | `(cluster?: string or undefined) => [k8sAPIPath: string or undefined, loaded: boolean, error: Error or undefined]` |
|
|
405
508
|
|
|
406
509
|
Parameters:
|
|
407
510
|
|
|
@@ -412,7 +515,7 @@ Returns:
|
|
|
412
515
|
|
|
413
516
|
Array with `k8sAPIPath`, `loaded` and `error` values.
|
|
414
517
|
|
|
415
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useFleetK8sAPIPath.ts#
|
|
518
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useFleetK8sAPIPath.ts#L11)
|
|
416
519
|
|
|
417
520
|
### :gear: useFleetK8sWatchResource
|
|
418
521
|
|
|
@@ -426,7 +529,7 @@ and remote clusters using WebSocket connections for real-time updates.
|
|
|
426
529
|
|
|
427
530
|
| Function | Type |
|
|
428
531
|
| ---------- | ---------- |
|
|
429
|
-
| `useFleetK8sWatchResource` | `
|
|
532
|
+
| `useFleetK8sWatchResource` | `<R extends FleetK8sResourceCommon or FleetK8sResourceCommon[]>(initResource: FleetWatchK8sResource or null) => WatchK8sResult<R> or [undefined, boolean, any]` |
|
|
430
533
|
|
|
431
534
|
Parameters:
|
|
432
535
|
|
|
@@ -459,15 +562,15 @@ const [deployment, loaded, error] = useFleetK8sWatchResource({
|
|
|
459
562
|
```
|
|
460
563
|
|
|
461
564
|
|
|
462
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useFleetK8sWatchResource.ts#
|
|
565
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useFleetK8sWatchResource.ts#L55)
|
|
463
566
|
|
|
464
567
|
### :gear: useFleetPrometheusPoll
|
|
465
568
|
|
|
466
569
|
| Function | Type |
|
|
467
570
|
| ---------- | ---------- |
|
|
468
|
-
| `useFleetPrometheusPoll` | `
|
|
571
|
+
| `useFleetPrometheusPoll` | `(props: PrometheusPollProps and { cluster?: string or undefined; } and { allClusters?: boolean or undefined; }) => [response: PrometheusResponse or undefined, loaded: boolean, error: unknown]` |
|
|
469
572
|
|
|
470
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useFleetPrometheusPoll.ts#
|
|
573
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useFleetPrometheusPoll.ts#L9)
|
|
471
574
|
|
|
472
575
|
### :gear: useFleetSearchPoll
|
|
473
576
|
|
|
@@ -475,7 +578,7 @@ A React hook that provides fleet-wide search functionality using the ACM search
|
|
|
475
578
|
|
|
476
579
|
| Function | Type |
|
|
477
580
|
| ---------- | ---------- |
|
|
478
|
-
| `useFleetSearchPoll` | `
|
|
581
|
+
| `useFleetSearchPoll` | `<T extends K8sResourceCommon or K8sResourceCommon[]>(watchOptions: WatchK8sResource, advancedSearchFilters?: AdvancedSearchFilter or undefined, pollInterval?: number or ... 1 more ... or undefined) => [...]` |
|
|
479
582
|
|
|
480
583
|
Parameters:
|
|
481
584
|
|
|
@@ -535,7 +638,7 @@ const [services, loaded, error] = useFleetSearchPoll({
|
|
|
535
638
|
```
|
|
536
639
|
|
|
537
640
|
|
|
538
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useFleetSearchPoll.ts#
|
|
641
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useFleetSearchPoll.ts#L92)
|
|
539
642
|
|
|
540
643
|
### :gear: useHubClusterName
|
|
541
644
|
|
|
@@ -543,13 +646,13 @@ Hook that provides hub cluster name.
|
|
|
543
646
|
|
|
544
647
|
| Function | Type |
|
|
545
648
|
| ---------- | ---------- |
|
|
546
|
-
| `useHubClusterName` | `
|
|
649
|
+
| `useHubClusterName` | `() => [hubClusterName: string or undefined, loaded: boolean, error: any]` |
|
|
547
650
|
|
|
548
651
|
Returns:
|
|
549
652
|
|
|
550
653
|
Array with `hubclustername`, `loaded` and `error` values.
|
|
551
654
|
|
|
552
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useHubClusterName.ts#
|
|
655
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useHubClusterName.ts#L9)
|
|
553
656
|
|
|
554
657
|
### :gear: useIsFleetAvailable
|
|
555
658
|
|
|
@@ -561,13 +664,13 @@ required by this version of the multicluster SDK.
|
|
|
561
664
|
|
|
562
665
|
| Function | Type |
|
|
563
666
|
| ---------- | ---------- |
|
|
564
|
-
| `useIsFleetAvailable` | `
|
|
667
|
+
| `useIsFleetAvailable` | `() => boolean` |
|
|
565
668
|
|
|
566
669
|
Returns:
|
|
567
670
|
|
|
568
671
|
`true` if a version of Red Hat Advanced Cluster Management that is compatible with the multicluster SDK is available; `false` otherwise
|
|
569
672
|
|
|
570
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useIsFleetAvailable.ts#
|
|
673
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useIsFleetAvailable.ts#L14)
|
|
571
674
|
|
|
572
675
|
### :gear: useIsFleetObservabilityInstalled
|
|
573
676
|
|
|
@@ -575,18 +678,19 @@ Hook that provides is observability installed.
|
|
|
575
678
|
|
|
576
679
|
| Function | Type |
|
|
577
680
|
| ---------- | ---------- |
|
|
578
|
-
| `useIsFleetObservabilityInstalled` | `
|
|
681
|
+
| `useIsFleetObservabilityInstalled` | `() => [isObservabilityInstalled: boolean or undefined, loaded: boolean, error: unknown]` |
|
|
579
682
|
|
|
580
683
|
Returns:
|
|
581
684
|
|
|
582
685
|
Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
583
686
|
|
|
584
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useIsFleetObservabilityInstalled.ts#
|
|
687
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/useIsFleetObservabilityInstalled.ts#L9)
|
|
585
688
|
|
|
586
689
|
|
|
587
690
|
## :wrench: Constants
|
|
588
691
|
|
|
589
692
|
- [REQUIRED_PROVIDER_FLAG](#gear-required_provider_flag)
|
|
693
|
+
- [RESOURCE_ROUTE_TYPE](#gear-resource_route_type)
|
|
590
694
|
|
|
591
695
|
### :gear: REQUIRED_PROVIDER_FLAG
|
|
592
696
|
|
|
@@ -596,6 +700,14 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
596
700
|
|
|
597
701
|
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/constants.ts#L2)
|
|
598
702
|
|
|
703
|
+
### :gear: RESOURCE_ROUTE_TYPE
|
|
704
|
+
|
|
705
|
+
| Constant | Type |
|
|
706
|
+
| ---------- | ---------- |
|
|
707
|
+
| `RESOURCE_ROUTE_TYPE` | `"acm.resource/route"` |
|
|
708
|
+
|
|
709
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/api/constants.ts#L3)
|
|
710
|
+
|
|
599
711
|
|
|
600
712
|
|
|
601
713
|
## :cocktail: Types
|
|
@@ -609,16 +721,13 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
609
721
|
- [FleetK8sListOptions](#gear-fleetk8slistoptions)
|
|
610
722
|
- [FleetK8sPatchOptions](#gear-fleetk8spatchoptions)
|
|
611
723
|
- [FleetK8sResourceCommon](#gear-fleetk8sresourcecommon)
|
|
724
|
+
- [FleetResourceEventStreamProps](#gear-fleetresourceeventstreamprops)
|
|
612
725
|
- [FleetResourceLinkProps](#gear-fleetresourcelinkprops)
|
|
613
726
|
- [FleetWatchK8sResource](#gear-fleetwatchk8sresource)
|
|
727
|
+
- [ResourceRoute](#gear-resourceroute)
|
|
728
|
+
- [ResourceRouteHandler](#gear-resourceroutehandler)
|
|
729
|
+
- [ResourceRouteProps](#gear-resourcerouteprops)
|
|
614
730
|
- [SearchResult](#gear-searchresult)
|
|
615
|
-
- [UseFleetClusterNames](#gear-usefleetclusternames)
|
|
616
|
-
- [UseFleetK8sAPIPath](#gear-usefleetk8sapipath)
|
|
617
|
-
- [UseFleetK8sWatchResource](#gear-usefleetk8swatchresource)
|
|
618
|
-
- [UseFleetSearchPoll](#gear-usefleetsearchpoll)
|
|
619
|
-
- [UseHubClusterName](#gear-usehubclustername)
|
|
620
|
-
- [UseIsFleetAvailable](#gear-useisfleetavailable)
|
|
621
|
-
- [UseIsFleetObservabilityInstalled](#gear-useisfleetobservabilityinstalled)
|
|
622
731
|
|
|
623
732
|
### :gear: AdvancedSearchFilter
|
|
624
733
|
|
|
@@ -626,7 +735,7 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
626
735
|
| ---------- | ---------- |
|
|
627
736
|
| `AdvancedSearchFilter` | `{ property: string; values: string[] }[]` |
|
|
628
737
|
|
|
629
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/search.ts#
|
|
738
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/search.ts#L9)
|
|
630
739
|
|
|
631
740
|
### :gear: Fleet
|
|
632
741
|
|
|
@@ -634,7 +743,7 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
634
743
|
| ---------- | ---------- |
|
|
635
744
|
| `Fleet` | `T and { cluster?: string }` |
|
|
636
745
|
|
|
637
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#
|
|
746
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L12)
|
|
638
747
|
|
|
639
748
|
### :gear: FleetAccessReviewResourceAttributes
|
|
640
749
|
|
|
@@ -642,7 +751,7 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
642
751
|
| ---------- | ---------- |
|
|
643
752
|
| `FleetAccessReviewResourceAttributes` | `Fleet<AccessReviewResourceAttributes>` |
|
|
644
753
|
|
|
645
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#
|
|
754
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L16)
|
|
646
755
|
|
|
647
756
|
### :gear: FleetK8sCreateUpdateOptions
|
|
648
757
|
|
|
@@ -650,7 +759,7 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
650
759
|
| ---------- | ---------- |
|
|
651
760
|
| `FleetK8sCreateUpdateOptions` | `{ model: K8sModel name?: string ns?: string path?: string cluster?: string queryParams?: QueryParams data: R }` |
|
|
652
761
|
|
|
653
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#
|
|
762
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L21)
|
|
654
763
|
|
|
655
764
|
### :gear: FleetK8sDeleteOptions
|
|
656
765
|
|
|
@@ -658,7 +767,7 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
658
767
|
| ---------- | ---------- |
|
|
659
768
|
| `FleetK8sDeleteOptions` | `{ model: K8sModel name?: string ns?: string path?: string cluster?: string queryParams?: QueryParams resource: R requestInit?: RequestInit json?: Record<string, any> }` |
|
|
660
769
|
|
|
661
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#
|
|
770
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L52)
|
|
662
771
|
|
|
663
772
|
### :gear: FleetK8sGetOptions
|
|
664
773
|
|
|
@@ -666,7 +775,7 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
666
775
|
| ---------- | ---------- |
|
|
667
776
|
| `FleetK8sGetOptions` | `{ model: K8sModel name?: string ns?: string path?: string cluster?: string queryParams?: QueryParams requestInit?: RequestInit }` |
|
|
668
777
|
|
|
669
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#
|
|
778
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L31)
|
|
670
779
|
|
|
671
780
|
### :gear: FleetK8sListOptions
|
|
672
781
|
|
|
@@ -674,7 +783,7 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
674
783
|
| ---------- | ---------- |
|
|
675
784
|
| `FleetK8sListOptions` | `{ model: K8sModel queryParams: { [key: string]: any } requestInit?: RequestInit }` |
|
|
676
785
|
|
|
677
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#
|
|
786
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L64)
|
|
678
787
|
|
|
679
788
|
### :gear: FleetK8sPatchOptions
|
|
680
789
|
|
|
@@ -682,7 +791,7 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
682
791
|
| ---------- | ---------- |
|
|
683
792
|
| `FleetK8sPatchOptions` | `{ model: K8sModel name?: string ns?: string path?: string cluster?: string queryParams?: QueryParams resource: R data: Patch[] }` |
|
|
684
793
|
|
|
685
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#
|
|
794
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L41)
|
|
686
795
|
|
|
687
796
|
### :gear: FleetK8sResourceCommon
|
|
688
797
|
|
|
@@ -690,95 +799,65 @@ Array with `isObservabilityInstalled`, `loaded` and `error` values.
|
|
|
690
799
|
| ---------- | ---------- |
|
|
691
800
|
| `FleetK8sResourceCommon` | `Fleet<K8sResourceCommon>` |
|
|
692
801
|
|
|
693
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#
|
|
694
|
-
|
|
695
|
-
### :gear: FleetResourceLinkProps
|
|
696
|
-
|
|
697
|
-
| Type | Type |
|
|
698
|
-
| ---------- | ---------- |
|
|
699
|
-
| `FleetResourceLinkProps` | `Fleet<ResourceLinkProps>` |
|
|
700
|
-
|
|
701
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L24)
|
|
702
|
-
|
|
703
|
-
### :gear: FleetWatchK8sResource
|
|
704
|
-
|
|
705
|
-
| Type | Type |
|
|
706
|
-
| ---------- | ---------- |
|
|
707
|
-
| `FleetWatchK8sResource` | `Fleet<WatchK8sResource>` |
|
|
708
|
-
|
|
709
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L16)
|
|
802
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L15)
|
|
710
803
|
|
|
711
|
-
### :gear:
|
|
804
|
+
### :gear: FleetResourceEventStreamProps
|
|
712
805
|
|
|
713
806
|
| Type | Type |
|
|
714
807
|
| ---------- | ---------- |
|
|
715
|
-
| `
|
|
808
|
+
| `FleetResourceEventStreamProps` | `{ resource: FleetK8sResourceCommon }` |
|
|
716
809
|
|
|
717
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/
|
|
810
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L19)
|
|
718
811
|
|
|
719
|
-
### :gear:
|
|
812
|
+
### :gear: FleetResourceLinkProps
|
|
720
813
|
|
|
721
814
|
| Type | Type |
|
|
722
815
|
| ---------- | ---------- |
|
|
723
|
-
| `
|
|
816
|
+
| `FleetResourceLinkProps` | `Fleet<ResourceLinkProps>` |
|
|
724
817
|
|
|
725
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#
|
|
818
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L18)
|
|
726
819
|
|
|
727
|
-
### :gear:
|
|
820
|
+
### :gear: FleetWatchK8sResource
|
|
728
821
|
|
|
729
822
|
| Type | Type |
|
|
730
823
|
| ---------- | ---------- |
|
|
731
|
-
| `
|
|
732
|
-
|
|
733
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L21)
|
|
734
|
-
|
|
735
|
-
### :gear: UseFleetK8sWatchResource
|
|
824
|
+
| `FleetWatchK8sResource` | `Fleet<WatchK8sResource>` |
|
|
736
825
|
|
|
737
|
-
|
|
738
|
-
| ---------- | ---------- |
|
|
739
|
-
| `UseFleetK8sWatchResource` | `<R extends FleetK8sResourceCommon or FleetK8sResourceCommon[]>( initResource: FleetWatchK8sResource or null ) => WatchK8sResult<R> or [undefined, boolean, any]` |
|
|
826
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L14)
|
|
740
827
|
|
|
741
|
-
|
|
828
|
+
### :gear: ResourceRoute
|
|
742
829
|
|
|
743
|
-
|
|
830
|
+
This extension allows plugins to customize the route used for resources of the given kind. Search results and resource links will direct to the route returned by the implementing function.
|
|
744
831
|
|
|
745
832
|
| Type | Type |
|
|
746
833
|
| ---------- | ---------- |
|
|
747
|
-
| `
|
|
834
|
+
| `ResourceRoute` | `ExtensionDeclaration<typeof RESOURCE_ROUTE_TYPE, ResourceRouteProps>` |
|
|
748
835
|
|
|
749
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/
|
|
836
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/extensions/resource.ts#L28)
|
|
750
837
|
|
|
751
|
-
### :gear:
|
|
838
|
+
### :gear: ResourceRouteHandler
|
|
752
839
|
|
|
753
840
|
| Type | Type |
|
|
754
841
|
| ---------- | ---------- |
|
|
755
|
-
| `
|
|
756
|
-
|
|
757
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L20)
|
|
842
|
+
| `ResourceRouteHandler` | `(props: { /** The cluster where the resource is located. */ cluster: string /** The namespace where the resource is located (if the resource is namespace-scoped). */ namespace?: string /** The name of the resource. */ name: string /** The resource, augmented with cluster property. */ resource: FleetK8sResourceCommon /** The model for the resource. */ model: ExtensionK8sModel }) => string` |
|
|
758
843
|
|
|
759
|
-
|
|
844
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/extensions/resource.ts#L7)
|
|
760
845
|
|
|
761
|
-
|
|
846
|
+
### :gear: ResourceRouteProps
|
|
762
847
|
|
|
763
848
|
| Type | Type |
|
|
764
849
|
| ---------- | ---------- |
|
|
765
|
-
| `
|
|
766
|
-
|
|
767
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/fleet.ts#L31)
|
|
850
|
+
| `ResourceRouteProps` | `{ /** The model for which this resource route should be used. */ model: ExtensionK8sGroupKindModel /** The handler function that returns the route path for the resource. */ handler: CodeRef<ResourceRouteHandler> }` |
|
|
768
851
|
|
|
769
|
-
|
|
852
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/extensions/resource.ts#L20)
|
|
770
853
|
|
|
771
|
-
|
|
854
|
+
### :gear: SearchResult
|
|
772
855
|
|
|
773
856
|
| Type | Type |
|
|
774
857
|
| ---------- | ---------- |
|
|
775
|
-
| `
|
|
776
|
-
|
|
777
|
-
Returns:
|
|
778
|
-
|
|
779
|
-
A tuple containing a boolean indicating if the observability controller is installed, a boolean indicating if loaded, and an error if any.
|
|
858
|
+
| `SearchResult` | `R extends (infer T)[] ? Fleet<T>[] : Fleet<R>` |
|
|
780
859
|
|
|
781
|
-
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/
|
|
860
|
+
[:link: Source](https://github.com/stolostron/console/blob/main/frontend/packages/multicluster-sdk/tree/../src/types/search.ts#L5)
|
|
782
861
|
|
|
783
862
|
|
|
784
863
|
<!-- TSDOC_END -->
|
package/lib/api/constants.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/api/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,sBAAsB,gCAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/api/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,sBAAsB,gCAAgC,CAAA;AACnE,eAAO,MAAM,mBAAmB,uBAAuB,CAAA"}
|
package/lib/api/constants.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REQUIRED_PROVIDER_FLAG = void 0;
|
|
3
|
+
exports.RESOURCE_ROUTE_TYPE = exports.REQUIRED_PROVIDER_FLAG = void 0;
|
|
4
4
|
/* Copyright Contributors to the Open Cluster Management project */
|
|
5
5
|
exports.REQUIRED_PROVIDER_FLAG = 'MULTICLUSTER_SDK_PROVIDER_1';
|
|
6
|
+
exports.RESOURCE_ROUTE_TYPE = 'acm.resource/route';
|
|
6
7
|
//# sourceMappingURL=constants.js.map
|
package/lib/api/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/api/constants.ts"],"names":[],"mappings":";;;AAAA,mEAAmE;AACtD,QAAA,sBAAsB,GAAG,6BAA6B,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/api/constants.ts"],"names":[],"mappings":";;;AAAA,mEAAmE;AACtD,QAAA,sBAAsB,GAAG,6BAA6B,CAAA;AACtD,QAAA,mBAAmB,GAAG,oBAAoB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFleetK8sAPIPath.d.ts","sourceRoot":"","sources":["../../src/api/getFleetK8sAPIPath.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getFleetK8sAPIPath.d.ts","sourceRoot":"","sources":["../../src/api/getFleetK8sAPIPath.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AAEH,eAAO,MAAM,kBAAkB,GAAU,UAAU,MAAM,oBAMxD,CAAA"}
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getFleetK8sAPIPath = void 0;
|
|
13
13
|
/* Copyright Contributors to the Open Cluster Management project */
|
|
14
14
|
const constants_1 = require("../internal/constants");
|
|
15
|
-
const apiRequests_1 = require("../internal/apiRequests");
|
|
16
15
|
const isHubRequest_1 = require("../internal/isHubRequest");
|
|
17
16
|
/**
|
|
18
17
|
* Function that provides the k8s API path for the fleet.
|
|
@@ -25,7 +24,7 @@ const getFleetK8sAPIPath = (cluster) => __awaiter(void 0, void 0, void 0, functi
|
|
|
25
24
|
return constants_1.BASE_K8S_API_PATH;
|
|
26
25
|
}
|
|
27
26
|
else {
|
|
28
|
-
return `${
|
|
27
|
+
return `${constants_1.BACKEND_URL}/${constants_1.MANAGED_CLUSTER_API_PATH}/${cluster}`;
|
|
29
28
|
}
|
|
30
29
|
});
|
|
31
30
|
exports.getFleetK8sAPIPath = getFleetK8sAPIPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFleetK8sAPIPath.js","sourceRoot":"","sources":["../../src/api/getFleetK8sAPIPath.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mEAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"getFleetK8sAPIPath.js","sourceRoot":"","sources":["../../src/api/getFleetK8sAPIPath.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mEAAmE;AACnE,qDAAgG;AAEhG,2DAAuD;AAEvD;;;;;GAKG;AAEI,MAAM,kBAAkB,GAAG,CAAO,OAAgB,EAAE,EAAE;IAC3D,IAAI,MAAM,IAAA,2BAAY,EAAC,OAAO,CAAC,EAAE,CAAC;QAChC,OAAO,6BAAiB,CAAA;IAC1B,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,uBAAW,IAAI,oCAAwB,IAAI,OAAO,EAAE,CAAA;IAChE,CAAC;AACH,CAAC,CAAA,CAAA;AANY,QAAA,kBAAkB,sBAM9B"}
|
package/lib/api/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './fleetK8sGet';
|
|
|
5
5
|
export * from './fleetK8sList';
|
|
6
6
|
export * from './fleetK8sPatch';
|
|
7
7
|
export * from './fleetK8sUpdate';
|
|
8
|
-
export * from './FleetResourceLink';
|
|
9
8
|
export * from './useFleetAccessReview';
|
|
10
9
|
export * from './useFleetClusterNames';
|
|
11
10
|
export * from './useFleetK8sAPIPath';
|
package/lib/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oCAAoC,CAAA;AAClD,cAAc,sBAAsB,CAAA"}
|
package/lib/api/index.js
CHANGED
|
@@ -22,7 +22,6 @@ __exportStar(require("./fleetK8sGet"), exports);
|
|
|
22
22
|
__exportStar(require("./fleetK8sList"), exports);
|
|
23
23
|
__exportStar(require("./fleetK8sPatch"), exports);
|
|
24
24
|
__exportStar(require("./fleetK8sUpdate"), exports);
|
|
25
|
-
__exportStar(require("./FleetResourceLink"), exports);
|
|
26
25
|
__exportStar(require("./useFleetAccessReview"), exports);
|
|
27
26
|
__exportStar(require("./useFleetClusterNames"), exports);
|
|
28
27
|
__exportStar(require("./useFleetK8sAPIPath"), exports);
|
package/lib/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,8CAA2B;AAC3B,mDAAgC;AAChC,mDAAgC;AAChC,gDAA6B;AAC7B,iDAA8B;AAC9B,kDAA+B;AAC/B,mDAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,8CAA2B;AAC3B,mDAAgC;AAChC,mDAAgC;AAChC,gDAA6B;AAC7B,iDAA8B;AAC9B,kDAA+B;AAC/B,mDAAgC;AAChC,yDAAsC;AACtC,yDAAsC;AACtC,uDAAoC;AACpC,6DAA0C;AAC1C,2DAAwC;AACxC,uDAAoC;AACpC,sDAAmC;AACnC,wDAAqC;AACrC,qEAAkD;AAClD,uDAAoC"}
|
|
@@ -1,3 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Hook that returns names of managed clusters with optional filtering by cluster proxy addon and availability status.
|
|
3
|
+
*
|
|
4
|
+
* This hook watches ManagedCluster resources and by default filters them to only include clusters
|
|
5
|
+
* that have both the label `feature.open-cluster-management.io/addon-cluster-proxy: available` AND
|
|
6
|
+
* the condition `ManagedClusterConditionAvailable` with status `True`.
|
|
7
|
+
*
|
|
8
|
+
* @param returnAllClusters - Optional boolean to return all cluster names regardless of labels and conditions.
|
|
9
|
+
* Defaults to false. When false (default), only returns clusters with the
|
|
10
|
+
* 'feature.open-cluster-management.io/addon-cluster-proxy: available' label AND
|
|
11
|
+
* 'ManagedClusterConditionAvailable' status: 'True'.
|
|
12
|
+
* When true, returns all cluster names regardless of labels and conditions.
|
|
13
|
+
*
|
|
14
|
+
* @returns A tuple containing:
|
|
15
|
+
* - clusterNames: Array of cluster names (filtered by default, or all clusters if specified)
|
|
16
|
+
* - loaded: Boolean indicating if the resource watch has loaded
|
|
17
|
+
* - error: Any error that occurred during the watch operation
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // Get only clusters with cluster proxy addon available AND ManagedClusterConditionAvailable: 'True' (default behavior)
|
|
22
|
+
* const [availableClusterNames, loaded, error] = useFleetClusterNames()
|
|
23
|
+
*
|
|
24
|
+
* // Get all cluster names regardless of labels and conditions
|
|
25
|
+
* const [allClusterNames, loaded, error] = useFleetClusterNames(true)
|
|
26
|
+
*
|
|
27
|
+
* // Explicitly filter by cluster proxy addon and availability (same as default)
|
|
28
|
+
* const [filteredClusterNames, loaded, error] = useFleetClusterNames(false)
|
|
29
|
+
*
|
|
30
|
+
* if (!loaded) {
|
|
31
|
+
* return <Loading />
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* if (error) {
|
|
35
|
+
* return <ErrorState error={error} />
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* return (
|
|
39
|
+
* <div>
|
|
40
|
+
* {availableClusterNames.map(name => (
|
|
41
|
+
* <div key={name}>{name}</div>
|
|
42
|
+
* ))}
|
|
43
|
+
* </div>
|
|
44
|
+
* )
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function useFleetClusterNames(returnAllClusters?: boolean): [string[], boolean, any];
|
|
3
48
|
//# sourceMappingURL=useFleetClusterNames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFleetClusterNames.d.ts","sourceRoot":"","sources":["../../src/api/useFleetClusterNames.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFleetClusterNames.d.ts","sourceRoot":"","sources":["../../src/api/useFleetClusterNames.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,oBAAoB,CAAC,iBAAiB,GAAE,OAAe,GAAG,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,CAyBjG"}
|