IoT1ClickProjects

Table of Contents

Client

class IoT1ClickProjects.Client

A low-level client representing AWS IoT 1-Click Projects Service:

import boto3

client = boto3.client('iot1click-projects')

These are the available methods:

associate_device_with_placement(**kwargs)

Associates a physical device with a placement.

See also: AWS API Documentation

Request Syntax

response = client.associate_device_with_placement(
    projectName='string',
    placementName='string',
    deviceId='string',
    deviceTemplateName='string'
)
Parameters
  • projectName (string) --

    [REQUIRED]

    The name of the project containing the placement in which to associate the device.

  • placementName (string) --

    [REQUIRED]

    The name of the placement in which to associate the device.

  • deviceId (string) --

    [REQUIRED]

    The ID of the physical device to be associated with the given placement in the project. Note that a mandatory 4 character prefix is required for all deviceId values.

  • deviceTemplateName (string) --

    [REQUIRED]

    The device template name to associate with the device ID.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
create_placement(**kwargs)

Creates an empty placement.

See also: AWS API Documentation

Request Syntax

response = client.create_placement(
    placementName='string',
    projectName='string',
    attributes={
        'string': 'string'
    }
)
Parameters
  • placementName (string) --

    [REQUIRED]

    The name of the placement to be created.

  • projectName (string) --

    [REQUIRED]

    The name of the project in which to create the placement.

  • attributes (dict) --

    Optional user-defined key/value pairs providing contextual data (such as location or function) for the placement.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

create_project(**kwargs)

Creates an empty project with a placement template. A project contains zero or more placements that adhere to the placement template defined in the project.

See also: AWS API Documentation

Request Syntax

response = client.create_project(
    projectName='string',
    description='string',
    placementTemplate={
        'defaultAttributes': {
            'string': 'string'
        },
        'deviceTemplates': {
            'string': {
                'deviceType': 'string',
                'callbackOverrides': {
                    'string': 'string'
                }
            }
        }
    },
    tags={
        'string': 'string'
    }
)
Parameters
  • projectName (string) --

    [REQUIRED]

    The name of the project to create.

  • description (string) -- An optional description for the project.
  • placementTemplate (dict) --

    The schema defining the placement to be created. A placement template defines placement default attributes and device templates. You cannot add or remove device templates after the project has been created. However, you can update callbackOverrides for the device templates using the UpdateProject API.

    • defaultAttributes (dict) --

      The default attributes (key/value pairs) to be applied to all placements using this template.

      • (string) --
        • (string) --
    • deviceTemplates (dict) --

      An object specifying the DeviceTemplate for all placements using this ( PlacementTemplate ) template.

      • (string) --
        • (dict) --

          An object representing a device for a placement template (see PlacementTemplate ).

          • deviceType (string) --

            The device type, which currently must be "button" .

          • callbackOverrides (dict) --

            An optional Lambda function to invoke instead of the default Lambda function provided by the placement template.

            • (string) --
              • (string) --
  • tags (dict) --

    Optional tags (metadata key/value pairs) to be associated with the project. For example, { {"key1": "value1", "key2": "value2"} } . For more information, see AWS Tagging Strategies .

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

delete_placement(**kwargs)

Deletes a placement. To delete a placement, it must not have any devices associated with it.

Note

When you delete a placement, all associated data becomes irretrievable.

See also: AWS API Documentation

Request Syntax

response = client.delete_placement(
    placementName='string',
    projectName='string'
)
Parameters
  • placementName (string) --

    [REQUIRED]

    The name of the empty placement to delete.

  • projectName (string) --

    [REQUIRED]

    The project containing the empty placement to delete.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

delete_project(**kwargs)

Deletes a project. To delete a project, it must not have any placements associated with it.

Note

When you delete a project, all associated data becomes irretrievable.

See also: AWS API Documentation

Request Syntax

response = client.delete_project(
    projectName='string'
)
Parameters
projectName (string) --

[REQUIRED]

The name of the empty project to delete.

Return type
dict
Returns
Response Syntax
{}

Response Structure

  • (dict) --
describe_placement(**kwargs)

Describes a placement in a project.

See also: AWS API Documentation

Request Syntax

