Skip to content

Commit

Permalink
style(clusters): apply team reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
GermainBergeron committed Oct 22, 2019
1 parent 44d7a7a commit 7113b38
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/resources/Clusters/Cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class Cluster extends Resource {
static baseUrl = `/rest/organizations/${API.orgPlaceholder}/clusters`;

list() {
return this.api.get<ClusterStatusModel[]>(Cluster.baseUrl);
return this.api.get<ClusterModel[]>(Cluster.baseUrl);
}

listAgents(id: string) {
Expand Down
72 changes: 68 additions & 4 deletions src/resources/Clusters/ClusterInterfaces.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export interface ClusterResource {
id: string;
name: string;
createdDate?: number;
status: string;
status: 'QUEUED_TO_CREATE' | 'CREATING' | 'REMOVING' | 'UPGRADING' | 'PAUSED' | 'COMPLETED' | 'ERROR';
type: string;
numberOfRetries: number;
}

export interface ClusterStatusModel {
Expand All @@ -12,7 +14,67 @@ export interface ClusterStatusModel {
lastProvisioningCompletedDate?: number;
ongoing: boolean;
resources: ClusterResource[];
status: string;
retryScheduled: boolean;
status: 'ERROR' | 'HEALTHY';
}

export interface ClusterTopologyModel {
agents: ClusterTopologyAgentModel[];
crawlerDbConnectionString: string;
dpmDocUri: string;
indexDocUri: string;
indexers: ClusterIndexerModel[];
rabbitServerId: string;
secCacheJobUri: string;
secClusterSyncUri: string;
securityCaches: ClusterSecurityCacheModel[];
securityProviderDbConnectionString: string;
securityProviders: ClusterSecurityProviderModel[];
topologyId: string;
}

export interface ClusterTopologyAgentModel {
id: string;
machineSpec: ClusterMachineSpecModel;
storages: ClusterStorageSpecModel[];
}

export interface ClusterStorageSpecModel {
numberOfIops: number;
sizeInGibibytes: number;
sizeInGigabytes: number;
storageType: 'STANDARD' | 'SSD' | 'PROVISIONED_SSD';
}

export interface ClusterMachineSpecModel {
architecture: string;
storageSpec: ClusterStorageSpecModel;
}

export interface ClusterComponentModel {
adminPort: number;
adminUri: string;
agentId: string;
componentName: string;
componentPlatform: string;
componentVersion: string;
id: string;
name: string;
}

export interface ClusterIndexerModel extends ClusterComponentModel {
indexerDocUri: string;
searchPort: number;
searchServerUri: string;
}

export interface ClusterSecurityCacheModel extends ClusterComponentModel {
secCacheSyncUri: string;
}

export interface ClusterSecurityProviderModel extends ClusterComponentModel {
type: string;
useDefaultConfiguration: boolean;
}

export interface ClusterModel {
Expand All @@ -26,6 +88,7 @@ export interface ClusterModel {
securityCacheVersion: string;
securityProviderVersion: string;
};
clusterTopology: ClusterTopologyModel;
}

export interface ClusterAgentModel {
Expand All @@ -34,9 +97,10 @@ export interface ClusterAgentModel {
description: string;
platform: string;
version: string;
status: NodeStatusModel;
status: ClusterNodeStatusModel;
}
export interface NodeStatusModel {

export interface ClusterNodeStatusModel {
message: string;
severity: string;
status: string;
Expand Down
6 changes: 3 additions & 3 deletions src/resources/PlatformResources.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import API from '../APICore';
import Catalog from './Catalogs/Catalog';
import Clusters from './Clusters/Cluster';
import Cluster from './Clusters/Cluster';
import Group from './Groups/Groups';
import Organization from './Organizations/Organization';
import Resource from './Resource';

const resourcesMap: Array<{key: string; resource: typeof Resource}> = [
{key: 'catalog', resource: Catalog},
{key: 'cluster', resource: Clusters},
{key: 'cluster', resource: Cluster},
{key: 'group', resource: Group},
{key: 'organization', resource: Organization},
];
Expand All @@ -16,7 +16,7 @@ class PlatformResources {
protected API: API;

catalog: Catalog;
cluster: Clusters;
cluster: Cluster;
group: Group;
organization: Organization;

Expand Down

0 comments on commit 7113b38

Please sign in to comment.