Class: AddOnData
AddOnData class provides APIs to read, write, remove private metadata to a Node. This metadata is accessible only to the add-on that has set it.
Extends
unknown
Constructors
Constructor
new AddOnData(): AddOnData;
Returns
AddOnData
Inherited from
ProxyLiveObject.constructor
Accessors
remainingQuota
Get Signature
get remainingQuota(): Readonly<{
sizeInBytes: number;
numKeys: number;
}>;
Returns
Readonly<{ sizeInBytes: number; numKeys: number; }>
an object with the remaining quota for private metadata on the node for this add-on. The object contains the following properties:
- sizeInBytes: The remaining quota size in bytes (maximum 3KB).
- numKeys: The remaining quota for the number of keys (maximum 20 keys).
Methods
setItem()
setItem(key, value): void;
Sets a private metadata entry on the node.
Parameters
keystringvaluestringReturns
void
getItem()
getItem(key): string | undefined;
Retrieves the private metadata value for the specified key on the node.
Parameters
keystringReturns
string | undefined
The value of the private metadata entry.
removeItem()
removeItem(key): void;
Removes a single private metadata entry on the node.
Parameters
keystringReturns
void
clear()
clear(): void;
Clears all private metadata entries on the node.
Returns
void
keys()
keys(): string[];
Returns
string[]
an array of all keys for the private metadata entries on the node.
[iterator]()
iterator: Iterator<[string, string]>;
Returns
Iterator<[string, string]>
an iterator for all the private metadata entries on the node. The iterator yields the metadata key-value pairs.