Skip to main content

Class: AIGatewayDeploymentsClient

Defined in: src/ai-gateway/deployments-client.ts:27

Client for AI Gateway deployment operations (admin plane).

Constructors

Constructor

new AIGatewayDeploymentsClient(opts): AIGatewayDeploymentsClient;

Defined in: src/ai-gateway/deployments-client.ts:32

Parameters

ParameterType
optsAIGatewaySubClientOptions

Returns

AIGatewayDeploymentsClient

Methods

list()

list(): Promise<objectOutputType<{
object: ZodString;
total: ZodNumber;
has_more: ZodOptional<ZodBoolean>;
data: ZodArray<ZodObject<{
id: ZodString;
name: ZodString;
slug: ZodString;
type: ZodString;
status: ZodString;
created_at: ZodString;
last_updated_at: ZodString;
last_synced_at: ZodNullable<ZodString>;
last_resynced_at: ZodNullable<ZodString>;
is_default: ZodNumber;
created_by: ZodString;
object: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
id: ZodString;
name: ZodString;
slug: ZodString;
type: ZodString;
status: ZodString;
created_at: ZodString;
last_updated_at: ZodString;
last_synced_at: ZodNullable<ZodString>;
last_resynced_at: ZodNullable<ZodString>;
is_default: ZodNumber;
created_by: ZodString;
object: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
id: ZodString;
name: ZodString;
slug: ZodString;
type: ZodString;
status: ZodString;
created_at: ZodString;
last_updated_at: ZodString;
last_synced_at: ZodNullable<ZodString>;
last_resynced_at: ZodNullable<ZodString>;
is_default: ZodNumber;
created_by: ZodString;
object: ZodString;
}, ZodTypeAny, "passthrough">>, "many">;
}, ZodTypeAny, "passthrough">>;

Defined in: src/ai-gateway/deployments-client.ts:56

List deployments.

Returns

Promise<objectOutputType<{ object: ZodString; total: ZodNumber; has_more: ZodOptional<ZodBoolean>; data: ZodArray<ZodObject<{ id: ZodString; name: ZodString; slug: ZodString; type: ZodString; status: ZodString; created_at: ZodString; last_updated_at: ZodString; last_synced_at: ZodNullable<ZodString>; last_resynced_at: ZodNullable<ZodString>; is_default: ZodNumber; created_by: ZodString; object: ZodString; }, "passthrough", ZodTypeAny, objectOutputType<{ id: ZodString; name: ZodString; slug: ZodString; type: ZodString; status: ZodString; created_at: ZodString; last_updated_at: ZodString; last_synced_at: ZodNullable<ZodString>; last_resynced_at: ZodNullable<ZodString>; is_default: ZodNumber; created_by: ZodString; object: ZodString; }, ZodTypeAny, "passthrough">, objectInputType<{ id: ZodString; name: ZodString; slug: ZodString; type: ZodString; status: ZodString; created_at: ZodString; last_updated_at: ZodString; last_synced_at: ZodNullable<ZodString>; last_resynced_at: ZodNullable<ZodString>; is_default: ZodNumber; created_by: ZodString; object: ZodString; }, ZodTypeAny, "passthrough">>, "many">; }, ZodTypeAny, "passthrough">>

All deployments, active and archived.

Remarks

Archived deployments are included — delete() is a soft-delete. Filter on status === 'active' if you only want live ones.

Example

import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
const gw = new AIGatewayClient();

const all = await gw.deployments.list();
const live = all.data.filter((d) => d.status === 'active');
// live[0] => { name: 'talos', slug: 'dp-talos-f3b74e', status: 'active', ... }

get()