response = client.describe_placement(
    placementName='string',
    projectName='string'
)
Parameters
  • placementName (string) --

    [REQUIRED]

    The name of the placement within a project.

  • projectName (string) --

    [REQUIRED]

    The project containing the placement to be described.

Return type

dict

Returns

Response Syntax

{
    'placement': {
        'projectName': 'string',
        'placementName': 'string',
        'attributes': {
            'string': 'string'
        },
        'createdDate': datetime(2015, 1, 1),
        'updatedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • placement (dict) --

      An object describing the placement.

      • projectName (string) --

        The name of the project containing the placement.

      • placementName (string) --

        The name of the placement.

      • attributes (dict) --

        The user-defined attributes associated with the placement.

        • (string) --
          • (string) --
      • createdDate (datetime) --

        The date when the placement was initially created, in UNIX epoch time format.

      • updatedDate (datetime) --

        The date when the placement was last updated, in UNIX epoch time format. If the placement was not updated, then createdDate and updatedDate are the same.

describe_project(**kwargs)

Returns an object describing a project.

See also: AWS API Documentation

Request Syntax

response = client.describe_project(
    projectName='string'
)
Parameters
projectName (string) --

[REQUIRED]

The name of the project to be described.

Return type
dict
Returns
Response Syntax
{
    'project': {
        'arn': 'string',
        'projectName': 'string',
        'description': 'string',
        'createdDate': datetime(2015, 1, 1),
        'updatedDate': datetime(2015, 1, 1),
        'placementTemplate': {
            'defaultAttributes': {
                'string': 'string'
            },
            'deviceTemplates': {
                'string': {
                    'deviceType': 'string',
                    'callbackOverrides': {
                        'string': 'string'
                    }
                }
            }
        },
        'tags': {
            'string': 'string'
        }
    }
}

Response Structure

  • (dict) --
    • project (dict) --

      An object describing the project.

      • arn (string) --

        The ARN of the project.

      • projectName (string) --

        The name of the project for which to obtain information from.

      • description (string) --

        The description of the project.

      • createdDate (datetime) --

        The date when the project was originally created, in UNIX epoch time format.

      • updatedDate (datetime) --

        The date when the project was last updated, in UNIX epoch time format. If the project was not updated, then createdDate and updatedDate are the same.

      • placementTemplate (dict) --

        An object describing the project's placement specifications.

        • defaultAttributes (dict) --

          The default attributes (key/value pairs) to be applied to all placements using this template.

          • (string) --
            • (string) --
        • deviceTemplates (dict) --

          An object specifying the DeviceTemplate for all placements using this ( PlacementTemplate ) template.

          • (string) --
            • (dict) --

              An object representing a device for a placement template (see PlacementTemplate ).

              • deviceType (string) --

                The device type, which currently must be "button" .

              • callbackOverrides (dict) --

                An optional Lambda function to invoke instead of the default Lambda function provided by the placement template.

                • (string) --
                  • (string) --
      • tags (dict) --

        The tags (metadata key/value pairs) associated with the project.

        • (string) --
          • (string) --
disassociate_device_from_placement(**kwargs)

Removes a physical device from a placement.

See also: AWS API Documentation

Request Syntax

response = client.disassociate_device_from_placement(
    projectName='string',
    placementName='string',
    deviceTemplateName='string'
)
Parameters
  • projectName (string) --

    [REQUIRED]

    The name of the project that contains the placement.

  • placementName (string) --

    [REQUIRED]

    The name of the placement that the device should be removed from.

  • deviceTemplateName (string) --

    [REQUIRED]

    The device ID that should be removed from the placement.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_devices_in_placement(**kwargs)

Returns an object enumerating the devices in a placement.

See also: AWS API Documentation

Request Syntax

response = client.get_devices_in_placement(
    projectName='string',
    placementName='string'
)
Parameters
  • projectName (string) --

    [REQUIRED]

    The name of the project containing the placement.

  • placementName (string) --

    [REQUIRED]

    The name of the placement to get the devices from.

Return type

dict

Returns

Response Syntax

{
    'devices': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • devices (dict) --

      An object containing the devices (zero or more) within the placement.

      • (string) --
        • (string) --

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
list_placements(**kwargs)

Lists the placement(s) of a project.

See also: AWS API Documentation

Request Syntax

response = client.list_placements(
    projectName='string',
    nextToken='string',
    maxResults=123
)
Parameters
  • projectName (string) --

    [REQUIRED]

    The project containing the placements to be listed.

  • nextToken (string) -- The token to retrieve the next set of results.
  • maxResults (integer) -- The maximum number of results to return per request. If not set, a default value of 100 is used.
Return type

dict

Returns

Response Syntax

{
    'placements': [
        {
            'projectName': 'string',
            'placementName': 'string',
            'createdDate': datetime(2015, 1, 1),
            'updatedDate': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • placements (list) --

      An object listing the requested placements.

      • (dict) --

        An object providing summary information for a particular placement.

        • projectName (string) --

          The name of the project containing the placement.

        • placementName (string) --

          The name of the placement being summarized.

        • createdDate (datetime) --

          The date when the placement was originally created, in UNIX epoch time format.

        • updatedDate (datetime) --

          The date when the placement was last updated, in UNIX epoch time format. If the placement was not updated, then createdDate and updatedDate are the same.

    • nextToken (string) --

      The token used to retrieve the next set of results - will be effectively empty if there are no further results.

list_projects(**kwargs)

Lists the AWS IoT 1-Click project(s) associated with your AWS account and region.

See also: AWS API Documentation

Request Syntax

response = client.list_projects(
    nextToken='string',
    maxResults=123
)
Parameters
  • nextToken (string) -- The token to retrieve the next set of results.
  • maxResults (integer) -- The maximum number of results to return per request. If not set, a default value of 100 is used.
Return type

dict

Returns

Response Syntax

{
    'projects': [
        {
            'arn': 'string',
            'projectName': 'string',
            'createdDate': datetime(2015, 1, 1),
            'updatedDate': datetime(2015, 1, 1),
            'tags': {
                'string': 'string'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • projects (list) --

      An object containing the list of projects.

      • (dict) --

        An object providing summary information for a particular project for an associated AWS account and region.

        • arn (string) --

          The ARN of the project.

        • projectName (string) --

          The name of the project being summarized.

        • createdDate (datetime) --

          The date when the project was originally created, in UNIX epoch time format.

        • updatedDate (datetime) --

          The date when the project was last updated, in UNIX epoch time format. If the project was not updated, then createdDate and updatedDate are the same.

        • tags (dict) --

          The tags (metadata key/value pairs) associated with the project.

          • (string) --
            • (string) --
    • nextToken (string) --

      The token used to retrieve the next set of results - will be effectively empty if there are no further results.

list_tags_for_resource(**kwargs)

Lists the tags (metadata key/value pairs) which you have assigned to the resource.

See also: AWS API Documentation

Request Syntax

response = client.list_tags_for_resource(
    resourceArn='string'
)
Parameters
resourceArn (string) --

[REQUIRED]

The ARN of the resource whose tags you want to list.

Return type
dict
Returns
Response Syntax
{
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --
    • tags (dict) --

      The tags (metadata key/value pairs) which you have assigned to the resource.

      • (string) --
        • (string) --
tag_resource(**kwargs)

Creates or modifies tags for a resource. Tags are key/value pairs (metadata) that can be used to manage a resource. For more information, see AWS Tagging Strategies .

See also: AWS API Documentation

Request Syntax

response = client.tag_resource(
    resourceArn='string',
    tags={
        'string': 'string'
    }
)
Parameters
  • resourceArn (string) --

    [REQUIRED]

    The ARN of the resouce for which tag(s) should be added or modified.

  • tags (dict) --

    [REQUIRED]

    The new or modifying tag(s) for the resource. See AWS IoT 1-Click Service Limits for the maximum number of tags allowed per resource.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

untag_resource(**kwargs)

Removes one or more tags (metadata key/value pairs) from a resource.

See also: AWS API Documentation

Request Syntax

response = client.untag_resource(
    resourceArn='string',
    tagKeys=[
        'string',
    ]
)
Parameters
  • resourceArn (string) --

    [REQUIRED]

    The ARN of the resource whose tag you want to remove.

  • tagKeys (list) --

    [REQUIRED]

    The keys of those tags which you want to remove.

    • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

update_placement(**kwargs)

Updates a placement with the given attributes. To clear an attribute, pass an empty value (i.e., "").

See also: AWS API Documentation

Request Syntax

response = client.update_placement(
    placementName='string',
    projectName='string',
    attributes={
        'string': 'string'
    }
)
Parameters
  • placementName (string) --

    [REQUIRED]

    The name of the placement to update.

  • projectName (string) --

    [REQUIRED]

    The name of the project containing the placement to be updated.

  • attributes (dict) --

    The user-defined object of attributes used to update the placement. The maximum number of key/value pairs is 50.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

update_project(**kwargs)

Updates a project associated with your AWS account and region. With the exception of device template names, you can pass just the values that need to be updated because the update request will change only the values that are provided. To clear a value, pass the empty string (i.e., "" ).

See also: AWS API Documentation

Request Syntax

response = client.update_project(
    projectName='string',
    description='string',
    placementTemplate={
        'defaultAttributes': {
            'string': 'string'
        },
        'deviceTemplates': {
            'string': {
                'deviceType': 'string',
                'callbackOverrides': {
                    'string': 'string'
                }
            }
        }
    }
)
Parameters
  • projectName (string) --

    [REQUIRED]

    The name of the project to be updated.

  • description (string) -- An optional user-defined description for the project.
  • placementTemplate (dict) --

    An object defining the project update. Once a project has been created, you cannot add device template names to the project. However, for a given placementTemplate , you can update the associated callbackOverrides for the device definition using this API.

    • defaultAttributes (dict) --

      The default attributes (key/value pairs) to be applied to all placements using this template.

      • (string) --
        • (string) --
    • deviceTemplates (dict) --

      An object specifying the DeviceTemplate for all placements using this ( PlacementTemplate ) template.

      • (string) --
        • (dict) --

          An object representing a device for a placement template (see PlacementTemplate ).

          • deviceType (string) --

            The device type, which currently must be "button" .

          • callbackOverrides (dict) --

            An optional Lambda function to invoke instead of the default Lambda function provided by the placement template.

            • (string) --
              • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Paginators

The available paginators are:

class IoT1ClickProjects.Paginator.ListPlacements
paginator = client.get_paginator('list_placements')
paginate(**kwargs)

Creates an iterator that will paginate through responses from IoT1ClickProjects.Client.list_placements().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    projectName='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • projectName (string) --

    [REQUIRED]

    The project containing the placements to be listed.

  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'placements': [
        {
            'projectName': 'string',
            'placementName': 'string',
            'createdDate': datetime(2015, 1, 1),
            'updatedDate': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • placements (list) --

      An object listing the requested placements.

      • (dict) --

        An object providing summary information for a particular placement.

        • projectName (string) --

          The name of the project containing the placement.

        • placementName (string) --

          The name of the placement being summarized.

        • createdDate (datetime) --

          The date when the placement was originally created, in UNIX epoch time format.

        • updatedDate (datetime) --

          The date when the placement was last updated, in UNIX epoch time format. If the placement was not updated, then createdDate and updatedDate are the same.

    • NextToken (string) --

      A token to resume pagination.

class IoT1ClickProjects.Paginator.ListProjects
paginator = client.get_paginator('list_projects')
paginate(**kwargs)

Creates an iterator that will paginate through responses from IoT1ClickProjects.Client.list_projects().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
PaginationConfig (dict) --

A dictionary that provides parameters to control pagination.

  • MaxItems (integer) --

    The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

  • PageSize (integer) --

    The size of each page.

  • StartingToken (string) --

    A token to specify where to start paginating. This is the NextToken from a previous response.

Return type
dict
Returns
Response Syntax
{
    'projects': [
        {
            'arn': 'string',
            'projectName': 'string',
            'createdDate': datetime(2015, 1, 1),
            'updatedDate': datetime(2015, 1, 1),
            'tags': {
                'string': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --
    • projects (list) --

      An object containing the list of projects.

      • (dict) --

        An object providing summary information for a particular project for an associated AWS account and region.

        • arn (string) --

          The ARN of the project.

        • projectName (string) --

          The name of the project being summarized.

        • createdDate (datetime) --

          The date when the project was originally created, in UNIX epoch time format.

        • updatedDate (datetime) --

          The date when the project was last updated, in UNIX epoch time format. If the project was not updated, then createdDate and updatedDate are the same.

        • tags (dict) --

          The tags (metadata key/value pairs) associated with the project.

          • (string) --
            • (string) --
    • NextToken (string) --

      A token to resume pagination.