@miradorlabs/web-grpc 2.19.0 → 2.20.0
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
|
@@ -63,6 +63,51 @@ export function sloComparatorToJSON(object: SloComparator): string {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
export enum SloCorridorState {
|
|
67
|
+
SLO_CORRIDOR_STATE_UNSPECIFIED = 0,
|
|
68
|
+
SLO_CORRIDOR_STATE_OK = 1,
|
|
69
|
+
SLO_CORRIDOR_STATE_BREACHED = 2,
|
|
70
|
+
SLO_CORRIDOR_STATE_NO_DATA = 3,
|
|
71
|
+
UNRECOGNIZED = -1,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function sloCorridorStateFromJSON(object: any): SloCorridorState {
|
|
75
|
+
switch (object) {
|
|
76
|
+
case 0:
|
|
77
|
+
case "SLO_CORRIDOR_STATE_UNSPECIFIED":
|
|
78
|
+
return SloCorridorState.SLO_CORRIDOR_STATE_UNSPECIFIED;
|
|
79
|
+
case 1:
|
|
80
|
+
case "SLO_CORRIDOR_STATE_OK":
|
|
81
|
+
return SloCorridorState.SLO_CORRIDOR_STATE_OK;
|
|
82
|
+
case 2:
|
|
83
|
+
case "SLO_CORRIDOR_STATE_BREACHED":
|
|
84
|
+
return SloCorridorState.SLO_CORRIDOR_STATE_BREACHED;
|
|
85
|
+
case 3:
|
|
86
|
+
case "SLO_CORRIDOR_STATE_NO_DATA":
|
|
87
|
+
return SloCorridorState.SLO_CORRIDOR_STATE_NO_DATA;
|
|
88
|
+
case -1:
|
|
89
|
+
case "UNRECOGNIZED":
|
|
90
|
+
default:
|
|
91
|
+
return SloCorridorState.UNRECOGNIZED;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function sloCorridorStateToJSON(object: SloCorridorState): string {
|
|
96
|
+
switch (object) {
|
|
97
|
+
case SloCorridorState.SLO_CORRIDOR_STATE_UNSPECIFIED:
|
|
98
|
+
return "SLO_CORRIDOR_STATE_UNSPECIFIED";
|
|
99
|
+
case SloCorridorState.SLO_CORRIDOR_STATE_OK:
|
|
100
|
+
return "SLO_CORRIDOR_STATE_OK";
|
|
101
|
+
case SloCorridorState.SLO_CORRIDOR_STATE_BREACHED:
|
|
102
|
+
return "SLO_CORRIDOR_STATE_BREACHED";
|
|
103
|
+
case SloCorridorState.SLO_CORRIDOR_STATE_NO_DATA:
|
|
104
|
+
return "SLO_CORRIDOR_STATE_NO_DATA";
|
|
105
|
+
case SloCorridorState.UNRECOGNIZED:
|
|
106
|
+
default:
|
|
107
|
+
return "UNRECOGNIZED";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
66
111
|
export interface Slo {
|
|
67
112
|
id: string;
|
|
68
113
|
organizationId: string;
|
|
@@ -161,6 +206,47 @@ export interface DeleteSloResponse {
|
|
|
161
206
|
status: ResponseStatus | undefined;
|
|
162
207
|
}
|
|
163
208
|
|
|
209
|
+
export interface GetSloStatusRequest {
|
|
210
|
+
organizationId: string;
|
|
211
|
+
projectId: string;
|
|
212
|
+
sloId: string;
|
|
213
|
+
/** evaluation_time: the instant the rolling window ends at. Unset = server now(). */
|
|
214
|
+
evaluationTime: Date | undefined;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface GetSloStatusResponse {
|
|
218
|
+
status: ResponseStatus | undefined;
|
|
219
|
+
sloStatus: SloStatus | undefined;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* SloStatus is one SLO's live compliance over its rolling window, one row per
|
|
224
|
+
* observed corridor. A disabled SLO returns no corridors (nothing is evaluated).
|
|
225
|
+
*/
|
|
226
|
+
export interface SloStatus {
|
|
227
|
+
sloId: string;
|
|
228
|
+
enabled: boolean;
|
|
229
|
+
windowSeconds: number;
|
|
230
|
+
windowStart: Date | undefined;
|
|
231
|
+
windowEnd: Date | undefined;
|
|
232
|
+
corridors: SloCorridorStatus[];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* SloCorridorStatus is one group_by combination's compliance. group_values is
|
|
237
|
+
* parallel to the objective's group_by (empty for a project-wide SLO).
|
|
238
|
+
*/
|
|
239
|
+
export interface SloCorridorStatus {
|
|
240
|
+
groupValues: string[];
|
|
241
|
+
eligibleCount: number;
|
|
242
|
+
goodCount: number;
|
|
243
|
+
/** compliance: good/eligible in [0,1]; 0 and state NO_DATA when eligible_count is 0. */
|
|
244
|
+
compliance: number;
|
|
245
|
+
/** budget_remaining: 1 - (1 - compliance)/(1 - target); may be negative when overspent. */
|
|
246
|
+
budgetRemaining: number;
|
|
247
|
+
state: SloCorridorState;
|
|
248
|
+
}
|
|
249
|
+
|
|
164
250
|
function createBaseSlo(): Slo {
|
|
165
251
|
return {
|
|
166
252
|
id: "",
|
|
@@ -1641,6 +1727,528 @@ export const DeleteSloResponse: MessageFns<DeleteSloResponse> = {
|
|
|
1641
1727
|
},
|
|
1642
1728
|
};
|
|
1643
1729
|
|
|
1730
|
+
function createBaseGetSloStatusRequest(): GetSloStatusRequest {
|
|
1731
|
+
return { organizationId: "", projectId: "", sloId: "", evaluationTime: undefined };
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
export const GetSloStatusRequest: MessageFns<GetSloStatusRequest> = {
|
|
1735
|
+
encode(message: GetSloStatusRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1736
|
+
if (message.organizationId !== "") {
|
|
1737
|
+
writer.uint32(10).string(message.organizationId);
|
|
1738
|
+
}
|
|
1739
|
+
if (message.projectId !== "") {
|
|
1740
|
+
writer.uint32(18).string(message.projectId);
|
|
1741
|
+
}
|
|
1742
|
+
if (message.sloId !== "") {
|
|
1743
|
+
writer.uint32(26).string(message.sloId);
|
|
1744
|
+
}
|
|
1745
|
+
if (message.evaluationTime !== undefined) {
|
|
1746
|
+
Timestamp.encode(toTimestamp(message.evaluationTime), writer.uint32(34).fork()).join();
|
|
1747
|
+
}
|
|
1748
|
+
return writer;
|
|
1749
|
+
},
|
|
1750
|
+
|
|
1751
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetSloStatusRequest {
|
|
1752
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1753
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1754
|
+
const message = createBaseGetSloStatusRequest();
|
|
1755
|
+
while (reader.pos < end) {
|
|
1756
|
+
const tag = reader.uint32();
|
|
1757
|
+
switch (tag >>> 3) {
|
|
1758
|
+
case 1: {
|
|
1759
|
+
if (tag !== 10) {
|
|
1760
|
+
break;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
message.organizationId = reader.string();
|
|
1764
|
+
continue;
|
|
1765
|
+
}
|
|
1766
|
+
case 2: {
|
|
1767
|
+
if (tag !== 18) {
|
|
1768
|
+
break;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
message.projectId = reader.string();
|
|
1772
|
+
continue;
|
|
1773
|
+
}
|
|
1774
|
+
case 3: {
|
|
1775
|
+
if (tag !== 26) {
|
|
1776
|
+
break;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
message.sloId = reader.string();
|
|
1780
|
+
continue;
|
|
1781
|
+
}
|
|
1782
|
+
case 4: {
|
|
1783
|
+
if (tag !== 34) {
|
|
1784
|
+
break;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
message.evaluationTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1788
|
+
continue;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1792
|
+
break;
|
|
1793
|
+
}
|
|
1794
|
+
reader.skip(tag & 7);
|
|
1795
|
+
}
|
|
1796
|
+
return message;
|
|
1797
|
+
},
|
|
1798
|
+
|
|
1799
|
+
fromJSON(object: any): GetSloStatusRequest {
|
|
1800
|
+
return {
|
|
1801
|
+
organizationId: isSet(object.organizationId)
|
|
1802
|
+
? globalThis.String(object.organizationId)
|
|
1803
|
+
: isSet(object.organization_id)
|
|
1804
|
+
? globalThis.String(object.organization_id)
|
|
1805
|
+
: "",
|
|
1806
|
+
projectId: isSet(object.projectId)
|
|
1807
|
+
? globalThis.String(object.projectId)
|
|
1808
|
+
: isSet(object.project_id)
|
|
1809
|
+
? globalThis.String(object.project_id)
|
|
1810
|
+
: "",
|
|
1811
|
+
sloId: isSet(object.sloId)
|
|
1812
|
+
? globalThis.String(object.sloId)
|
|
1813
|
+
: isSet(object.slo_id)
|
|
1814
|
+
? globalThis.String(object.slo_id)
|
|
1815
|
+
: "",
|
|
1816
|
+
evaluationTime: isSet(object.evaluationTime)
|
|
1817
|
+
? fromJsonTimestamp(object.evaluationTime)
|
|
1818
|
+
: isSet(object.evaluation_time)
|
|
1819
|
+
? fromJsonTimestamp(object.evaluation_time)
|
|
1820
|
+
: undefined,
|
|
1821
|
+
};
|
|
1822
|
+
},
|
|
1823
|
+
|
|
1824
|
+
toJSON(message: GetSloStatusRequest): unknown {
|
|
1825
|
+
const obj: any = {};
|
|
1826
|
+
if (message.organizationId !== "") {
|
|
1827
|
+
obj.organizationId = message.organizationId;
|
|
1828
|
+
}
|
|
1829
|
+
if (message.projectId !== "") {
|
|
1830
|
+
obj.projectId = message.projectId;
|
|
1831
|
+
}
|
|
1832
|
+
if (message.sloId !== "") {
|
|
1833
|
+
obj.sloId = message.sloId;
|
|
1834
|
+
}
|
|
1835
|
+
if (message.evaluationTime !== undefined) {
|
|
1836
|
+
obj.evaluationTime = message.evaluationTime.toISOString();
|
|
1837
|
+
}
|
|
1838
|
+
return obj;
|
|
1839
|
+
},
|
|
1840
|
+
|
|
1841
|
+
create<I extends Exact<DeepPartial<GetSloStatusRequest>, I>>(base?: I): GetSloStatusRequest {
|
|
1842
|
+
return GetSloStatusRequest.fromPartial(base ?? ({} as any));
|
|
1843
|
+
},
|
|
1844
|
+
fromPartial<I extends Exact<DeepPartial<GetSloStatusRequest>, I>>(object: I): GetSloStatusRequest {
|
|
1845
|
+
const message = createBaseGetSloStatusRequest();
|
|
1846
|
+
message.organizationId = object.organizationId ?? "";
|
|
1847
|
+
message.projectId = object.projectId ?? "";
|
|
1848
|
+
message.sloId = object.sloId ?? "";
|
|
1849
|
+
message.evaluationTime = object.evaluationTime ?? undefined;
|
|
1850
|
+
return message;
|
|
1851
|
+
},
|
|
1852
|
+
};
|
|
1853
|
+
|
|
1854
|
+
function createBaseGetSloStatusResponse(): GetSloStatusResponse {
|
|
1855
|
+
return { status: undefined, sloStatus: undefined };
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
export const GetSloStatusResponse: MessageFns<GetSloStatusResponse> = {
|
|
1859
|
+
encode(message: GetSloStatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1860
|
+
if (message.status !== undefined) {
|
|
1861
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
1862
|
+
}
|
|
1863
|
+
if (message.sloStatus !== undefined) {
|
|
1864
|
+
SloStatus.encode(message.sloStatus, writer.uint32(18).fork()).join();
|
|
1865
|
+
}
|
|
1866
|
+
return writer;
|
|
1867
|
+
},
|
|
1868
|
+
|
|
1869
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetSloStatusResponse {
|
|
1870
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1871
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1872
|
+
const message = createBaseGetSloStatusResponse();
|
|
1873
|
+
while (reader.pos < end) {
|
|
1874
|
+
const tag = reader.uint32();
|
|
1875
|
+
switch (tag >>> 3) {
|
|
1876
|
+
case 1: {
|
|
1877
|
+
if (tag !== 10) {
|
|
1878
|
+
break;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
1882
|
+
continue;
|
|
1883
|
+
}
|
|
1884
|
+
case 2: {
|
|
1885
|
+
if (tag !== 18) {
|
|
1886
|
+
break;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
message.sloStatus = SloStatus.decode(reader, reader.uint32());
|
|
1890
|
+
continue;
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1894
|
+
break;
|
|
1895
|
+
}
|
|
1896
|
+
reader.skip(tag & 7);
|
|
1897
|
+
}
|
|
1898
|
+
return message;
|
|
1899
|
+
},
|
|
1900
|
+
|
|
1901
|
+
fromJSON(object: any): GetSloStatusResponse {
|
|
1902
|
+
return {
|
|
1903
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
1904
|
+
sloStatus: isSet(object.sloStatus)
|
|
1905
|
+
? SloStatus.fromJSON(object.sloStatus)
|
|
1906
|
+
: isSet(object.slo_status)
|
|
1907
|
+
? SloStatus.fromJSON(object.slo_status)
|
|
1908
|
+
: undefined,
|
|
1909
|
+
};
|
|
1910
|
+
},
|
|
1911
|
+
|
|
1912
|
+
toJSON(message: GetSloStatusResponse): unknown {
|
|
1913
|
+
const obj: any = {};
|
|
1914
|
+
if (message.status !== undefined) {
|
|
1915
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
1916
|
+
}
|
|
1917
|
+
if (message.sloStatus !== undefined) {
|
|
1918
|
+
obj.sloStatus = SloStatus.toJSON(message.sloStatus);
|
|
1919
|
+
}
|
|
1920
|
+
return obj;
|
|
1921
|
+
},
|
|
1922
|
+
|
|
1923
|
+
create<I extends Exact<DeepPartial<GetSloStatusResponse>, I>>(base?: I): GetSloStatusResponse {
|
|
1924
|
+
return GetSloStatusResponse.fromPartial(base ?? ({} as any));
|
|
1925
|
+
},
|
|
1926
|
+
fromPartial<I extends Exact<DeepPartial<GetSloStatusResponse>, I>>(object: I): GetSloStatusResponse {
|
|
1927
|
+
const message = createBaseGetSloStatusResponse();
|
|
1928
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
1929
|
+
? ResponseStatus.fromPartial(object.status)
|
|
1930
|
+
: undefined;
|
|
1931
|
+
message.sloStatus = (object.sloStatus !== undefined && object.sloStatus !== null)
|
|
1932
|
+
? SloStatus.fromPartial(object.sloStatus)
|
|
1933
|
+
: undefined;
|
|
1934
|
+
return message;
|
|
1935
|
+
},
|
|
1936
|
+
};
|
|
1937
|
+
|
|
1938
|
+
function createBaseSloStatus(): SloStatus {
|
|
1939
|
+
return { sloId: "", enabled: false, windowSeconds: 0, windowStart: undefined, windowEnd: undefined, corridors: [] };
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
export const SloStatus: MessageFns<SloStatus> = {
|
|
1943
|
+
encode(message: SloStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1944
|
+
if (message.sloId !== "") {
|
|
1945
|
+
writer.uint32(10).string(message.sloId);
|
|
1946
|
+
}
|
|
1947
|
+
if (message.enabled !== false) {
|
|
1948
|
+
writer.uint32(16).bool(message.enabled);
|
|
1949
|
+
}
|
|
1950
|
+
if (message.windowSeconds !== 0) {
|
|
1951
|
+
writer.uint32(24).int64(message.windowSeconds);
|
|
1952
|
+
}
|
|
1953
|
+
if (message.windowStart !== undefined) {
|
|
1954
|
+
Timestamp.encode(toTimestamp(message.windowStart), writer.uint32(34).fork()).join();
|
|
1955
|
+
}
|
|
1956
|
+
if (message.windowEnd !== undefined) {
|
|
1957
|
+
Timestamp.encode(toTimestamp(message.windowEnd), writer.uint32(42).fork()).join();
|
|
1958
|
+
}
|
|
1959
|
+
for (const v of message.corridors) {
|
|
1960
|
+
SloCorridorStatus.encode(v!, writer.uint32(50).fork()).join();
|
|
1961
|
+
}
|
|
1962
|
+
return writer;
|
|
1963
|
+
},
|
|
1964
|
+
|
|
1965
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SloStatus {
|
|
1966
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1967
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1968
|
+
const message = createBaseSloStatus();
|
|
1969
|
+
while (reader.pos < end) {
|
|
1970
|
+
const tag = reader.uint32();
|
|
1971
|
+
switch (tag >>> 3) {
|
|
1972
|
+
case 1: {
|
|
1973
|
+
if (tag !== 10) {
|
|
1974
|
+
break;
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
message.sloId = reader.string();
|
|
1978
|
+
continue;
|
|
1979
|
+
}
|
|
1980
|
+
case 2: {
|
|
1981
|
+
if (tag !== 16) {
|
|
1982
|
+
break;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
message.enabled = reader.bool();
|
|
1986
|
+
continue;
|
|
1987
|
+
}
|
|
1988
|
+
case 3: {
|
|
1989
|
+
if (tag !== 24) {
|
|
1990
|
+
break;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
message.windowSeconds = longToNumber(reader.int64());
|
|
1994
|
+
continue;
|
|
1995
|
+
}
|
|
1996
|
+
case 4: {
|
|
1997
|
+
if (tag !== 34) {
|
|
1998
|
+
break;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
message.windowStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
2002
|
+
continue;
|
|
2003
|
+
}
|
|
2004
|
+
case 5: {
|
|
2005
|
+
if (tag !== 42) {
|
|
2006
|
+
break;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
message.windowEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
2010
|
+
continue;
|
|
2011
|
+
}
|
|
2012
|
+
case 6: {
|
|
2013
|
+
if (tag !== 50) {
|
|
2014
|
+
break;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
message.corridors.push(SloCorridorStatus.decode(reader, reader.uint32()));
|
|
2018
|
+
continue;
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2022
|
+
break;
|
|
2023
|
+
}
|
|
2024
|
+
reader.skip(tag & 7);
|
|
2025
|
+
}
|
|
2026
|
+
return message;
|
|
2027
|
+
},
|
|
2028
|
+
|
|
2029
|
+
fromJSON(object: any): SloStatus {
|
|
2030
|
+
return {
|
|
2031
|
+
sloId: isSet(object.sloId)
|
|
2032
|
+
? globalThis.String(object.sloId)
|
|
2033
|
+
: isSet(object.slo_id)
|
|
2034
|
+
? globalThis.String(object.slo_id)
|
|
2035
|
+
: "",
|
|
2036
|
+
enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
|
|
2037
|
+
windowSeconds: isSet(object.windowSeconds)
|
|
2038
|
+
? globalThis.Number(object.windowSeconds)
|
|
2039
|
+
: isSet(object.window_seconds)
|
|
2040
|
+
? globalThis.Number(object.window_seconds)
|
|
2041
|
+
: 0,
|
|
2042
|
+
windowStart: isSet(object.windowStart)
|
|
2043
|
+
? fromJsonTimestamp(object.windowStart)
|
|
2044
|
+
: isSet(object.window_start)
|
|
2045
|
+
? fromJsonTimestamp(object.window_start)
|
|
2046
|
+
: undefined,
|
|
2047
|
+
windowEnd: isSet(object.windowEnd)
|
|
2048
|
+
? fromJsonTimestamp(object.windowEnd)
|
|
2049
|
+
: isSet(object.window_end)
|
|
2050
|
+
? fromJsonTimestamp(object.window_end)
|
|
2051
|
+
: undefined,
|
|
2052
|
+
corridors: globalThis.Array.isArray(object?.corridors)
|
|
2053
|
+
? object.corridors.map((e: any) => SloCorridorStatus.fromJSON(e))
|
|
2054
|
+
: [],
|
|
2055
|
+
};
|
|
2056
|
+
},
|
|
2057
|
+
|
|
2058
|
+
toJSON(message: SloStatus): unknown {
|
|
2059
|
+
const obj: any = {};
|
|
2060
|
+
if (message.sloId !== "") {
|
|
2061
|
+
obj.sloId = message.sloId;
|
|
2062
|
+
}
|
|
2063
|
+
if (message.enabled !== false) {
|
|
2064
|
+
obj.enabled = message.enabled;
|
|
2065
|
+
}
|
|
2066
|
+
if (message.windowSeconds !== 0) {
|
|
2067
|
+
obj.windowSeconds = Math.round(message.windowSeconds);
|
|
2068
|
+
}
|
|
2069
|
+
if (message.windowStart !== undefined) {
|
|
2070
|
+
obj.windowStart = message.windowStart.toISOString();
|
|
2071
|
+
}
|
|
2072
|
+
if (message.windowEnd !== undefined) {
|
|
2073
|
+
obj.windowEnd = message.windowEnd.toISOString();
|
|
2074
|
+
}
|
|
2075
|
+
if (message.corridors?.length) {
|
|
2076
|
+
obj.corridors = message.corridors.map((e) => SloCorridorStatus.toJSON(e));
|
|
2077
|
+
}
|
|
2078
|
+
return obj;
|
|
2079
|
+
},
|
|
2080
|
+
|
|
2081
|
+
create<I extends Exact<DeepPartial<SloStatus>, I>>(base?: I): SloStatus {
|
|
2082
|
+
return SloStatus.fromPartial(base ?? ({} as any));
|
|
2083
|
+
},
|
|
2084
|
+
fromPartial<I extends Exact<DeepPartial<SloStatus>, I>>(object: I): SloStatus {
|
|
2085
|
+
const message = createBaseSloStatus();
|
|
2086
|
+
message.sloId = object.sloId ?? "";
|
|
2087
|
+
message.enabled = object.enabled ?? false;
|
|
2088
|
+
message.windowSeconds = object.windowSeconds ?? 0;
|
|
2089
|
+
message.windowStart = object.windowStart ?? undefined;
|
|
2090
|
+
message.windowEnd = object.windowEnd ?? undefined;
|
|
2091
|
+
message.corridors = object.corridors?.map((e) => SloCorridorStatus.fromPartial(e)) || [];
|
|
2092
|
+
return message;
|
|
2093
|
+
},
|
|
2094
|
+
};
|
|
2095
|
+
|
|
2096
|
+
function createBaseSloCorridorStatus(): SloCorridorStatus {
|
|
2097
|
+
return { groupValues: [], eligibleCount: 0, goodCount: 0, compliance: 0, budgetRemaining: 0, state: 0 };
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
export const SloCorridorStatus: MessageFns<SloCorridorStatus> = {
|
|
2101
|
+
encode(message: SloCorridorStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2102
|
+
for (const v of message.groupValues) {
|
|
2103
|
+
writer.uint32(10).string(v!);
|
|
2104
|
+
}
|
|
2105
|
+
if (message.eligibleCount !== 0) {
|
|
2106
|
+
writer.uint32(16).uint64(message.eligibleCount);
|
|
2107
|
+
}
|
|
2108
|
+
if (message.goodCount !== 0) {
|
|
2109
|
+
writer.uint32(24).uint64(message.goodCount);
|
|
2110
|
+
}
|
|
2111
|
+
if (message.compliance !== 0) {
|
|
2112
|
+
writer.uint32(33).double(message.compliance);
|
|
2113
|
+
}
|
|
2114
|
+
if (message.budgetRemaining !== 0) {
|
|
2115
|
+
writer.uint32(41).double(message.budgetRemaining);
|
|
2116
|
+
}
|
|
2117
|
+
if (message.state !== 0) {
|
|
2118
|
+
writer.uint32(48).int32(message.state);
|
|
2119
|
+
}
|
|
2120
|
+
return writer;
|
|
2121
|
+
},
|
|
2122
|
+
|
|
2123
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SloCorridorStatus {
|
|
2124
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2125
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2126
|
+
const message = createBaseSloCorridorStatus();
|
|
2127
|
+
while (reader.pos < end) {
|
|
2128
|
+
const tag = reader.uint32();
|
|
2129
|
+
switch (tag >>> 3) {
|
|
2130
|
+
case 1: {
|
|
2131
|
+
if (tag !== 10) {
|
|
2132
|
+
break;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
message.groupValues.push(reader.string());
|
|
2136
|
+
continue;
|
|
2137
|
+
}
|
|
2138
|
+
case 2: {
|
|
2139
|
+
if (tag !== 16) {
|
|
2140
|
+
break;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
message.eligibleCount = longToNumber(reader.uint64());
|
|
2144
|
+
continue;
|
|
2145
|
+
}
|
|
2146
|
+
case 3: {
|
|
2147
|
+
if (tag !== 24) {
|
|
2148
|
+
break;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
message.goodCount = longToNumber(reader.uint64());
|
|
2152
|
+
continue;
|
|
2153
|
+
}
|
|
2154
|
+
case 4: {
|
|
2155
|
+
if (tag !== 33) {
|
|
2156
|
+
break;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
message.compliance = reader.double();
|
|
2160
|
+
continue;
|
|
2161
|
+
}
|
|
2162
|
+
case 5: {
|
|
2163
|
+
if (tag !== 41) {
|
|
2164
|
+
break;
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
message.budgetRemaining = reader.double();
|
|
2168
|
+
continue;
|
|
2169
|
+
}
|
|
2170
|
+
case 6: {
|
|
2171
|
+
if (tag !== 48) {
|
|
2172
|
+
break;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
message.state = reader.int32() as any;
|
|
2176
|
+
continue;
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2180
|
+
break;
|
|
2181
|
+
}
|
|
2182
|
+
reader.skip(tag & 7);
|
|
2183
|
+
}
|
|
2184
|
+
return message;
|
|
2185
|
+
},
|
|
2186
|
+
|
|
2187
|
+
fromJSON(object: any): SloCorridorStatus {
|
|
2188
|
+
return {
|
|
2189
|
+
groupValues: globalThis.Array.isArray(object?.groupValues)
|
|
2190
|
+
? object.groupValues.map((e: any) => globalThis.String(e))
|
|
2191
|
+
: globalThis.Array.isArray(object?.group_values)
|
|
2192
|
+
? object.group_values.map((e: any) => globalThis.String(e))
|
|
2193
|
+
: [],
|
|
2194
|
+
eligibleCount: isSet(object.eligibleCount)
|
|
2195
|
+
? globalThis.Number(object.eligibleCount)
|
|
2196
|
+
: isSet(object.eligible_count)
|
|
2197
|
+
? globalThis.Number(object.eligible_count)
|
|
2198
|
+
: 0,
|
|
2199
|
+
goodCount: isSet(object.goodCount)
|
|
2200
|
+
? globalThis.Number(object.goodCount)
|
|
2201
|
+
: isSet(object.good_count)
|
|
2202
|
+
? globalThis.Number(object.good_count)
|
|
2203
|
+
: 0,
|
|
2204
|
+
compliance: isSet(object.compliance) ? globalThis.Number(object.compliance) : 0,
|
|
2205
|
+
budgetRemaining: isSet(object.budgetRemaining)
|
|
2206
|
+
? globalThis.Number(object.budgetRemaining)
|
|
2207
|
+
: isSet(object.budget_remaining)
|
|
2208
|
+
? globalThis.Number(object.budget_remaining)
|
|
2209
|
+
: 0,
|
|
2210
|
+
state: isSet(object.state) ? sloCorridorStateFromJSON(object.state) : 0,
|
|
2211
|
+
};
|
|
2212
|
+
},
|
|
2213
|
+
|
|
2214
|
+
toJSON(message: SloCorridorStatus): unknown {
|
|
2215
|
+
const obj: any = {};
|
|
2216
|
+
if (message.groupValues?.length) {
|
|
2217
|
+
obj.groupValues = message.groupValues;
|
|
2218
|
+
}
|
|
2219
|
+
if (message.eligibleCount !== 0) {
|
|
2220
|
+
obj.eligibleCount = Math.round(message.eligibleCount);
|
|
2221
|
+
}
|
|
2222
|
+
if (message.goodCount !== 0) {
|
|
2223
|
+
obj.goodCount = Math.round(message.goodCount);
|
|
2224
|
+
}
|
|
2225
|
+
if (message.compliance !== 0) {
|
|
2226
|
+
obj.compliance = message.compliance;
|
|
2227
|
+
}
|
|
2228
|
+
if (message.budgetRemaining !== 0) {
|
|
2229
|
+
obj.budgetRemaining = message.budgetRemaining;
|
|
2230
|
+
}
|
|
2231
|
+
if (message.state !== 0) {
|
|
2232
|
+
obj.state = sloCorridorStateToJSON(message.state);
|
|
2233
|
+
}
|
|
2234
|
+
return obj;
|
|
2235
|
+
},
|
|
2236
|
+
|
|
2237
|
+
create<I extends Exact<DeepPartial<SloCorridorStatus>, I>>(base?: I): SloCorridorStatus {
|
|
2238
|
+
return SloCorridorStatus.fromPartial(base ?? ({} as any));
|
|
2239
|
+
},
|
|
2240
|
+
fromPartial<I extends Exact<DeepPartial<SloCorridorStatus>, I>>(object: I): SloCorridorStatus {
|
|
2241
|
+
const message = createBaseSloCorridorStatus();
|
|
2242
|
+
message.groupValues = object.groupValues?.map((e) => e) || [];
|
|
2243
|
+
message.eligibleCount = object.eligibleCount ?? 0;
|
|
2244
|
+
message.goodCount = object.goodCount ?? 0;
|
|
2245
|
+
message.compliance = object.compliance ?? 0;
|
|
2246
|
+
message.budgetRemaining = object.budgetRemaining ?? 0;
|
|
2247
|
+
message.state = object.state ?? 0;
|
|
2248
|
+
return message;
|
|
2249
|
+
},
|
|
2250
|
+
};
|
|
2251
|
+
|
|
1644
2252
|
/** SloGatewayService provides web client access to SLO definitions. */
|
|
1645
2253
|
export interface SloGatewayService {
|
|
1646
2254
|
CreateSlo(request: CreateSloRequest, metadata?: Metadata): Promise<CreateSloResponse>;
|
|
@@ -1648,6 +2256,7 @@ export interface SloGatewayService {
|
|
|
1648
2256
|
ListSlos(request: ListSlosRequest, metadata?: Metadata): Promise<ListSlosResponse>;
|
|
1649
2257
|
UpdateSlo(request: UpdateSloRequest, metadata?: Metadata): Promise<UpdateSloResponse>;
|
|
1650
2258
|
DeleteSlo(request: DeleteSloRequest, metadata?: Metadata): Promise<DeleteSloResponse>;
|
|
2259
|
+
GetSloStatus(request: GetSloStatusRequest, metadata?: Metadata): Promise<GetSloStatusResponse>;
|
|
1651
2260
|
}
|
|
1652
2261
|
|
|
1653
2262
|
export const SloGatewayServiceServiceName = "gateway.web.v1.SloGatewayService";
|
|
@@ -1662,6 +2271,7 @@ export class SloGatewayServiceClientImpl implements SloGatewayService {
|
|
|
1662
2271
|
this.ListSlos = this.ListSlos.bind(this);
|
|
1663
2272
|
this.UpdateSlo = this.UpdateSlo.bind(this);
|
|
1664
2273
|
this.DeleteSlo = this.DeleteSlo.bind(this);
|
|
2274
|
+
this.GetSloStatus = this.GetSloStatus.bind(this);
|
|
1665
2275
|
}
|
|
1666
2276
|
CreateSlo(request: CreateSloRequest, metadata?: Metadata): Promise<CreateSloResponse> {
|
|
1667
2277
|
const data = CreateSloRequest.encode(request).finish();
|
|
@@ -1692,6 +2302,12 @@ export class SloGatewayServiceClientImpl implements SloGatewayService {
|
|
|
1692
2302
|
const promise = this.rpc.request(this.service, "DeleteSlo", data, metadata);
|
|
1693
2303
|
return promise.then((data) => DeleteSloResponse.decode(new BinaryReader(data)));
|
|
1694
2304
|
}
|
|
2305
|
+
|
|
2306
|
+
GetSloStatus(request: GetSloStatusRequest, metadata?: Metadata): Promise<GetSloStatusResponse> {
|
|
2307
|
+
const data = GetSloStatusRequest.encode(request).finish();
|
|
2308
|
+
const promise = this.rpc.request(this.service, "GetSloStatus", data, metadata);
|
|
2309
|
+
return promise.then((data) => GetSloStatusResponse.decode(new BinaryReader(data)));
|
|
2310
|
+
}
|
|
1695
2311
|
}
|
|
1696
2312
|
|
|
1697
2313
|
interface Rpc {
|
|
@@ -72,6 +72,28 @@ function deserialize_gateway_web_v1_GetSloResponse(buffer_arg) {
|
|
|
72
72
|
return proto_gateway_web_v1_slo_gateway_pb.GetSloResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
function serialize_gateway_web_v1_GetSloStatusRequest(arg) {
|
|
76
|
+
if (!(arg instanceof proto_gateway_web_v1_slo_gateway_pb.GetSloStatusRequest)) {
|
|
77
|
+
throw new Error('Expected argument of type gateway.web.v1.GetSloStatusRequest');
|
|
78
|
+
}
|
|
79
|
+
return Buffer.from(arg.serializeBinary());
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function deserialize_gateway_web_v1_GetSloStatusRequest(buffer_arg) {
|
|
83
|
+
return proto_gateway_web_v1_slo_gateway_pb.GetSloStatusRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function serialize_gateway_web_v1_GetSloStatusResponse(arg) {
|
|
87
|
+
if (!(arg instanceof proto_gateway_web_v1_slo_gateway_pb.GetSloStatusResponse)) {
|
|
88
|
+
throw new Error('Expected argument of type gateway.web.v1.GetSloStatusResponse');
|
|
89
|
+
}
|
|
90
|
+
return Buffer.from(arg.serializeBinary());
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function deserialize_gateway_web_v1_GetSloStatusResponse(buffer_arg) {
|
|
94
|
+
return proto_gateway_web_v1_slo_gateway_pb.GetSloStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
|
95
|
+
}
|
|
96
|
+
|
|
75
97
|
function serialize_gateway_web_v1_ListSlosRequest(arg) {
|
|
76
98
|
if (!(arg instanceof proto_gateway_web_v1_slo_gateway_pb.ListSlosRequest)) {
|
|
77
99
|
throw new Error('Expected argument of type gateway.web.v1.ListSlosRequest');
|
|
@@ -174,6 +196,17 @@ var SloGatewayServiceService = exports.SloGatewayServiceService = {
|
|
|
174
196
|
responseSerialize: serialize_gateway_web_v1_DeleteSloResponse,
|
|
175
197
|
responseDeserialize: deserialize_gateway_web_v1_DeleteSloResponse,
|
|
176
198
|
},
|
|
199
|
+
getSloStatus: {
|
|
200
|
+
path: '/gateway.web.v1.SloGatewayService/GetSloStatus',
|
|
201
|
+
requestStream: false,
|
|
202
|
+
responseStream: false,
|
|
203
|
+
requestType: proto_gateway_web_v1_slo_gateway_pb.GetSloStatusRequest,
|
|
204
|
+
responseType: proto_gateway_web_v1_slo_gateway_pb.GetSloStatusResponse,
|
|
205
|
+
requestSerialize: serialize_gateway_web_v1_GetSloStatusRequest,
|
|
206
|
+
requestDeserialize: deserialize_gateway_web_v1_GetSloStatusRequest,
|
|
207
|
+
responseSerialize: serialize_gateway_web_v1_GetSloStatusResponse,
|
|
208
|
+
responseDeserialize: deserialize_gateway_web_v1_GetSloStatusResponse,
|
|
209
|
+
},
|
|
177
210
|
};
|
|
178
211
|
|
|
179
212
|
exports.SloGatewayServiceClient = grpc.makeGenericClientConstructor(SloGatewayServiceService, 'SloGatewayService');
|