CLI Commands

Iniesta provides some commands available for just testing out your implementation of Iniesta and also some helper commands for determining how your application is set up.

To get initialization type

$ iniesta initialization-type
InitializationTypes.SNS_PRODUCER|EVENT_POLLING

The returned values are:

  • InitializationTypes.0

  • InitializationTypes.QUEUE_POLLING

  • InitializationTypes.EVENT_POLLING

  • InitializationTypes.SNS_PRODUCER

  • InitializationTypes.CUSTOM

or a combination of them. eg

  • InitializationTypes.SNS_PRODUCER|EVENT_POLLING

To get filter policies

if INIESTA_SQS_CONSUMER_FILTERS = ['some.*']

$ iniesta filter-policies
{"iniesta_pass": [{"prefix": "some."}]}

This is in the format that AWS’s subscribe API requires.

Test publishing

A CLI for sending a message to the default SNS Topic.

Requirements:

$ iniesta publish --help
Usage: iniesta publish [OPTIONS]

Options:
  -e, --event TEXT       Event to publish into SNS  [required]
  -m, --message TEXT     Message body to publish into SNS
  -v, --version INTEGER  Version to publish into SNS
  --help                 Show this message and exit.

Example

$ iniesta publish -e hello.iniesta
Publish Success!


REQUEST INFO
Message Event : hello.iniesta
Message Data : {}
Full Payload : {'MessageAttributes': {'iniesta_pass': {'DataType': 'String', 'StringValue': 'hello.iniesta'}, 'version': {'DataType': 'Number', 'StringValue': '1'}}, 'Message': '{}', 'MessageStructure': 'string'}
Message Length : 183


RESPONSE INFO
Message ID : 4e2585df-dc90-49b5-a40f-10fac01c23aa
Message Length : 291

Test sending message to SQS

To send a custom message to the default queue.

$ iniesta send --help
Usage: iniesta send [OPTIONS]

Options:
  -m, --message TEXT  Message body to publish to SQS
  --help              Show this message and exit.

Example

$ iniesta send
Message Sent
MessageId: 0692141a-aee4-93fc-9b12-f0f5c5f313ac