ibmcloud_python_sdk.utils package¶
Submodules¶
ibmcloud_python_sdk.utils.cache module¶
- ibmcloud_python_sdk.utils.cache.client()[source]¶
Create and configure memcached client
- Returns
memcached client
- Return type
map
ibmcloud_python_sdk.utils.common module¶
- ibmcloud_python_sdk.utils.common.check_args(arguments, **kwargs)[source]¶
Check that required arguments are passed to the function
- Parameters
arguments (list) – List of required arguments
- ibmcloud_python_sdk.utils.common.query_wrapper(conn_type, method, path, headers=None, payload=None)[source]¶
Execute HTTP query and return JSON response
- Parameters
conn_type (str) – Define which URL should be used for the connection such as “iaas”, “auth”, “cis”, or “rg” (resource group)
method (str) – HTTP method that should be used such as GET, POST, PUT, DELETE, etc…
path (str) – Path used by within the query
headers (dict, optional) – Headers to send with the query is required such authentication token, content type, etc…
payload (dict, optional) – JSON payload send during the query
- Returns
JSON response
- Return type
dict
- ibmcloud_python_sdk.utils.common.resource_created(payload=None)[source]¶
Return custom JSON if a resource is created but doesn’t have output
- Parameters
payload (dict, optional) – Customize the JSON to return if needed
- Returns
A JSON dict with a message
- Return type
dict
- ibmcloud_python_sdk.utils.common.resource_deleted(payload=None)[source]¶
Return custom JSON if a resource is deleted
- Parameters
payload (dict, optional) – Customize the JSON to return if needed
- Returns
A JSON dict with a message
- Return type
dict
- ibmcloud_python_sdk.utils.common.resource_error(code, message)[source]¶
- Return custom JSON if a resource raised an exception. This will be
mostly used during try: / except: on SoftLayer resources
- Parameters
code (int) – Code to return
message – Message to return
- Returns
A JSON dict with an error message
- Return type
dict