AWS IoT Greengrass V2

2022/01/03 - AWS IoT Greengrass V2 - 5 new api methods

Changes  This release adds the API operations to manage the Greengrass role associated with your account and to manage the core device connectivity information. Greengrass V2 customers can now depend solely on Greengrass V2 SDK for all the API operations needed to manage their fleets.

GetServiceRoleForAccount (new) Link ¶

Gets the service role associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. IoT Greengrass uses this role to verify the identity of client devices and manage core device connectivity information. For more information, see Greengrass service role in the IoT Greengrass Version 2 Developer Guide .

See also: AWS API Documentation

Request Syntax

client.get_service_role_for_account()
rtype

dict

returns

Response Syntax

{
    'associatedAt': 'string',
    'roleArn': 'string'
}

Response Structure

  • (dict) --

    • associatedAt (string) --

      The time when the service role was associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

    • roleArn (string) --

      The ARN of the service role that is associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

DisassociateServiceRoleFromAccount (new) Link ¶

Disassociates the Greengrass service role from IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. Without a service role, IoT Greengrass can't verify the identity of client devices or manage core device connectivity information. For more information, see Greengrass service role in the IoT Greengrass Version 2 Developer Guide .

See also: AWS API Documentation

Request Syntax

client.disassociate_service_role_from_account()
rtype

dict

returns

Response Syntax

{
    'disassociatedAt': 'string'
}

Response Structure

  • (dict) --

    • disassociatedAt (string) --

      The time when the service role was disassociated from IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

UpdateConnectivityInfo (new) Link ¶

Updates connectivity information for a Greengrass core device.

Connectivity information includes endpoints and ports where client devices can connect to an MQTT broker on the core device. When a client device calls the Greengrass discovery API, IoT Greengrass returns connectivity information for all of the core devices where the client device can connect. For more information, see Connect client devices to core devices in the IoT Greengrass Version 2 Developer Guide .

See also: AWS API Documentation

Request Syntax

client.update_connectivity_info(
    thingName='string',
    connectivityInfo=[
        {
            'id': 'string',
            'hostAddress': 'string',
            'portNumber': 123,
            'metadata': 'string'
        },
    ]
)
type thingName

string

param thingName

[REQUIRED]

The name of the core device. This is also the name of the IoT thing.

type connectivityInfo

list

param connectivityInfo

[REQUIRED]

The connectivity information for the core device.

  • (dict) --

    Contains information about an endpoint and port where client devices can connect to an MQTT broker on a Greengrass core device.

    • id (string) --

      An ID for the connectivity information.

    • hostAddress (string) --

      The IP address or DNS address where client devices can connect to an MQTT broker on the Greengrass core device.

    • portNumber (integer) --

      The port where the MQTT broker operates on the core device. This port is typically 8883, which is the default port for the MQTT broker component that runs on core devices.

    • metadata (string) --

      Additional metadata to provide to client devices that connect to this core device.

rtype

dict

returns

Response Syntax

{
    'version': 'string',
    'message': 'string'
}

Response Structure

  • (dict) --

    • version (string) --

      The new version of the connectivity information for the core device.

    • message (string) --

      A message about the connectivity information update request.

GetConnectivityInfo (new) Link ¶

Retrieves connectivity information for a Greengrass core device.

Connectivity information includes endpoints and ports where client devices can connect to an MQTT broker on the core device. When a client device calls the Greengrass discovery API, IoT Greengrass returns connectivity information for all of the core devices where the client device can connect. For more information, see Connect client devices to core devices in the IoT Greengrass Version 2 Developer Guide .

See also: AWS API Documentation

Request Syntax

client.get_connectivity_info(
    thingName='string'
)
type thingName

string

param thingName

[REQUIRED]

The name of the core device. This is also the name of the IoT thing.

rtype

dict

returns

Response Syntax

{
    'connectivityInfo': [
        {
            'id': 'string',
            'hostAddress': 'string',
            'portNumber': 123,
            'metadata': 'string'
        },
    ],
    'message': 'string'
}

Response Structure

  • (dict) --

    • connectivityInfo (list) --

      The connectivity information for the core device.

      • (dict) --

        Contains information about an endpoint and port where client devices can connect to an MQTT broker on a Greengrass core device.

        • id (string) --

          An ID for the connectivity information.

        • hostAddress (string) --

          The IP address or DNS address where client devices can connect to an MQTT broker on the Greengrass core device.

        • portNumber (integer) --

          The port where the MQTT broker operates on the core device. This port is typically 8883, which is the default port for the MQTT broker component that runs on core devices.

        • metadata (string) --

          Additional metadata to provide to client devices that connect to this core device.

    • message (string) --

      A message about the connectivity information request.

AssociateServiceRoleToAccount (new) Link ¶

Associates a Greengrass service role with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region. IoT Greengrass uses this role to verify the identity of client devices and manage core device connectivity information. The role must include the AWSGreengrassResourceAccessRolePolicy managed policy or a custom policy that defines equivalent permissions for the IoT Greengrass features that you use. For more information, see Greengrass service role in the IoT Greengrass Version 2 Developer Guide .

See also: AWS API Documentation

Request Syntax

client.associate_service_role_to_account(
    roleArn='string'
)
type roleArn

string

param roleArn

[REQUIRED]

The Amazon Resource Name (ARN) of the service role to associate with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.

rtype

dict

returns

Response Syntax

{
    'associatedAt': 'string'
}

Response Structure

  • (dict) --

    • associatedAt (string) --

      The time when the service role was associated with IoT Greengrass for your Amazon Web Services account in this Amazon Web Services Region.