get(deploymentId): Promise<objectOutputType<{
id: ZodString;
name: ZodString;
slug: ZodString;
type: ZodString;
status: ZodString;
created_at: ZodString;
last_updated_at: ZodString;
last_synced_at: ZodNullable<ZodString>;
last_resynced_at: ZodNullable<ZodString>;
is_default: ZodNumber;
created_by: ZodString;
object: ZodString;
} & {
credentials: ZodOptional<ZodObject<{
username: ZodString;
password: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
username: ZodString;
password: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
username: ZodString;
password: ZodString;
}, ZodTypeAny, "passthrough">>>;
deployment_config: ZodNullable<ZodRecord<ZodString, ZodUnknown>>;
auth_settings: ZodOptional<ZodObject<{
disable_portkey_gateway: ZodNumber;
workspaces_allowed: ZodArray<ZodString, "many">;
allow_all_workspaces: ZodNumber;
}, "passthrough", ZodTypeAny, objectOutputType<{
disable_portkey_gateway: ZodNumber;
workspaces_allowed: ZodArray<ZodString, "many">;
allow_all_workspaces: ZodNumber;
}, ZodTypeAny, "passthrough">, objectInputType<{
disable_portkey_gateway: ZodNumber;
workspaces_allowed: ZodArray<ZodString, "many">;
allow_all_workspaces: ZodNumber;
}, ZodTypeAny, "passthrough">>>;
client_auth: ZodOptional<ZodString>;
workspaces: ZodOptional<ZodArray<ZodObject<{
id: ZodString;
slug: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
id: ZodString;
slug: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
id: ZodString;
slug: ZodString;
}, ZodTypeAny, "passthrough">>, "many">>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/ai-gateway/deployments-client.ts:80

Fetch one deployment.

Parameters

ParameterTypeDescription
deploymentIdstringDeployment UUID.

Returns

Promise<objectOutputType<{ id: ZodString; name: ZodString; slug: ZodString; type: ZodString; status: ZodString; created_at: ZodString; last_updated_at: ZodString; last_synced_at: ZodNullable<ZodString>; last_resynced_at: ZodNullable<ZodString>; is_default: ZodNumber; created_by: ZodString; object: ZodString; } & { credentials: ZodOptional<ZodObject<{ username: ZodString; password: ZodString; }, "passthrough", ZodTypeAny, objectOutputType<{ username: ZodString; password: ZodString; }, ZodTypeAny, "passthrough">, objectInputType<{ username: ZodString; password: ZodString; }, ZodTypeAny, "passthrough">>>; deployment_config: ZodNullable<ZodRecord<ZodString, ZodUnknown>>; auth_settings: ZodOptional<ZodObject<{ disable_portkey_gateway: ZodNumber; workspaces_allowed: ZodArray<ZodString, "many">; allow_all_workspaces: ZodNumber; }, "passthrough", ZodTypeAny, objectOutputType<{ disable_portkey_gateway: ZodNumber; workspaces_allowed: ZodArray<ZodString, "many">; allow_all_workspaces: ZodNumber; }, ZodTypeAny, "passthrough">, objectInputType<{ disable_portkey_gateway: ZodNumber; workspaces_allowed: ZodArray<ZodString, "many">; allow_all_workspaces: ZodNumber; }, ZodTypeAny, "passthrough">>>; client_auth: ZodOptional<ZodString>; workspaces: ZodOptional<ZodArray<ZodObject<{ id: ZodString; slug: ZodString; }, "passthrough", ZodTypeAny, objectOutputType<{ id: ZodString; slug: ZodString; }, ZodTypeAny, "passthrough">, objectInputType<{ id: ZodString; slug: ZodString; }, ZodTypeAny, "passthrough">>, "many">>; }, ZodTypeAny, "passthrough">>

Deployment detail, including bound workspaces and masked credentials.

Example

import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
const gw = new AIGatewayClient();

const d = await gw.deployments.get('32e8314e-7e68-4384-aacb-a476f6c3f91d');
// d.auth_settings?.allow_all_workspaces => 1 (a number, not a boolean)

create()

create(body): Promise<objectOutputType<{
id: ZodString;
client_auth: ZodString;
credentials: ZodObject<{
username: ZodString;
password: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
username: ZodString;
password: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
username: ZodString;
password: ZodString;
}, ZodTypeAny, "passthrough">>;
organisation_id: ZodString;
object: ZodString;
}, ZodTypeAny, "passthrough">>;

Defined in: src/ai-gateway/deployments-client.ts:121

Create a deployment.

Parameters

ParameterTypeDescription
bodyGatewayDeploymentCreateRequestName, type, TSG, and auth settings.

Returns

Promise<objectOutputType<{ id: ZodString; client_auth: ZodString; credentials: ZodObject<{ username: ZodString; password: ZodString; }, "passthrough", ZodTypeAny, objectOutputType<{ username: ZodString; password: ZodString; }, ZodTypeAny, "passthrough">, objectInputType<{ username: ZodString; password: ZodString; }, ZodTypeAny, "passthrough">>; organisation_id: ZodString; object: ZodString; }, ZodTypeAny, "passthrough">>

The creation receipt including the deployment's gateway credentials.

Remarks

The response is a creation receipt, not a deployment record — it has 5 fields and carries no name, slug, or status. Call get for the full record.

This is the only time credentials.password and client_auth are readable; the detail read masks them. Capture them here or they are unrecoverable. Never log them. Note that setting PANW_AI_SEC_DEBUG will print the raw request/response, including credentials.password, to the SDK's own debug log regardless of this warning.

Example

import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
const gw = new AIGatewayClient();

const receipt = await gw.deployments.create({
name: 'prod-us',
type: 'production',
organisation_id: '1852583913',
auth_settings: { allow_all_workspaces: true },
});
// receipt => { id: '2141...', client_auth: 'client-auth-...', credentials: { username, password }, ... }
const full = await gw.deployments.get(receipt.id);

delete()

delete(deploymentId, organisationId): Promise<void>;

Defined in: src/ai-gateway/deployments-client.ts:157

Archive a deployment.

Parameters

ParameterTypeDescription
deploymentIdstringDeployment UUID.
organisationIdstringThe TSG as a numeric string; sent as a query param.

Returns

Promise<void>

Nothing.

Remarks

This is a soft delete — the one exception to the gateway's usual delete semantics. The API returns 200 with an empty body and the record persists with status: 'archived', still visible in list. There is no observed hard-delete for deployments specifically. Contrast with configs.delete, guardrails.delete, and providers.delete, all of which hard-delete — do not assume archive-on-delete is a gateway-wide convention.

Example

import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
const gw = new AIGatewayClient();

await gw.deployments.delete('21414819-485e-4ba3-b3d3-3e1815580e43', '1852583913');
// the record remains in list() with status 'archived'