-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathresources.ts
More file actions
51 lines (45 loc) · 1.9 KB
/
resources.ts
File metadata and controls
51 lines (45 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { ClusterApi } from '@shell/apis/intf/resources-api/cluster-api';
import { MgmtApi } from '@shell/apis/intf/resources-api/mgmt-api';
export * from '@shell/apis/intf/resources-api/resources-api';
export * from '@shell/apis/intf/resources-api/cluster-api';
export * from '@shell/apis/intf/resources-api/mgmt-api';
export {
ResourceType, CreateResourceData, FindMethodOptions, FindAllMethodOptions, FindFilteredPageOptions, FindFilteredLabelSelectorOptions,
FindFilteredPageResponse, FindFilteredLabelSelectorResponse
} from '@shell/apis/intf/resources-api/resource-base';
export * from '@shell/apis/intf/resources-api/resource-constants';
export * from '@shell/apis/intf/resources-api/resource-instance';
export { SteveGetResponse, SteveListResponse } from '@shell/types/rancher/steve.api';
export { KubeLabelSelector, KubeLabelSelectorExpression } from '@shell/types/kube/kube-api';
export {
PaginationSort, PaginationParamFilter, PaginationParamProjectOrNamespace, PaginationFilterField
} from '@shell/types/store/pagination.types';
/**
* @internal
* Top-level provider that exposes scoped resource API instances.
*
* @example
* ```ts
* import { useResources, K8S } from '@shell/apis';
*
* const resources = useResources();
*
* // Cluster-scoped resources (current cluster context)
* const pod = await resources.cluster.find(K8S.POD, 'default/my-pod-123');
*
* // Management/global resources
* const user = await resources.mgmt.find(K8S.USER, 'u-xyz789');
* ```
*/
export interface ResourcesApiProvider {
/**
* Provides access to the Cluster API which can be used for managing Kubernetes cluster resources.
* This includes Kubernetes native resources like Pods, Deployments, Services, etc.
*/
get cluster(): ClusterApi;
/**
* Provides access to the Management layer in Rancher UI.
* This includes global resources like Users, Clusters, Global Settings, etc.
*/
get mgmt(): MgmtApi;
}