Skip to main content

Ranges API

All URIs are relative to http://localhost:1000

MethodHTTP requestDescription
rangesCreateNewRangePOST /ranges/create/ranges/create [POST]
rangesDeleteSpecificRangePOST /ranges/{range}/delete/ranges/{range}/delete [POST]
rangesSnapshotGET /ranges/ranges [GET]

rangesCreateNewRange​

Range rangesCreateNewRange()

This will create a new Range in the database.

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.RangesApi(configuration)

const body: Pieces.RangesCreateNewRangeRequest = {
// SeededRange (optional)
seededRange: ,
};

apiInstance.rangesCreateNewRange(body).then((data: Range) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
seededRangeSeededRange

Return type​

Range

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json, text/plain

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

rangesDeleteSpecificRange​

rangesDeleteSpecificRange()

This will delete a specific range from the database!

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.RangesApi(configuration)

const body: Pieces.RangesDeleteSpecificRangeRequest = {
// string | This is a identifier that is used to identify a specific range.
range: range_example,
};

apiInstance.rangesDeleteSpecificRange(body).then((data: void (empty response body)) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
range[string]This is a identifier that is used to identify a specific range.defaults to undefined

Return type​

void (empty response body)

HTTP request headers​

  • Content-Type: Not defined
  • Accept: text/plain

HTTP response details​

Status codeDescriptionResponse headers
204No Content-
500Internal Server Error-

rangesSnapshot​

Ranges rangesSnapshot()

This will get a snapshot of all your ranges.

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.RangesApi(configuration)

apiInstance.rangesSnapshot().then((data: Ranges) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

This endpoint does not need any parameters.

Return type​

Ranges

HTTP request headers​

  • Content-Type: Not defined
  • Accept: application/json, text/plain

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-