Skip to main content

Projects

Projects ⇐ APIClient

Use Fonoster Projects, a capability of Fonoster, to create, update, get and delete Projects. Projects requires of a running Fonoster deployment.

Kind: global class
Extends: APIClient
See: module:core:APIClient

new Projects(options)

Constructs a new Projects object.

ParamTypeDescription
optionsClientOptionsOptions to indicate the objects endpoint

Example

const Fonoster = require("@fonoster/sdk")
const Projects = new Fonoster.Projects()

const request = {
name: "project002",
allowExperiments: false
}

projects.createProject(request)
.then(result => {
console.log(result) // successful response
}).catch(e => console.error(e)) // an error occurred

projects.listProjects(request) ⇒ Promise.<ListProjectsResponse>

Returns a list of Projects

Kind: instance method of Projects

ParamTypeDescription
requestListProjectsRequestReserved for future filters

Example

projects.listProjects({})
.then(result => {
console.log(result) // successful response
}).catch(e => console.error(e)) // an error occurred

projects.createProject(request) ⇒ Promise.<CreateProjectResponse>

Creates a new Project.

Kind: instance method of Projects

ParamTypeDescription
requestCreateProjectRequestRequest to create a new Project
request.namestringProject's name
request.allowExperimentsstringEnables experimental APIs

Example

const request = {
name: "project001",
allowExperiments: true
}

projects.createProject(request)
.then(result => {
console.log(result) // successful response
}).catch(e => console.error(e)) // an error occurred

projects.getProject(ref) ⇒ Promise.<GetProjectResponse>

Get a Project by reference.

Kind: instance method of Projects
Returns: Promise.<GetProjectResponse> - The Project
Throws:

  • if ref is null or Project does not exist
ParamTypeDescription
refstringReference to Project

Example

const ref = "507f1f77bcf86cd799439011";

projects.getProject(ref)
.then(result => {
console.log(result) // returns the Project payload
}).catch(e => console.error(e)) // an error occurred

projects.updateProject(request) ⇒ Promise.<UpdateProjectResponse>

Update a Project.

Kind: instance method of Projects

ParamTypeDescription
requestUpdateProjectRequestRequest update of an Project
request.refstringRequired reference to the Project
request.namestringValue to rename the application to
request.allowExperimentsstringEnables experimental APIs

Example

const request = {
name: "project001",
ref: "507f1f77bcf86cd799439011"
}

projects.updateProject(request)
.then(result => {
console.log(result) // returns the UpdateProjectResponse payload
}).catch(e => console.error(e)) // an error occurred

projects.deleteProject(ref)

Delete a Project.

Kind: instance method of Projects

ParamTypeDescription
refstringProject's reference

Example

const ref = "507f1f77bcf86cd799439011"

projects.deleteProject(ref)
.then(() => {
console.log("done") // returns a reference of the Project
}).catch(e => console.error(e)) // an error occurred

projects.renewAccessKeySecret(request)

Generate a new accessKeySecret. Be sure to update your applications with the new value.

Kind: instance method of Projects

ParamTypeDescription
requestLoginRequestRequest update of an Project
request.refstringProject's reference

Example

const request = {
ref: "507f1f77bcf86cd799439011"
}

projects.renewAccessKeySecret(request)
.then(result => {
console.log(result) // returns the new accessKeySecret
}).catch(e => console.error(e)) // an error occurred