Skip to main content

Allocations API

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

MethodHTTP requestDescription
allocations_connect_new_cloudPOST /allocations/connect/allocations/connect [POST]
allocations_create_new_allocationPOST /allocations/create/allocations/create [POST]
allocations_delete_allocationPOST /allocations/delete/allocations/delete [POST]
allocations_disconnect_cloudPOST /allocations/disconnect/allocations/disconnect [POST]
allocations_reconnect_cloudPOST /allocations/reconnect/allocations/reconnect [POST]
allocations_snapshotGET /allocations/allocations [GET]

allocations_connect_new_cloud​

AllocationCloud allocations_connect_new_cloud(user_profile=user_profile)

/allocations/connect [POST]

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

Example​

import pieces_os_client
from pieces_os_client.models.allocation_cloud import AllocationCloud
from pieces_os_client.models.user_profile import UserProfile
from pieces_os_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:1000
# See configuration.py for a list of all supported configuration parameters.
configuration = pieces_os_client.Configuration(
host="http://localhost:1000"
)


# Enter a context with an instance of the API client
with pieces_os_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pieces_os_client.AllocationsApi(api_client)
user_profile = pieces_os_client.UserProfile() # UserProfile | (optional)

try:
# /allocations/connect [POST]
api_response = api_instance.allocations_connect_new_cloud(user_profile=user_profile)
print("The response of AllocationsApi->allocations_connect_new_cloud:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AllocationsApi->allocations_connect_new_cloud: %s\n" % e)

Parameters​

NameTypeDescriptionNotes
user_profileUserProfile[optional]

Return type​

AllocationCloud

Authorization​

No authorization required

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.-

allocations_create_new_allocation​

AllocationCloud allocations_create_new_allocation(allocation_cloud=allocation_cloud)

/allocations/create [POST]

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

Example​

import pieces_os_client
from pieces_os_client.models.allocation_cloud import AllocationCloud
from pieces_os_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:1000
# See configuration.py for a list of all supported configuration parameters.
configuration = pieces_os_client.Configuration(
host="http://localhost:1000"
)


# Enter a context with an instance of the API client
with pieces_os_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pieces_os_client.AllocationsApi(api_client)
allocation_cloud = pieces_os_client.AllocationCloud() # AllocationCloud | (optional)

try:
# /allocations/create [POST]
api_response = api_instance.allocations_create_new_allocation(allocation_cloud=allocation_cloud)
print("The response of AllocationsApi->allocations_create_new_allocation:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AllocationsApi->allocations_create_new_allocation: %s\n" % e)

Parameters​

NameTypeDescriptionNotes
allocation_cloudAllocationCloud[optional]

Return type​

AllocationCloud

Authorization​

No authorization required

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

allocations_delete_allocation​

str allocations_delete_allocation(allocation_cloud=allocation_cloud)

/allocations/delete [POST]

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

Example​

import pieces_os_client
from pieces_os_client.models.allocation_cloud import AllocationCloud
from pieces_os_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:1000
# See configuration.py for a list of all supported configuration parameters.
configuration = pieces_os_client.Configuration(
host="http://localhost:1000"
)


# Enter a context with an instance of the API client
with pieces_os_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pieces_os_client.AllocationsApi(api_client)
allocation_cloud = pieces_os_client.AllocationCloud() # AllocationCloud | (optional)

try:
# /allocations/delete [POST]
api_response = api_instance.allocations_delete_allocation(allocation_cloud=allocation_cloud)
print("The response of AllocationsApi->allocations_delete_allocation:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AllocationsApi->allocations_delete_allocation: %s\n" % e)

Parameters​

NameTypeDescriptionNotes
allocation_cloudAllocationCloud[optional]

Return type​

str

Authorization​

No authorization required

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

allocations_disconnect_cloud​

str allocations_disconnect_cloud(allocation_cloud=allocation_cloud)

/allocations/disconnect [POST]

This will attempt to disconnect to a specific users cloud.

Example​

import pieces_os_client
from pieces_os_client.models.allocation_cloud import AllocationCloud
from pieces_os_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:1000
# See configuration.py for a list of all supported configuration parameters.
configuration = pieces_os_client.Configuration(
host="http://localhost:1000"
)


# Enter a context with an instance of the API client
with pieces_os_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pieces_os_client.AllocationsApi(api_client)
allocation_cloud = pieces_os_client.AllocationCloud() # AllocationCloud | (optional)

try:
# /allocations/disconnect [POST]
api_response = api_instance.allocations_disconnect_cloud(allocation_cloud=allocation_cloud)
print("The response of AllocationsApi->allocations_disconnect_cloud:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AllocationsApi->allocations_disconnect_cloud: %s\n" % e)

Parameters​

NameTypeDescriptionNotes
allocation_cloudAllocationCloud[optional]

Return type​

str

Authorization​

No authorization required

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-

allocations_reconnect_cloud​

AllocationCloud allocations_reconnect_cloud(allocation_cloud=allocation_cloud)

/allocations/reconnect [POST]

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 pieces_os_client
from pieces_os_client.models.allocation_cloud import AllocationCloud
from pieces_os_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:1000
# See configuration.py for a list of all supported configuration parameters.
configuration = pieces_os_client.Configuration(
host="http://localhost:1000"
)


# Enter a context with an instance of the API client
with pieces_os_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pieces_os_client.AllocationsApi(api_client)
allocation_cloud = pieces_os_client.AllocationCloud() # AllocationCloud | (optional)

try:
# /allocations/reconnect [POST]
api_response = api_instance.allocations_reconnect_cloud(allocation_cloud=allocation_cloud)
print("The response of AllocationsApi->allocations_reconnect_cloud:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AllocationsApi->allocations_reconnect_cloud: %s\n" % e)

Parameters​

NameTypeDescriptionNotes
allocation_cloudAllocationCloud[optional]

Return type​

AllocationCloud

Authorization​

No authorization required

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.-

allocations_snapshot​

Allocations allocations_snapshot()

/allocations [GET]

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

Example​

import pieces_os_client
from pieces_os_client.models.allocations import Allocations
from pieces_os_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:1000
# See configuration.py for a list of all supported configuration parameters.
configuration = pieces_os_client.Configuration(
host="http://localhost:1000"
)


# Enter a context with an instance of the API client
with pieces_os_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pieces_os_client.AllocationsApi(api_client)

try:
# /allocations [GET]
api_response = api_instance.allocations_snapshot()
print("The response of AllocationsApi->allocations_snapshot:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AllocationsApi->allocations_snapshot: %s\n" % e)

Parameters​

This endpoint does not need any parameters.

Return type​

Allocations

Authorization​

No authorization required

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-