Skip to content

feat: add greengrass APIs for resource management (#7) #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions awsiot/greengrasscoreipc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,40 @@ def close(self) -> concurrent.futures.Future:
return super().close()


class ResumeComponentOperation(model._ResumeComponentOperation):
"""
ResumeComponentOperation

Create with GreengrassCoreIPCClient.new_resume_component()
"""

def activate(self, request: model.ResumeComponentRequest) -> concurrent.futures.Future:
"""
Activate this operation by sending the initial ResumeComponentRequest message.

Returns a Future which completes with a result of None if the
request is successfully written to the wire, or an exception if
the request fails to send.
"""
return self._activate(request)

def get_response(self) -> concurrent.futures.Future:
"""
Returns a Future which completes with a result of ResumeComponentResponse,
when the initial response is received, or an exception.
"""
return self._get_response()

def close(self) -> concurrent.futures.Future:
"""
Close the operation, whether or not it has completed.

Returns a Future which completes with a result of None
when the operation has closed.
"""
return super().close()


class PublishToIoTCoreOperation(model._PublishToIoTCoreOperation):
"""
PublishToIoTCoreOperation
Expand Down Expand Up @@ -1003,6 +1037,40 @@ def close(self) -> concurrent.futures.Future:
return super().close()


class PauseComponentOperation(model._PauseComponentOperation):
"""
PauseComponentOperation

Create with GreengrassCoreIPCClient.new_pause_component()
"""

def activate(self, request: model.PauseComponentRequest) -> concurrent.futures.Future:
"""
Activate this operation by sending the initial PauseComponentRequest message.

Returns a Future which completes with a result of None if the
request is successfully written to the wire, or an exception if
the request fails to send.
"""
return self._activate(request)

def get_response(self) -> concurrent.futures.Future:
"""
Returns a Future which completes with a result of PauseComponentResponse,
when the initial response is received, or an exception.
"""
return self._get_response()

def close(self) -> concurrent.futures.Future:
"""
Close the operation, whether or not it has completed.

Returns a Future which completes with a result of None
when the operation has closed.
"""
return super().close()


class CreateLocalDeploymentOperation(model._CreateLocalDeploymentOperation):
"""
CreateLocalDeploymentOperation
Expand Down Expand Up @@ -1062,6 +1130,16 @@ def new_subscribe_to_iot_core(self, stream_handler: SubscribeToIoTCoreStreamHand
"""
return self._new_operation(SubscribeToIoTCoreOperation, stream_handler)

def new_resume_component(self) -> ResumeComponentOperation:
"""
Create a new ResumeComponentOperation.

This operation will not send or receive any data until activate()
is called. Call activate() when you're ready for callbacks and
events to fire.
"""
return self._new_operation(ResumeComponentOperation)

def new_publish_to_iot_core(self) -> PublishToIoTCoreOperation:
"""
Create a new PublishToIoTCoreOperation.
Expand Down Expand Up @@ -1318,6 +1396,16 @@ def new_stop_component(self) -> StopComponentOperation:
"""
return self._new_operation(StopComponentOperation)

def new_pause_component(self) -> PauseComponentOperation:
"""
Create a new PauseComponentOperation.

This operation will not send or receive any data until activate()
is called. Call activate() when you're ready for callbacks and
events to fire.
"""
return self._new_operation(PauseComponentOperation)

def new_create_local_deployment(self) -> CreateLocalDeploymentOperation:
"""
Create a new CreateLocalDeploymentOperation.
Expand Down
Loading