@daocloud-proto/zestu 0.2.0-dev-d0639772 → 0.2.0-dev-5f57a8f3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/zestu",
3
- "version":"v0.2.0-dev-d0639772",
3
+ "version":"v0.2.0-dev-5f57a8f3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,50 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ export enum requestStatus {
8
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
9
+ SUCCESS = "SUCCESS",
10
+ FAIL = "FAIL",
11
+ }
12
+
13
+ export type MetricsRangeRequest = {
14
+ regionId?: string
15
+ instanceId?: string
16
+ range?: TimeRange
17
+ }
18
+
19
+ export type TimeRange = {
20
+ start?: string
21
+ end?: string
22
+ step?: number
23
+ }
24
+
25
+ export type MetricsRangeResponse = {
26
+ gPUUsageRate?: MetricRangeResult
27
+ gPUMemoryUsageRate?: MetricRangeResult
28
+ cPUUsageRate?: MetricRangeResult
29
+ memoryUsageRate?: MetricRangeResult
30
+ }
31
+
32
+ export type MetricRangeResult = {
33
+ data?: PrometheusQueryRangeResult
34
+ status?: requestStatus
35
+ errorMessage?: string
36
+ }
37
+
38
+ export type PrometheusQueryRangeResult = {
39
+ matrix?: SampleStream[]
40
+ }
41
+
42
+ export type SampleStream = {
43
+ metric?: {[key: string]: string}
44
+ values?: samplePair[]
45
+ }
46
+
47
+ export type samplePair = {
48
+ timestamp?: string
49
+ value?: string
50
+ }
@@ -10,6 +10,7 @@ import * as ZestuIoApiContainerinstanceV1alpha1Containerinstance from "../contai
10
10
  import * as ZestuIoApiFile_storageV1alpha1Storage from "../file_storage/v1alpha1/storage.pb"
11
11
  import * as ZestuIoApiImageV1alpha1Image from "../image/v1alpha1/image.pb"
12
12
  import * as ZestuIoApiMeteringV1alpha1Metering from "../metering/v1alpha1/metering.pb"
13
+ import * as ZestuIoApiMetricsV1alpha1Metrics from "../metrics/v1alpha1/metrics.pb"
13
14
  import * as ZestuIoApiRegionV1alpha1Region from "../region/v1alpha1/region.pb"
14
15
  import * as ZestuIoApiResourcesV1alpha1Resources from "../resources/v1alpha1/resources.pb"
15
16
  export class ContainerInstance {
@@ -94,4 +95,9 @@ export class Agent {
94
95
  static RegisterResource(req: ZestuIoApiResourcesV1alpha1Resources.RegisterResourceRequest, initReq?: fm.InitReq): Promise<ZestuIoApiResourcesV1alpha1Resources.RegisterResourceResponse> {
95
96
  return fm.fetchReq<ZestuIoApiResourcesV1alpha1Resources.RegisterResourceRequest, ZestuIoApiResourcesV1alpha1Resources.RegisterResourceResponse>(`/zestu.io.api.v1alpha1.Agent/RegisterResource`, {...initReq, method: "POST", body: JSON.stringify(req)})
96
97
  }
98
+ }
99
+ export class Metrics {
100
+ static QueryMetricsRange(req: ZestuIoApiMetricsV1alpha1Metrics.MetricsRangeRequest, initReq?: fm.InitReq): Promise<ZestuIoApiMetricsV1alpha1Metrics.MetricsRangeResponse> {
101
+ return fm.fetchReq<ZestuIoApiMetricsV1alpha1Metrics.MetricsRangeRequest, ZestuIoApiMetricsV1alpha1Metrics.MetricsRangeResponse>(`/apis/zestu.io/v1/region/${req["regionId"]}/containerinstances/${req["instanceId"]}/metricsrange`, {...initReq, method: "POST", body: JSON.stringify(req)})
102
+ }
97
103
  }