Skip to main content
Module

x/arubaos_cx/mod.ts>Client

ArubaOS-CX REST API client for Deno.
Go to Latest
class Client
import { Client } from "https://deno.land/x/arubaos_cx@v1.0.1/mod.ts";

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

Example:

import { Client } from "https://deno.land/x/arubaos_cx@$VERSION/mod.ts";

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.