readycloud package¶
Submodules¶
readycloud.decorators module¶
readycloud.exceptions module¶
readycloud.readycloud module¶
readycloud.readycloud¶
Module which contains ReadyCloud class.
-
class
readycloud.readycloud.ReadyCloud(token, host='https://readycloud.com/', org_id=None, api='v2')[source]¶ Bases:
objectClass for working with ReadyCloud API.
-
API_V1= 'v1'¶
-
API_V2= 'v2'¶
-
create_order(order)[source]¶ Create a new order.
Parameters: order (dict) – dict structure of order Returns: dict – dictionary with response
-
create_orders_webhook(url)[source]¶ Create new webhook for orders.
Parameters: url (str) – URL to which RS should post updated for orders Returns: dict – dictionary with response
-
create_webhook(entity, url)[source]¶ Create new webhook.
Parameters: - entity (str) – Entity for which you want to register webhook
- url (str) – URL to which RC should post updates for registered entity
Returns: dict – dictionary with response
-
delete(*args, **kwargs)[source]¶ Do DELETE request to ReadyCloud.
Parameters: url (str) – URL to which you want to do request Returns: dict – dictionary with response
-
delete_order(order_id)[source]¶ Delete order
Parameters: order_id (str) – order id for delete Returns: dict – dictionary with response
-
delete_webhook(webhook_id)[source]¶ Delete webhook
Parameters: webhook_id (int) – webhook id for delete Returns: dict – dictionary with response
-
get(*args, **kwargs)[source]¶ Do GET request to ReadyCloud.
Parameters: - url (str) – URL to which you want to do request
- params (dict) – dict with request params
Returns: dict – dictionary with response
-
get_order_url(order_id)[source]¶ Get orders endpoint URL for specified order_id
Parameters: order_id (str) – order id Returns: str – absolute URL to order endpoint
-
get_orders(**kwargs)[source]¶ Get orders.
Parameters: kwargs (dict) – filters, limit, offset, etc. Returns: dict – dictionary with response
-
get_organization(org_id)[source]¶ Get organization. :param str org_id: hexahexacontadecimal encoded organization id :returns: dict – dictionary with response
-
get_organization_url(org_id)[source]¶ Get organization endpoint URL :param str org_id: hexahexacontadecimal encoded organization id :returns: str – absolute URL to organization endpoint
-
get_organizations(**kwargs)[source]¶ Get organization. :param dict kwargs: filters, limit, offset, etc. :returns: dict – dictionary with response
-
get_organizations_url()[source]¶ Get organizations endpoint URL :returns: str – absolute URL to organizations endpoint
-
get_webhook_url(webhook_id)[source]¶ Get webhooks endpoint URL for specified webhook_id
Parameters: webhook_id (int) – webhook id Returns: str – absolute URL to webhook endpoint
-
get_webhooks(**kwargs)[source]¶ Get list of registered webhooks :param dict kwargs: filters, limit, offset, etc.
Returns: dict – dictionary with response
-
get_webhooks_url()[source]¶ Get webhooks endpoint URL.
Returns: str – absolute URL to webhooks endpoint
-
patch(*args, **kwargs)[source]¶ Do PATCH request to ReadyCloud.
Parameters: - url (str) – URL to which you want to do request
- data (dict) – dict with data which you want to PUT
Returns: dict – dictionary with response
-
post(*args, **kwargs)[source]¶ Do POST request to ReadyCloud.
Parameters: - url (str) – URL to which you want to do request
- data (dict) – dict with POST data
Returns: dict – dictionary with response
-
put(*args, **kwargs)[source]¶ Do PUT request to ReadyCloud.
Parameters: - url (str) – URL to which you want to do request
- data (dict) – dict with data which you want to PUT
Returns: dict – dictionary with response
-
update_order(order_id, order)[source]¶ Update an existing order.
Parameters: - order_id (str) – order id
- order (dict) – dict structure of order
Returns: dict – dictionary with response
-
readycloud.utils module¶
readycloud.utils¶
Module which contains different utils, helpers, etc.