AWS IoT SiteWise

2020/05/22 - AWS IoT SiteWise - 4 updated api methods

Changes  Update iotsitewise client to latest version

CreatePortal (updated) Link ¶
Changes (request)
{'portalLogoImageFile': {'data': 'blob', 'type': 'PNG'}}

Creates a portal, which can contain projects and dashboards. Before you can create a portal, you must configure AWS Single Sign-On in the current Region. AWS IoT SiteWise Monitor uses AWS SSO to manage user permissions. For more information, see Enabling AWS SSO in the AWS IoT SiteWise User Guide.

See also: AWS API Documentation

Request Syntax

client.create_portal(
    portalName='string',
    portalDescription='string',
    portalContactEmail='string',
    clientToken='string',
    portalLogoImageFile={
        'data': b'bytes',
        'type': 'PNG'
    },
    roleArn='string',
    tags={
        'string': 'string'
    }
)
type portalName:

string

param portalName:

[REQUIRED]

A friendly name for the portal.

type portalDescription:

string

param portalDescription:

A description for the portal.

type portalContactEmail:

string

param portalContactEmail:

[REQUIRED]

The AWS administrator's contact email address.

type clientToken:

string

param clientToken:

A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

This field is autopopulated if not provided.

type portalLogoImageFile:

dict

param portalLogoImageFile:

A logo image to display in the portal. Upload a square, high-resolution image. The image is displayed on a dark background.

  • data (bytes) -- [REQUIRED]

    The image file contents, represented as a base64-encoded string. The file size must be less than 1 MB.

  • type (string) -- [REQUIRED]

    The file type of the image.

type roleArn:

string

param roleArn:

[REQUIRED]

The ARN of a service role that allows the portal's users to access your AWS IoT SiteWise resources on your behalf. For more information, see Using service roles for AWS IoT SiteWise Monitor in the AWS IoT SiteWise User Guide.

type tags:

dict

param tags:

A list of key-value pairs that contain metadata for the portal. For more information, see Tagging your AWS IoT SiteWise resources in the AWS IoT SiteWise User Guide.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'portalId': 'string',
    'portalArn': 'string',
    'portalStartUrl': 'string',
    'portalStatus': {
        'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED',
        'error': {
            'code': 'INTERNAL_FAILURE',
            'message': 'string'
        }
    },
    'ssoApplicationId': 'string'
}

Response Structure

  • (dict) --

    • portalId (string) --

      The ID of the created portal.

    • portalArn (string) --

      The ARN of the portal, which has the following format.

      arn:${Partition}:iotsitewise:${Region}:${Account}:portal/${PortalId}

    • portalStartUrl (string) --

      The public URL for the AWS IoT SiteWise Monitor portal.

    • portalStatus (dict) --

      The status of the portal, which contains a state ( CREATING after successfully calling this operation) and any error message.

      • state (string) --

        The current state of the portal.

      • error (dict) --

        Contains associated error information, if any.

        • code (string) --

          The error code.

        • message (string) --

          The error message.

    • ssoApplicationId (string) --

      The associated AWS SSO application Id.

DescribePortal (updated) Link ¶
Changes (response)
{'portalLogoImageLocation': {'id': 'string', 'url': 'string'}}

Retrieves information about a portal.

See also: AWS API Documentation

Request Syntax

client.describe_portal(
    portalId='string'
)
type portalId:

string

param portalId:

[REQUIRED]

The ID of the portal.

rtype:

dict

returns:

Response Syntax

{
    'portalId': 'string',
    'portalArn': 'string',
    'portalName': 'string',
    'portalDescription': 'string',
    'portalClientId': 'string',
    'portalStartUrl': 'string',
    'portalContactEmail': 'string',
    'portalStatus': {
        'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED',
        'error': {
            'code': 'INTERNAL_FAILURE',
            'message': 'string'
        }
    },
    'portalCreationDate': datetime(2015, 1, 1),
    'portalLastUpdateDate': datetime(2015, 1, 1),
    'portalLogoImageLocation': {
        'id': 'string',
        'url': 'string'
    },
    'roleArn': 'string'
}

Response Structure

  • (dict) --

    • portalId (string) --

      The ID of the portal.

    • portalArn (string) --

      The ARN of the portal, which has the following format.

      arn:${Partition}:iotsitewise:${Region}:${Account}:portal/${PortalId}

    • portalName (string) --

      The name of the portal.

    • portalDescription (string) --

      The portal's description.

    • portalClientId (string) --

      The AWS SSO application generated client ID (used with AWS SSO APIs).

    • portalStartUrl (string) --

      The public root URL for the AWS IoT AWS IoT SiteWise Monitor application portal.

    • portalContactEmail (string) --

      The AWS administrator's contact email address.

    • portalStatus (dict) --

      The current status of the portal, which contains a state and any error message.

      • state (string) --

        The current state of the portal.

      • error (dict) --

        Contains associated error information, if any.

        • code (string) --

          The error code.

        • message (string) --

          The error message.

    • portalCreationDate (datetime) --

      The date the portal was created, in Unix epoch time.

    • portalLastUpdateDate (datetime) --

      The date the portal was last updated, in Unix epoch time.

    • portalLogoImageLocation (dict) --

      The portal's logo image, which is available at a URL.

      • id (string) --

        The ID of the image.

      • url (string) --

        The URL where the image is available. The URL is valid for 15 minutes so that you can view and download the image

    • roleArn (string) --

      The ARN of the service role that allows the portal's users to access your AWS IoT SiteWise resources on your behalf. For more information, see Using service roles for AWS IoT SiteWise Monitor in the AWS IoT SiteWise User Guide.

