-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add poll commands to cli * increase version
- Loading branch information
Showing
5 changed files
with
55 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
""" | ||
PyEPP Package | ||
""" | ||
__version__ = "0.0.7-alpha.1" | ||
__version__ = "0.0.7-alpha.2" | ||
|
||
from pyepp.epp import EppCommunicator, EppResultCode, EppCommunicatorException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
EPP Poll cli module | ||
""" | ||
import click | ||
|
||
from pyepp.poll import Poll | ||
|
||
|
||
@click.group(name='poll') | ||
@click.pass_context | ||
def poll_group(ctx): | ||
""" To manage registry service messages.""" | ||
ctx.obj.registry_object = Poll(ctx.obj.epp) | ||
|
||
|
||
@click.command(name='request') | ||
@click.option('--client-transaction-id') | ||
@click.pass_context | ||
def poll_request(ctx, client_transaction_id): | ||
"""This command is to check and retrieve queued service messages as wel as keep the | ||
connection alive.""" | ||
result = ctx.obj.request(client_transaction_id=client_transaction_id) | ||
click.echo(result) | ||
|
||
|
||
@click.command(name='acknowledge') | ||
@click.argument('message-id') | ||
@click.option('--client-transaction-id') | ||
@click.pass_context | ||
def poll_acknowledge(ctx, message_id,client_transaction_id): | ||
"""This command will acknowledge and remove a message from the poll queue so that registrars can run another | ||
poll request to get the next message in line if one exists. | ||
MESSAGE_ID: Request message id | ||
""" | ||
result = ctx.obj.acknowledge(message_id, | ||
client_transaction_id=client_transaction_id) | ||
click.echo(result) | ||
|
||
|
||
poll_group.add_command(poll_request) | ||
poll_group.add_command(poll_acknowledge) |