Skip to main content

Allocations API

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

MethodHTTP requestDescription
allocationsConnectNewCloudPOST /allocations/connect/allocations/connect [POST]
allocationsCreateNewAllocationPOST /allocations/create/allocations/create [POST]
allocationsDeleteAllocationPOST /allocations/delete/allocations/delete [POST]
allocationsDisconnectCloudPOST /allocations/disconnect/allocations/disconnect [POST]
allocationsReconnectCloudPOST /allocations/reconnect/allocations/reconnect [POST]
allocationsSnapshotGET /allocations/allocations [GET]

allocationsConnectNewCloud​

AllocationCloud allocationsConnectNewCloud()

This will attempt to connect to a specific users cloud.(Required that the current user is logged in.)

Example​

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

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

const body: Pieces.AllocationsConnectNewCloudRequest = {
// UserProfile (optional)
userProfile: ,
};

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

Parameters​

NameTypeDescriptionNotes
userProfileUserProfile

Return type​

AllocationCloud

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-
504Gateway Timeout, request timed out.-

allocationsCreateNewAllocation​

AllocationCloud allocationsCreateNewAllocation()

This is unimplemented locally. This will create an allocation. ONLY used within the cloud.

Example​

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

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

const body: Pieces.AllocationsCreateNewAllocationRequest = {
// AllocationCloud (optional)
allocationCloud: ,
};

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

Parameters​

NameTypeDescriptionNotes
allocationCloudAllocationCloud

Return type​

AllocationCloud

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

allocationsDeleteAllocation​

string allocationsDeleteAllocation()

This is unimplemented locally. This will delete an allocation. ONLY used within the cloud.

Example​

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

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

const body: Pieces.AllocationsDeleteAllocationRequest = {
// AllocationCloud (optional)
allocationCloud: ,
};

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

Parameters​

NameTypeDescriptionNotes
allocationCloudAllocationCloud

Return type​

string

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

allocationsDisconnectCloud​

string allocationsDisconnectCloud()

This will attempt to disconnect to a specific users cloud.

Example​

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

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

const body: Pieces.AllocationsDisconnectCloudRequest = {
// AllocationCloud (optional)
allocationCloud: ,
};

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

Parameters​

NameTypeDescriptionNotes
allocationCloudAllocationCloud

Return type​

string

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK, this will return the uuid of the cloud that was disconnected!-
500Internal Server Error-

allocationsReconnectCloud​

AllocationCloud allocationsReconnectCloud()

This will attempt to reconnect to a users cloud. This will ensure that we are connected to a users cloud and will ensure that all the data associated with a user's cloud is up-to-date.

Example​

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

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

const body: Pieces.AllocationsReconnectCloudRequest = {
// AllocationCloud (optional)
allocationCloud: ,
};

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

Parameters​

NameTypeDescriptionNotes
allocationCloudAllocationCloud

Return type​

AllocationCloud

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-
504Gateway Timeout, request timed out.-

allocationsSnapshot​

Allocations allocationsSnapshot()

This is going to get a snapshot of all of the connected allocations.

Example​

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

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

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

Parameters​

This endpoint does not need any parameters.

Return type​

Allocations

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-