@canonical/jujulib
Version:
Juju API client
109 lines (107 loc) • 3.04 kB
TypeScript
/**
Juju MeterStatus version 2.
This facade is available on:
Controller-machine-agent
Machine-agent
Unit-agent
Models
NOTE: This file was generated using the Juju schema
from Juju 3.3 at the git SHA 65fa4c1ee5.
Do not manually edit this file.
*/
import { ConnectionInfo, Transport } from "../../client.js";
import { Facade } from "../../types.js";
export interface Entities {
entities: Entity[];
}
export interface Entity {
tag: string;
}
export interface Error {
code: string;
info?: AdditionalProperties;
message: string;
}
export interface ErrorResult {
error?: Error;
}
export interface ErrorResults {
results: ErrorResult[];
}
export interface MeterStatusResult {
code: string;
error?: Error;
info: string;
}
export interface MeterStatusResults {
results: MeterStatusResult[];
}
export interface NotifyWatchResult {
NotifyWatcherId: string;
error?: Error;
}
export interface NotifyWatchResults {
results: NotifyWatchResult[];
}
export interface SetUnitStateArg {
"charm-state"?: Record<string, string>;
"meter-status-state"?: string;
"relation-state"?: Record<string, string>;
"secret-state"?: string;
"storage-state"?: string;
tag: string;
"uniter-state"?: string;
}
export interface SetUnitStateArgs {
args: SetUnitStateArg[];
}
export interface UnitStateResult {
"charm-state"?: Record<string, string>;
error?: Error;
"meter-status-state"?: string;
"relation-state"?: Record<string, string>;
"secret-state"?: string;
"storage-state"?: string;
"uniter-state"?: string;
}
export interface UnitStateResults {
results: UnitStateResult[];
}
export interface AdditionalProperties {
[key: string]: any;
}
/**
MeterStatusAPI implements the MeterStatus interface and is the concrete
implementation of the API endpoint. Additionally, it embeds
common.UnitStateAPI to allow meter status workers to access their
controller-backed internal state.
*/
declare class MeterStatusV2 implements Facade {
static NAME: string;
static VERSION: number;
NAME: string;
VERSION: number;
_transport: Transport;
_info: ConnectionInfo;
constructor(transport: Transport, info: ConnectionInfo);
/**
GetMeterStatus returns meter status information for each unit.
*/
getMeterStatus(params: Entities): Promise<MeterStatusResults>;
/**
SetState sets the state persisted by the charm running in this unit
and the state internal to the uniter for this unit.
*/
setState(params: SetUnitStateArgs): Promise<ErrorResults>;
/**
State returns the state persisted by the charm running in this unit
and the state internal to the uniter for this unit.
*/
state(params: Entities): Promise<UnitStateResults>;
/**
WatchMeterStatus returns a NotifyWatcher for observing changes
to each unit's meter status.
*/
watchMeterStatus(params: Entities): Promise<NotifyWatchResults>;
}
export default MeterStatusV2;