Skip to main content
Module

x/arubaos_cx/mod.ts>Client

Authenticate and interact with the ArubaOS-CX REST API using Deno.
Go to Latest
class Client
import { Client } from "https://deno.land/x/arubaos_cx@v0.0.7/mod.ts";

Contains methods for logging in/out and making authenticated requests. Recommended for multiple requests.

Example:

const client = new Client({ host: "10.20.30.40" });
await client.login();
const response1 = await client.fetch("/system");
const response2 = await client.fetch("/firmware");
...
await client.logout();

Constructors

new
Client(init: ClientInit)

Methods

fetch(path: string, init?: RequestInit): Promise<Response>

Performs an authenticated request.

fetchOnce(path: string, init?: RequestInit): Promise<Response>

Performs a request inbetween automatic login/logout.

login(): Promise<void>

Logs the user in and stores the authentication cookie.

logout(): Promise<void>

Logs the user out and removes the authentication cookie.