GetAssetPropertyAggregates (updated) Link ¶
Changes (request, response)
Request
{'aggregateTypes': {'STANDARD_DEVIATION'}}
Response
{'aggregatedValues': {'value': {'standardDeviation': 'double'}}}

Gets aggregated values for an asset property. For more information, see Querying Aggregated Property Values in the AWS IoT SiteWise User Guide.

To identify an asset property, you must specify one of the following:

  • The assetId and propertyId of an asset property.

  • A propertyAlias, which is a data stream alias (for example, /company/windfarm/3/turbine/7/temperature). To define an asset property's alias, see UpdateAssetProperty.

See also: AWS API Documentation

Request Syntax

client.get_asset_property_aggregates(
    assetId='string',
    propertyId='string',
    propertyAlias='string',
    aggregateTypes=[
        'AVERAGE'|'COUNT'|'MAXIMUM'|'MINIMUM'|'SUM'|'STANDARD_DEVIATION',
    ],
    resolution='string',
    qualities=[
        'GOOD'|'BAD'|'UNCERTAIN',
    ],
    startDate=datetime(2015, 1, 1),
    endDate=datetime(2015, 1, 1),
    timeOrdering='ASCENDING'|'DESCENDING',
    nextToken='string',
    maxResults=123
)
type assetId:

string

param assetId:

The ID of the asset.

type propertyId:

string

param propertyId:

The ID of the asset property.

type propertyAlias:

string

param propertyAlias:

The property alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see Mapping Industrial Data Streams to Asset Properties in the AWS IoT SiteWise User Guide.

type aggregateTypes:

list

param aggregateTypes:

[REQUIRED]

The data aggregating function.

  • (string) --

type resolution:

string

param resolution:

[REQUIRED]

The time interval over which to aggregate data.

type qualities:

list

param qualities:

The quality by which to filter asset data.

  • (string) --

type startDate:

datetime

param startDate:

[REQUIRED]

The exclusive start of the range from which to query historical data, expressed in seconds in Unix epoch time.

type endDate:

datetime

param endDate:

[REQUIRED]

The inclusive end of the range from which to query historical data, expressed in seconds in Unix epoch time.

type timeOrdering:

string

param timeOrdering:

The chronological sorting order of the requested information.

type nextToken:

string

param nextToken:

The token to be used for the next set of paginated results.

type maxResults:

integer

param maxResults:

The maximum number of results to be returned per paginated request.

rtype:

dict

returns:

Response Syntax

{
    'aggregatedValues': [
        {
            'timestamp': datetime(2015, 1, 1),
            'quality': 'GOOD'|'BAD'|'UNCERTAIN',
            'value': {
                'average': 123.0,
                'count': 123.0,
                'maximum': 123.0,
                'minimum': 123.0,
                'sum': 123.0,
                'standardDeviation': 123.0
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • aggregatedValues (list) --

      The requested aggregated values.

      • (dict) --

        Contains aggregated asset property values (for example, average, minimum, and maximum).

        • timestamp (datetime) --

          The date the aggregating computations occurred, in Unix epoch time.

        • quality (string) --

          The quality of the aggregated data.

        • value (dict) --

          The value of the aggregates.

          • average (float) --

            The average (mean) value of the time series over a time interval window.

          • count (float) --

            The count of data points in the time series over a time interval window.

          • maximum (float) --

            The maximum value of the time series over a time interval window.

          • minimum (float) --

            The minimum value of the time series over a time interval window.

          • sum (float) --

            The sum of the time series over a time interval window.

          • standardDeviation (float) --

            The standard deviation of the time series over a time interval window.

    • nextToken (string) --

      The token for the next set of results, or null if there are no additional results.

UpdatePortal (updated) Link ¶
Changes (request)
{'portalLogoImage': {'file': {'data': 'blob', 'type': 'PNG'}, 'id': 'string'}}

Updates an AWS IoT SiteWise Monitor portal.

See also: AWS API Documentation

Request Syntax

client.update_portal(
    portalId='string',
    portalName='string',
    portalDescription='string',
    portalContactEmail='string',
    portalLogoImage={
        'id': 'string',
        'file': {
            'data': b'bytes',
            'type': 'PNG'
        }
    },
    roleArn='string',
    clientToken='string'
)
type portalId:

string

param portalId:

[REQUIRED]

The ID of the portal to update.

type portalName:

string

param portalName:

[REQUIRED]

A new friendly name for the portal.

type portalDescription:

string

param portalDescription:

A new description for the portal.

type portalContactEmail:

string

param portalContactEmail:

[REQUIRED]

The AWS administrator's contact email address.

type portalLogoImage:

dict

param portalLogoImage:

Contains an image that is one of the following:

  • An image file. Choose this option to upload a new image.

  • The ID of an existing image. Choose this option to keep an existing image.

  • id (string) --

    The ID of an existing image. Specify this parameter to keep an existing image.

  • file (dict) --

    Contains an image file.

    • data (bytes) -- [REQUIRED]

      The image file contents, represented as a base64-encoded string. The file size must be less than 1 MB.

    • type (string) -- [REQUIRED]

      The file type of the image.

type roleArn:

string

param roleArn:

[REQUIRED]

The ARN of a service role that allows the portal's users to access your AWS IoT SiteWise resources on your behalf. For more information, see Using service roles for AWS IoT SiteWise Monitor in the AWS IoT SiteWise User Guide.

type clientToken:

string

param clientToken:

A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{
    'portalStatus': {
        'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED',
        'error': {
            'code': 'INTERNAL_FAILURE',
            'message': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • portalStatus (dict) --

      The status of the portal, which contains a state ( UPDATING after successfully calling this operation) and any error message.

      • state (string) --

        The current state of the portal.

      • error (dict) --

        Contains associated error information, if any.

        • code (string) --

          The error code.

        • message (string) --

          The error message.