File

src/app/runtime/model/runtime-app.ts

Description

Runtime application model that corresponds to AppStatusResource from SCDF server.

Example

Index

Properties
Methods

Constructor

constructor(deploymentId: string, state: string, instances: any, appInstances: RuntimeAppInstance[])
Parameters :
Name Type Optional Description
deploymentId string
state string
instances any
appInstances RuntimeAppInstance[]

Methods

Public pageFromJSON
pageFromJSON(input: )
Parameters :
Name Type Optional Description
input
Returns : Page<RuntimeApp>

Properties

Public appInstances
appInstances: RuntimeAppInstance[]
Type : RuntimeAppInstance[]
Public deploymentId
deploymentId: string
Type : string
Public instances
instances: any
Type : any
Public state
state: string
Type : string
import { RuntimeAppInstance } from './runtime-app-instance';
import { Page } from '../../shared/model/page';

/**
 * Runtime application model that corresponds to AppStatusResource from SCDF server.
 *
 * @author Ilayaperumal Gopinathan
 */
export class RuntimeApp {

  public deploymentId: string;
  public state: string;
  public instances: any;
  public appInstances: RuntimeAppInstance[];

  constructor(deploymentId: string,
              state: string,
              instances: any,
              appInstances: RuntimeAppInstance[]) {
    this.deploymentId = deploymentId;
    this.state = state;
    this.instances = instances;
    this.appInstances = appInstances;
  }

  public static pageFromJSON(input): Page<RuntimeApp> {
    const page = Page.fromJSON<RuntimeApp>(input);
    if (input && input._embedded && input._embedded.appStatusResourceList) {
      page.items = (input._embedded.appStatusResourceList as RuntimeApp[]).map((item) => {
        item.appInstances = item.instances._embedded.appInstanceStatusResourceList;
        return item;
      });
    }
    return page;
  }
}

results matching ""

    No results matching ""