diff --git a/awsiot/greengrasscoreipc/client.py b/awsiot/greengrasscoreipc/client.py index a1cf371e..3f040bb0 100644 --- a/awsiot/greengrasscoreipc/client.py +++ b/awsiot/greengrasscoreipc/client.py @@ -1343,7 +1343,6 @@ class GreengrassCoreIPCClient(rpc.Client): Client for the GreengrassCoreIPC service. When finished with the client, you must call close() to free the client's native resources. - There is a new V2 client which should be preferred. See the GreengrassCoreIPCClientV2 class in the clientv2 subpackage. diff --git a/awsiot/greengrasscoreipc/model.py b/awsiot/greengrasscoreipc/model.py index 4b1fe284..b7549dab 100644 --- a/awsiot/greengrasscoreipc/model.py +++ b/awsiot/greengrasscoreipc/model.py @@ -290,6 +290,8 @@ class MessageContext(rpc.Shape): """ MessageContext + The context is ignored if used in PublishMessage. + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: @@ -6888,6 +6890,10 @@ def _response_stream_type(cls): class _CancelLocalDeploymentOperation(rpc.ClientOperation): + """ + Cancel a local deployment on the device. + """ + @classmethod def _model_name(cls): return 'aws.greengrass#CancelLocalDeployment' @@ -6932,6 +6938,10 @@ def _response_stream_type(cls): class _CreateLocalDeploymentOperation(rpc.ClientOperation): + """ + Creates a local deployment on the device. Also allows to remove existing components. + """ + @classmethod def _model_name(cls): return 'aws.greengrass#CreateLocalDeployment' @@ -6954,6 +6964,10 @@ def _response_stream_type(cls): class _DeferComponentUpdateOperation(rpc.ClientOperation): + """ + Defer the update of components by a given amount of time and check again after that. + """ + @classmethod def _model_name(cls): return 'aws.greengrass#DeferComponentUpdate' @@ -6976,6 +6990,10 @@ def _response_stream_type(cls): class _DeleteThingShadowOperation(rpc.ClientOperation): + """ + Deletes a device shadow document stored in the local shadow service + """ + @classmethod def _model_name(cls): return 'aws.greengrass#DeleteThingShadow' @@ -7020,6 +7038,10 @@ def _response_stream_type(cls): class _GetComponentDetailsOperation(rpc.ClientOperation): + """ + Gets the status and version of the component with the given component name + """ + @classmethod def _model_name(cls): return 'aws.greengrass#GetComponentDetails' @@ -7042,6 +7064,10 @@ def _response_stream_type(cls): class _GetConfigurationOperation(rpc.ClientOperation): + """ + Get value of a given key from the configuration + """ + @classmethod def _model_name(cls): return 'aws.greengrass#GetConfiguration' @@ -7064,6 +7090,10 @@ def _response_stream_type(cls): class _GetLocalDeploymentStatusOperation(rpc.ClientOperation): + """ + Get status of a local deployment with the given deploymentId + """ + @classmethod def _model_name(cls): return 'aws.greengrass#GetLocalDeploymentStatus' @@ -7108,6 +7138,10 @@ def _response_stream_type(cls): class _GetThingShadowOperation(rpc.ClientOperation): + """ + Retrieves a device shadow document stored by the local shadow service + """ + @classmethod def _model_name(cls): return 'aws.greengrass#GetThingShadow' @@ -7152,6 +7186,10 @@ def _response_stream_type(cls): class _ListLocalDeploymentsOperation(rpc.ClientOperation): + """ + Lists the last 5 local deployments along with their statuses + """ + @classmethod def _model_name(cls): return 'aws.greengrass#ListLocalDeployments' @@ -7174,6 +7212,10 @@ def _response_stream_type(cls): class _ListNamedShadowsForThingOperation(rpc.ClientOperation): + """ + Lists the named shadows for the specified thing + """ + @classmethod def _model_name(cls): return 'aws.greengrass#ListNamedShadowsForThing' @@ -7218,6 +7260,10 @@ def _response_stream_type(cls): class _PublishToIoTCoreOperation(rpc.ClientOperation): + """ + Publish an MQTT message to AWS IoT message broker + """ + @classmethod def _model_name(cls): return 'aws.greengrass#PublishToIoTCore' @@ -7240,6 +7286,10 @@ def _response_stream_type(cls): class _PublishToTopicOperation(rpc.ClientOperation): + """ + Publish to a custom topic. + """ + @classmethod def _model_name(cls): return 'aws.greengrass#PublishToTopic' @@ -7284,6 +7334,10 @@ def _response_stream_type(cls): class _RestartComponentOperation(rpc.ClientOperation): + """ + Restarts a component with the given name + """ + @classmethod def _model_name(cls): return 'aws.greengrass#RestartComponent' @@ -7328,6 +7382,12 @@ def _response_stream_type(cls): class _SendConfigurationValidityReportOperation(rpc.ClientOperation): + """ + This operation should be used in response to event received as part of SubscribeToValidateConfigurationUpdates + subscription. It is not necessary to send the report if the configuration is valid (GGC will wait for timeout + period and proceed). Sending the report with invalid config status will prevent GGC from applying the updates + """ + @classmethod def _model_name(cls): return 'aws.greengrass#SendConfigurationValidityReport' @@ -7350,6 +7410,10 @@ def _response_stream_type(cls): class _StopComponentOperation(rpc.ClientOperation): + """ + Stops a component with the given name + """ + @classmethod def _model_name(cls): return 'aws.greengrass#StopComponent' @@ -7394,6 +7458,10 @@ def _response_stream_type(cls): class _SubscribeToComponentUpdatesOperation(rpc.ClientOperation): + """ + Subscribe to receive notification if GGC is about to update any components + """ + @classmethod def _model_name(cls): return 'aws.greengrass#SubscribeToComponentUpdates' @@ -7416,6 +7484,10 @@ def _response_stream_type(cls): class _SubscribeToConfigurationUpdateOperation(rpc.ClientOperation): + """ + Subscribes to be notified when GGC updates the configuration for a given componentName and keyName. + """ + @classmethod def _model_name(cls): return 'aws.greengrass#SubscribeToConfigurationUpdate' @@ -7438,6 +7510,10 @@ def _response_stream_type(cls): class _SubscribeToIoTCoreOperation(rpc.ClientOperation): + """ + Subscribe to a topic in AWS IoT message broker. + """ + @classmethod def _model_name(cls): return 'aws.greengrass#SubscribeToIoTCore' @@ -7460,6 +7536,10 @@ def _response_stream_type(cls): class _SubscribeToTopicOperation(rpc.ClientOperation): + """ + Creates a subscription for a custom topic + """ + @classmethod def _model_name(cls): return 'aws.greengrass#SubscribeToTopic' @@ -7482,6 +7562,13 @@ def _response_stream_type(cls): class _SubscribeToValidateConfigurationUpdatesOperation(rpc.ClientOperation): + """ + Subscribes to be notified when GGC is about to update configuration for this component + GGC will wait for a timeout period before it proceeds with the update. + If the new configuration is not valid this component can use the SendConfigurationValidityReport + operation to indicate that + """ + @classmethod def _model_name(cls): return 'aws.greengrass#SubscribeToValidateConfigurationUpdates' @@ -7504,6 +7591,11 @@ def _response_stream_type(cls): class _UpdateConfigurationOperation(rpc.ClientOperation): + """ + Update this component's configuration by replacing the value of given keyName with the newValue. + If an oldValue is specified then update will only take effect id the current value matches the given oldValue + """ + @classmethod def _model_name(cls): return 'aws.greengrass#UpdateConfiguration' @@ -7526,6 +7618,10 @@ def _response_stream_type(cls): class _UpdateStateOperation(rpc.ClientOperation): + """ + Update status of this component + """ + @classmethod def _model_name(cls): return 'aws.greengrass#UpdateState' @@ -7548,6 +7644,11 @@ def _response_stream_type(cls): class _UpdateThingShadowOperation(rpc.ClientOperation): + """ + Updates a device shadow document stored in the local shadow service + The update is an upsert operation, with optimistic locking support + """ + @classmethod def _model_name(cls): return 'aws.greengrass#UpdateThingShadow' diff --git a/test/echotestrpc/client.py b/test/echotestrpc/client.py index 1756e7ea..7faabc98 100644 --- a/test/echotestrpc/client.py +++ b/test/echotestrpc/client.py @@ -296,7 +296,9 @@ def close(self): # type: (...) -> concurrent.futures.Future[None] class EchoTestRPCClient(rpc.Client): """ - Client for the EchoTestRPC service. + Client for the EchoTestRPC service. When finished with the client, + you must call close() to free the client's native resources. + Args: connection: Connection that this client will use. """ diff --git a/test/echotestrpc/model.py b/test/echotestrpc/model.py index fab19f9e..d3511d76 100644 --- a/test/echotestrpc/model.py +++ b/test/echotestrpc/model.py @@ -32,15 +32,17 @@ class Product(rpc.Shape): """ Product + A simple product definition + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - name: - price: + name: The product's name + price: How much the product costs Attributes: - name: - price: + name: The product's name + price: How much the product costs """ def __init__(self, *, @@ -97,15 +99,17 @@ class Pair(rpc.Shape): """ Pair + Shape representing a pair of values + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - key: - value: + key: Pair.key as a string + value: Pair.value also a string! Attributes: - key: - value: + key: Pair.key as a string + value: Pair.value also a string! """ def __init__(self, *, @@ -173,17 +177,19 @@ class Customer(rpc.Shape): """ Customer + A simple customer definition + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - id: - first_name: - last_name: + id: Opaque customer identifier + first_name: First name of the customer + last_name: Last name of the customer Attributes: - id: - first_name: - last_name: + id: Opaque customer identifier + first_name: First name of the customer + last_name: Last name of the customer """ def __init__(self, *, @@ -250,29 +256,31 @@ class MessageData(rpc.Shape): """ MessageData + Data associated with some notion of a message + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - string_message: - boolean_message: - time_message: - document_message: - enum_message: FruitEnum enum value. - blob_message: - string_list_message: - key_value_pair_list: - string_to_value: + string_message: Some string data + boolean_message: Some boolean data + time_message: Some timestamp data + document_message: Some document data + enum_message: FruitEnum enum value. Some FruitEnum data + blob_message: Some blob data + string_list_message: Some list of strings data + key_value_pair_list: A list of key-value pairs + string_to_value: A map from strings to Product shapes Attributes: - string_message: - boolean_message: - time_message: - document_message: - enum_message: FruitEnum enum value. - blob_message: - string_list_message: - key_value_pair_list: - string_to_value: + string_message: Some string data + boolean_message: Some boolean data + time_message: Some timestamp data + document_message: Some document data + enum_message: FruitEnum enum value. Some FruitEnum data + blob_message: Some blob data + string_list_message: Some list of strings data + key_value_pair_list: A list of key-value pairs + string_to_value: A map from strings to Product shapes """ def __init__(self, *, @@ -403,17 +411,19 @@ class EchoStreamingMessage(rpc.Shape): """ EchoStreamingMessage is a "tagged union" class. + A union of values related to a streaming message. Only one field may bet set. + When sending, only one of the attributes may be set. When receiving, only one of the attributes will be set. All other attributes will be None. Keyword Args: - stream_message: - key_value_pair: + stream_message: A message data record + key_value_pair: A key value pair Attributes: - stream_message: - key_value_pair: + stream_message: A message data record + key_value_pair: A key value pair """ def __init__(self, *, @@ -470,15 +480,17 @@ class ServiceError(EchoTestRPCError): """ ServiceError + A sample error shape + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: - value: + message: An error message + value: Some auxiliary value Attributes: - message: - value: + message: An error message + value: Some auxiliary value """ def __init__(self, *, @@ -538,13 +550,15 @@ class GetAllCustomersResponse(rpc.Shape): """ GetAllCustomersResponse + All data associated with the result of a GetAllCustomers operation + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - customers: + customers: A list of all known customers Attributes: - customers: + customers: A list of all known customers """ def __init__(self, *, @@ -590,6 +604,8 @@ def __eq__(self, other): class GetAllCustomersRequest(rpc.Shape): """ GetAllCustomersRequest + + Data needed to perform a GetAllCustomers operation """ def __init__(self): @@ -626,13 +642,15 @@ class EchoMessageResponse(rpc.Shape): """ EchoMessageResponse + All data associated with the result of an EchoMessage operation + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Some message data Attributes: - message: + message: Some message data """ def __init__(self, *, @@ -679,13 +697,15 @@ class EchoMessageRequest(rpc.Shape): """ EchoMessageRequest + Data needed to perform an EchoMessage operation + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Some message data Attributes: - message: + message: Some message data """ def __init__(self, *, @@ -731,6 +751,8 @@ def __eq__(self, other): class EchoStreamingResponse(rpc.Shape): """ EchoStreamingResponse + + Data associated with the response to starting an EchoStreaming streaming operation """ def __init__(self): @@ -766,6 +788,8 @@ def __eq__(self, other): class EchoStreamingRequest(rpc.Shape): """ EchoStreamingRequest + + Data needed to start an EchoStreaming streaming operation """ def __init__(self): @@ -801,6 +825,8 @@ def __eq__(self, other): class CauseServiceErrorResponse(rpc.Shape): """ CauseServiceErrorResponse + + All data associated with the result of an EchoMessage operation """ def __init__(self): @@ -836,6 +862,8 @@ def __eq__(self, other): class CauseServiceErrorRequest(rpc.Shape): """ CauseServiceErrorRequest + + Data needed to perform a CauseServiceError operation """ def __init__(self): @@ -872,13 +900,15 @@ class GetAllProductsResponse(rpc.Shape): """ GetAllProductsResponse + All data associated with the result of a GetAllProducts operation + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - products: + products: A map from strings to products Attributes: - products: + products: A map from strings to products """ def __init__(self, *, @@ -924,6 +954,8 @@ def __eq__(self, other): class GetAllProductsRequest(rpc.Shape): """ GetAllProductsRequest + + Data needed to perform a GetAllProducts operation """ def __init__(self): @@ -976,6 +1008,10 @@ def __eq__(self, other): class _CauseServiceErrorOperation(rpc.ClientOperation): + """ + Throws a ServiceError instead of returning a response. + """ + @classmethod def _model_name(cls): return 'awstest#CauseServiceError' @@ -998,6 +1034,10 @@ def _response_stream_type(cls): class _CauseStreamServiceToErrorOperation(rpc.ClientOperation): + """ + Responds to initial request normally then throws a ServiceError on stream response + """ + @classmethod def _model_name(cls): return 'awstest#CauseStreamServiceToError' @@ -1020,6 +1060,10 @@ def _response_stream_type(cls): class _EchoMessageOperation(rpc.ClientOperation): + """ + Returns the same data sent in the request to the response + """ + @classmethod def _model_name(cls): return 'awstest#EchoMessage' @@ -1042,6 +1086,10 @@ def _response_stream_type(cls): class _EchoStreamMessagesOperation(rpc.ClientOperation): + """ + Initial request and response are empty, but echos streaming messages sent by client + """ + @classmethod def _model_name(cls): return 'awstest#EchoStreamMessages' @@ -1064,6 +1112,10 @@ def _response_stream_type(cls): class _GetAllCustomersOperation(rpc.ClientOperation): + """ + Fetches all customers + """ + @classmethod def _model_name(cls): return 'awstest#GetAllCustomers' @@ -1086,6 +1138,10 @@ def _response_stream_type(cls): class _GetAllProductsOperation(rpc.ClientOperation): + """ + Fetches all products, indexed by SKU + """ + @classmethod def _model_name(cls): return 'awstest#GetAllProducts'