2021/05/27 - AWS IoT SiteWise - 3 updated api methods
Changes IoT SiteWise Monitor Portal API updates to add alarms feature configuration.
{'alarms': {'alarmRoleArn': 'string', 'notificationLambdaArn': 'string'}, 'notificationSenderEmail': 'string'}
Creates a portal, which can contain projects and dashboards. AWS IoT SiteWise Monitor uses AWS SSO or IAM to authenticate portal users and manage user permissions.
Note
Before you can sign in to a new portal, you must add at least one identity 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' }, portalAuthMode='IAM'|'SSO', notificationSenderEmail='string', alarms={ 'alarmRoleArn': 'string', 'notificationLambdaArn': '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) --
string
The service to use to authenticate users to the portal. Choose from the following options:
SSO – The portal uses AWS Single Sign-On to authenticate users and manage user permissions. Before you can create a portal that uses AWS SSO, you must enable AWS SSO. For more information, see Enabling AWS SSO in the AWS IoT SiteWise User Guide . This option is only available in AWS Regions other than the China Regions.
IAM – The portal uses AWS Identity and Access Management (IAM) to authenticate users and manage user permissions. This option is only available in the China Regions.
You can't change this value after you create a portal.
Default: SSO
string
The email address that sends alarm notifications.
Warning
If you use the AWS IoT Events managed AWS Lambda function to manage your emails, you must verify the sender email address in Amazon SES .
dict
Contains the configuration information of an alarm created in an AWS IoT SiteWise Monitor portal. You can use the alarm to monitor an asset property and get notified when the asset property value is outside a specified range. For more information, see .
alarmRoleArn (string) -- [REQUIRED]
The ARN of the IAM role that allows the alarm to perform actions and access AWS resources, including AWS IoT Events.
notificationLambdaArn (string) --
The ARN of the AWS Lambda function that manages alarm notifications. For more information, see Managing alarm notifications in the AWS IoT Events Developer Guide .
dict
Response Syntax
{ 'portalId': 'string', 'portalArn': 'string', 'portalStartUrl': 'string', 'portalStatus': { 'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED', 'error': { 'code': 'INTERNAL_FAILURE'|'VALIDATION_ERROR'|'LIMIT_EXCEEDED', '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 URL for the AWS IoT SiteWise Monitor portal. You can use this URL to access portals that use AWS SSO for authentication. For portals that use IAM for authentication, you must use the AWS IoT SiteWise console to get a URL that you can use to access the 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, if the portal uses AWS SSO.
{'alarms': {'alarmRoleArn': 'string', 'notificationLambdaArn': 'string'}, 'notificationSenderEmail': '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'|'VALIDATION_ERROR'|'LIMIT_EXCEEDED', 'message': 'string' } }, 'portalCreationDate': datetime(2015, 1, 1), 'portalLastUpdateDate': datetime(2015, 1, 1), 'portalLogoImageLocation': { 'id': 'string', 'url': 'string' }, 'roleArn': 'string', 'portalAuthMode': 'IAM'|'SSO', 'notificationSenderEmail': 'string', 'alarms': { 'alarmRoleArn': 'string', 'notificationLambdaArn': '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). AWS IoT SiteWise includes portalClientId for only portals that use AWS SSO to authenticate users.
portalStartUrl (string) --
The URL for the AWS IoT SiteWise Monitor portal. You can use this URL to access portals that use AWS SSO for authentication. For portals that use IAM for authentication, you must use the AWS IoT SiteWise console to get a URL that you can use to access the 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 .
portalAuthMode (string) --
The service to use to authenticate users to the portal.
notificationSenderEmail (string) --
The email address that sends alarm notifications.
alarms (dict) --
Contains the configuration information of an alarm created in a AWS IoT SiteWise Monitor portal.
alarmRoleArn (string) --
The ARN of the IAM role that allows the alarm to perform actions and access AWS resources, including AWS IoT Events.
notificationLambdaArn (string) --
The ARN of the AWS Lambda function that manages alarm notifications. For more information, see Managing alarm notifications in the AWS IoT Events Developer Guide .
{'alarms': {'alarmRoleArn': 'string', 'notificationLambdaArn': 'string'}, 'notificationSenderEmail': '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', notificationSenderEmail='string', alarms={ 'alarmRoleArn': 'string', 'notificationLambdaArn': '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.
string
The email address that sends alarm notifications.
dict
Contains the configuration information of an alarm created in an AWS IoT SiteWise Monitor portal. You can use the alarm to monitor an asset property and get notified when the asset property value is outside a specified range. For more information, see .
alarmRoleArn (string) -- [REQUIRED]
The ARN of the IAM role that allows the alarm to perform actions and access AWS resources, including AWS IoT Events.
notificationLambdaArn (string) --
The ARN of the AWS Lambda function that manages alarm notifications. For more information, see Managing alarm notifications in the AWS IoT Events Developer Guide .
dict
Response Syntax
{ 'portalStatus': { 'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED', 'error': { 'code': 'INTERNAL_FAILURE'|'VALIDATION_ERROR'|'LIMIT_EXCEEDED', '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.