SoftLayer.messaging

Manager for the SoftLayer Message Queue service

license:MIT, see LICENSE for more details.
class SoftLayer.managers.messaging.MessagingConnection(account_id, endpoint=None)[source]

Message Queue Service Connection.

Parameters:
  • account_id – Message Queue Account id
  • endpoint – Endpoint URL
authenticate(username, api_key, auth_token=None)[source]

Authenticate this connection using the given credentials.

Parameters:
  • username – SoftLayer username
  • api_key – SoftLayer API Key
  • auth_token – (optional) Starting auth token
create_queue(queue_name, **kwargs)[source]

Create Queue.

Parameters:
  • queue_name – Queue Name
  • **kwargs (dict) – queue options
create_subscription(topic_name, subscription_type, **kwargs)[source]

Create Subscription.

Parameters:
  • topic_name – Topic Name
  • subscription_type – type (‘queue’ or ‘http’)
  • **kwargs (dict) – Subscription options
create_topic(topic_name, **kwargs)[source]

Create Topic.

Parameters:
  • topic_name – Topic Name
  • **kwargs (dict) – Topic options
delete_message(queue_name, message_id)[source]

Delete a message.

Parameters:
  • queue_name – Queue Name
  • message_id – Message id
delete_queue(queue_name, force=False)[source]

Delete Queue.

Parameters:
  • queue_name – Queue Name
  • force – (optional) Force queue to be deleted even if there are pending messages
delete_subscription(topic_name, subscription_id)[source]

Delete a subscription.

Parameters:
  • topic_name – Topic Name
  • subscription_id – Subscription id
delete_topic(topic_name, force=False)[source]

Delete Topic.

Parameters:
  • topic_name – Topic Name
  • force – (optional) Force topic to be deleted even if there are attached subscribers
get_queue(queue_name)[source]

Get queue details.

Parameters:queue_name – Queue Name
get_queues(tags=None)[source]

Get listing of queues.

Parameters:tags (list) – (optional) list of tags to filter by
get_subscriptions(topic_name)[source]

Listing of subscriptions on a topic.

Parameters:topic_name – Topic Name
get_topic(topic_name)[source]

Get topic details.

Parameters:topic_name – Topic Name
get_topics(tags=None)[source]

Get listing of topics.

Parameters:tags (list) – (optional) list of tags to filter by
modify_queue(queue_name, **kwargs)[source]

Modify Queue.

Parameters:
  • queue_name – Queue Name
  • **kwargs (dict) – queue options
modify_topic(topic_name, **kwargs)[source]

Modify Topic.

Parameters:
  • topic_name – Topic Name
  • **kwargs (dict) – Topic options
pop_message(queue_name)[source]

Pop a single message from a queue.

If no messages are returned this returns None

Parameters:queue_name – Queue Name
pop_messages(queue_name, count=1)[source]

Pop messages from a queue.

Parameters:
  • queue_name – Queue Name
  • count – (optional) number of messages to retrieve
push_queue_message(queue_name, body, **kwargs)[source]

Create Queue Message.

Parameters:
  • queue_name – Queue Name
  • body – Message body
  • **kwargs (dict) – Message options
push_topic_message(topic_name, body, **kwargs)[source]

Create Topic Message.

Parameters:
  • topic_name – Topic Name
  • body – Message body
  • **kwargs (dict) – Topic message options
stats(period='hour')[source]

Get account stats.

Parameters:period – ‘hour’, ‘day’, ‘week’, ‘month’
class SoftLayer.managers.messaging.MessagingManager(client)[source]

Manage SoftLayer Message Queue accounts.

See product information here: http://www.softlayer.com/message-queue

Parameters:client (SoftLayer.API.BaseClient) – the client instance
get_connection(account_id, datacenter=None, network=None)[source]

Get connection to Message Queue Service.

Parameters:
  • account_id – Message Queue Account id
  • datacenter – Datacenter code
  • network – network (‘public’ or ‘private’)
get_endpoint(datacenter=None, network=None)[source]

Get a message queue endpoint based on datacenter/network type.

Parameters:
  • datacenter – datacenter code
  • network – network (‘public’ or ‘private’)
get_endpoints()[source]

Get all known message queue endpoints.

list_accounts(**kwargs)[source]

List message queue accounts.

Parameters:**kwargs (dict) – response-level options (mask, limit, etc.)
ping(datacenter=None, network=None)[source]

Ping a message queue endpoint.

class SoftLayer.managers.messaging.QueueAuth(endpoint, username, api_key, auth_token=None)[source]

SoftLayer Message Queue authentication for requests.

Parameters:
  • endpoint – endpoint URL
  • username – SoftLayer username
  • api_key – SoftLayer API Key
  • auth_token – (optional) Starting auth token
auth()[source]

Authenticate.

handle_error(resp, **_)[source]

Handle errors.