Skip to main content

Distributions API

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

MethodHTTP requestDescription
distributionsCreateNewDistributionPOST /distributions/create/distributions/create [POST]
distributionsDeleteSpecificDistributionPOST /distributions/{distribution}/delete/distributions/{distribution}/delete [POST]
distributionsSnapshotGET /distributions/distributions [GET]

distributionsCreateNewDistribution

Distribution distributionsCreateNewDistribution()

This will create a new distribution.

Example

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

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

const body: Pieces.DistributionsCreateNewDistributionRequest = {
// SeededDistribution | (optional)
seededDistribution: ,
};

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

Parameters

NameTypeDescriptionNotes
seededDistributionSeededDistribution

Return type

Distribution

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

distributionsDeleteSpecificDistribution

distributionsDeleteSpecificDistribution()

This will delete a specific distribution.

Example

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

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

const body: Pieces.DistributionsDeleteSpecificDistributionRequest = {
// string | This is the uuid of a specific distribution.
distribution: distribution_example,
};

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

Parameters

NameTypeDescriptionNotes
distribution[string]This is the uuid of a specific distribution.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-

distributionsSnapshot

Distributions distributionsSnapshot()

This will get a specific snapshot of all our distributions.

Example

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

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

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

Parameters

This endpoint does not need any parameters.

Return type

Distributions

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-