// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Externs for backend API and model objects. This should be kept in sync with the * backend code. * * Guidelines: * - Model JSONs should have the same name as backend structs. * * @externs */ const backendApi = {}; /** * @typedef {{ * port: (number|null), * protocol: string, * targetPort: (number|null) * }} */ backendApi.PortMapping; /** * @typedef {{ * key: string, * value: string * }} */ backendApi.Label; /** * @typedef {{ * containerImage: string, * containerCommand: ?string, * containerCommandArgs: ?string, * isExternal: boolean, * name: string, * description: ?string, * portMappings: !Array, * labels: !Array, * replicas: number, * namespace: string, * memoryRequirement: ?string, * cpuRequirement: ?number, * runAsPrivileged: boolean, * }} */ backendApi.AppDeploymentSpec; /** * @typedef {{ * name: string, * content: string * }} */ backendApi.AppDeploymentFromFileSpec; /** * @typedef {{ * namespace: string, * events: !Array * }} */ backendApi.Events; /** * @typedef {{ * message: string, * sourceComponent: string, * sourceHost: string, * object: string, * count: number, * firstSeen: string, * lastSeen: string, * reason: string, * type: string * }} */ backendApi.Event; /** * @typedef {{ * replicationControllers: !Array * }} */ backendApi.ReplicationControllerList; /** * @typedef {{ * reason: string, * message: string * }} */ backendApi.PodEvent; /** * @typedef {{ * current: number, * desired: number, * running: number, * pending: number, * failed: number, * warnings: !Array * }} */ backendApi.ReplicationControllerPodInfo; /** * @typedef {{ * name: string, * namespace: string, * description: string, * labels: !Object, * pods: !backendApi.ReplicationControllerPodInfo, * containerImages: !Array, * creationTime: string, * internalEndpoints: !Array, * externalEndpoints: !Array * }} */ backendApi.ReplicationController; /** * @typedef {{ * name: string, * namespace: string, * labels: !Object, * labelSelector: !Object, * containerImages: !Array, * podInfo: !backendApi.ReplicationControllerPodInfo, * pods: !Array, * services: !Array, * hasMetrics: boolean * }} */ backendApi.ReplicationControllerDetail; /** * @typedef {{ * replicas: number * }} */ backendApi.ReplicationControllerSpec; /** * @typedef {{ * name: string, * startTime: ?string, * status: string, * podIP: string, * nodeName: string, * restartCount: number, * metrics: {cpuUsage: ?number, memoryUsage: ?number} * }} */ backendApi.ReplicationControllerPod; /** * @typedef {{ * name: string, * internalEndpoint: !backendApi.Endpoint, * externalEndpoints: !Array, * selector: !Object * }} */ backendApi.ServiceDetail; /** * @typedef {{ * host: string, * ports: !Array<{port: number, protocol: string}> * }} */ backendApi.Endpoint; /** * @typedef {{ * name: string * }} */ backendApi.NamespaceSpec; /** * @typedef {{ * namespaces: !Array * }} */ backendApi.NamespaceList; /** * @typedef {{ * name: string, * restartCount: number * }} */ backendApi.PodContainer; /** * @typedef {{ * name: string, * startTime: ?string, * totalRestartCount: number, * podContainers: !Array * }} */ backendApi.ReplicationControllerPodWithContainers; /** * @typedef {{ * pods: !Array * }} */ backendApi.ReplicationControllerPods; /** * @typedef {{ * podId: string, * sinceTime: string, * logs: !Array, * container: string * }} */ backendApi.Logs; /** * @typedef {{ * name: string, * namespace: string * }} */ backendApi.AppNameValiditySpec; /** * @typedef {{ * valid: boolean * }} */ backendApi.AppNameValidity; /** * @typedef {{ * protocols: !Array * }} */ backendApi.Protocols; /** * @typedef {{ * valid: boolean * }} */ backendApi.ProtocolValidity; /** * @typedef {{ * protocol: string, * isExternal: boolean * }} */ backendApi.ProtocolValiditySpec; /** * @typedef {{ * name: string, * namespace: string, * data: string, * }} */ backendApi.SecretSpec; /** * @typedef {{ * secrets: !Array * }} */ backendApi.SecretsList;