opsi-api / Exports / implements/product / Product

# Class: Product

implements/product.Product

# Implemented by

# Table of contents

# Constructors

# Methods

# Constructors

# constructor

new Product()

# Methods

# getAllActionsForProduct

getAllActionsForProduct(productid, serverid): Promise<IfcResult>

Get all actions for one product.

example

const server = await api.getServerIDs();
const { success, data, message } = await api.getAllActionsForProduct('swaudit', server.data[0]);
console.log(success) // if all data are ok then this should return true else false
console.log(message) // message is empty if success is true. if success is false there is a error message
console.log(data) // array of product actions

api.serverIDs() api.actionsForProduct('', servers[0])

# Parameters

Name Type Description
productid string Any id string.
serverid number Serverid string that gets from serverIDs.

# Returns

Promise<IfcResult>

Data.

# Defined in

implements/product.ts:71 (opens new window)


# getAllProducts

getAllProducts(): Promise<IfcResult>

Get all installed products from opsi depot.

example

const { success, data, message } = await api.getAllProducts()
console.log(success) // if all data are ok then this should return true else false
console.log(message) // message is empty if success is true. if success is false there is a error message
console.log(data) // array of opsi products

# Returns

Promise<IfcResult>

Data.

# Defined in

implements/product.ts:18 (opens new window)


# getClientsWithOutdatedVersion

getClientsWithOutdatedVersion(productid): Promise<IfcResult>

Get all clients with outdated software version for one product.

example

const { success, data, message } = await api.getClientsWithOutdatedVersion('swaudit');
console.log(success) // if all data are ok then this should return true else false
console.log(message) // message is empty if success is true. if success is false there is a error message
console.log(data) // array of client ids

# Parameters

Name Type Description
productid string Any id string.

# Returns

Promise<IfcResult>

Data.

# Defined in

implements/product.ts:89 (opens new window)


# getProductInfo

getProductInfo(productId): Promise<IfcResult>

get detailed Product infos

example

const { success, data, message } = await api.getProductInfo('swaudit')
console.log(success) // if all data are ok then this should return true else false
console.log(message) // message is empty if success is true. if success is false there is a error message
console.log(data) // object of detailed product information

# Parameters

Name Type
productId any

# Returns

Promise<IfcResult>

# Defined in

implements/product.ts:36 (opens new window)


# updateOutdatedClients

updateOutdatedClients(productid): Promise<IfcResult>

Update clients with outdated software.

example

const { success, data, message } = await api.updateOutdatedClients('swaudit');
console.log(success) // if all data are ok then this should return true else false
console.log(message) // message is empty if success is true. if success is false there is a error message
console.log(data) // array of client ids

# Parameters

Name Type Description
productid string Any id string.

# Returns

Promise<IfcResult>

Data.

# Defined in

implements/product.ts:107 (opens new window)