AWS IoT SiteWise

2021/05/27 - AWS IoT SiteWise - 3 updated api methods

Changes  IoT SiteWise Monitor Portal API updates to add alarms feature configuration.

CreatePortal (updated) Link ¶
Changes (request)
{'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.

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'
    }
)
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) --

type portalAuthMode:

string

param portalAuthMode:

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

type notificationSenderEmail:

string

param notificationSenderEmail:

The email address that sends alarm notifications.

type alarms:

dict

param alarms:

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.

rtype:

dict

returns:

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.

DescribePortal (updated) Link ¶
Changes (response)
{'alarms': {'alarmRoleArn': 'string', 'notificationLambdaArn': 'string'},
 'notificationSenderEmail': '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'|'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.

UpdatePortal (updated) Link ¶
Changes (request)
{'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'
    }
)
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.

type notificationSenderEmail:

string

param notificationSenderEmail:

The email address that sends alarm notifications.

type alarms:

dict

param alarms:

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.

rtype:

dict

returns:

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.