2020/05/22 - AWS IoT SiteWise - 4 updated api methods
Changes This release adds support for the standard deviation auto-computed aggregate and improved support for portal logo images in SiteWise.
{'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 .
Note
Before you can sign in to a new portal, you must add at least one AWS SSO user or group to that portal. For more information, see Adding or Removing Portal Administrators 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' } )
string
[REQUIRED]
A friendly name for the portal.
string
A description for the portal.
string
[REQUIRED]
The AWS administrator's contact email address.
string
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.
dict
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.
string
[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 .
dict
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) --
dict
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.
{'portalLogoImageLocation': {'id': 'string', 'url': 'string'}}
Retrieves information about a portal.
See also: AWS API Documentation
Request Syntax
client.describe_portal( portalId='string' )
string
[REQUIRED]
The ID of the portal.
dict
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 .
{'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 )
string
The ID of the asset.
string
The ID of the asset property.
string
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 .
list
[REQUIRED]
The data aggregating function.
(string) --
string
[REQUIRED]
The time interval over which to aggregate data.
list
The quality by which to filter asset data.
(string) --
datetime
[REQUIRED]
The exclusive start of the range from which to query historical data, expressed in seconds in Unix epoch time.
datetime
[REQUIRED]
The inclusive end of the range from which to query historical data, expressed in seconds in Unix epoch time.
string
The chronological sorting order of the requested information.
string
The token to be used for the next set of paginated results.
integer
The maximum number of results to be returned per paginated request.
dict
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.
{'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' )
string
[REQUIRED]
The ID of the portal to update.
string
[REQUIRED]
A new friendly name for the portal.
string
A new description for the portal.
string
[REQUIRED]
The AWS administrator's contact email address.
dict
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.
string
[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 .
string
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.
dict
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.