Smart Rules

Quick Navigation

GET SmartRules

Purpose

Returns a list of Smart Rules to which the current user has at least read access.

Query Parameters

type: (optional, default: all) Type of Smart Rules to return (all, managed account, managed system, and asset).

Request Body

None.

Response Body

Content-Type: application/json

[
    {
        SmartRuleID: int,
        OrganizationID : string, // can be null
        Title: string,
        Description: string,
        Category: string,
        Status: int,
        LastProcessedDate: datetime,
        IsReadOnly: bool,
        RuleType: string
    },
    …
]

Response Codes

200 – Request successful. Smart Rule in the response body.

For more information, please see Common Response Codes.

GET SmartRules/{id}

Purpose

Returns a Smart Rule by ID.

Required Permissions

Read access to the Smart Rule referenced by ID.

URL Parameters

id: ID of the Smart Rule.

Request Body

None.

Response Body

Content-Type: application/json

{
    SmartRuleID: int,
    OrganizationID : string, // can be null
    Title: string,
    Description: string,
    Category: string,
    Status: int,
    LastProcessedDate: datetime,
    IsReadOnly: bool,
    RuleType: string
}

Response Codes

200 – Request successful. Smart Rule in the response body.

For more information, please see Common Response Codes.

GET UserGroups/{id}/SmartRules/

Purpose

Returns a list of Smart Rules to which the given user group ID has at least read access.

Requirements

User Accounts Management (Read).

URL Parameters

id: ID of the user group.

Query Parameters

accessLevel: (optional, default: 1,3) User group Smart Rule access level - A single value or comma-delimited list of values:

  • 0: None.
  • 1: Read.
  • 3: Read/Write.

Request Body

None.

Response Body

Content-Type: application/json

[{
    SmartRuleID: int,
    OrganizationID : string, // can be null
    Title: string,
    Description: string,
    Category: string,
    Status: int,
    LastProcessedDate: datetime,
    IsReadOnly: bool,
    RuleType: string,
    AccessLevelID: int,
}
,...
]

Response Codes

200 – Request successful. Smart Rules with user group access level in the response body.

GET SmartRules?title={title}

Purpose

Returns a Smart Rule by title.

In a multi-tenant environment, assumes global organization.

Required permissions

Read access to the Smart Rule referenced by title.

Query Parameters

title: Title of the Smart Rule.

Request Body

None.

Response Body

Content-Type: application/json

{
    SmartRuleID: int,
    OrganizationID : string, // can be null
    Title: string,
    Description: string,
    Category: string,
    Status: int,
    LastProcessedDate: datetime,
    IsReadOnly: bool,
    RuleType: string
}

Response Codes

200 – Request successful. Smart Rule in the response body.

For more information, please see Common Response Codes.

GET Organizations/{orgID}/SmartRules?title={title}

Purpose

Returns a Smart Rule by organization ID and title. This is only valid in a multi-tenant environment.

Required Permissions

Read access to the Smart Rule referenced by organization and title.

URL Parameters

orgID: ID of the organization.

Query Parameters

title: Title of the Smart Rule.

Request Body

None.

Response Body

Content-Type: application/json

{
    SmartRuleID: int,
    OrganizationID : string, // can be null
    Title: string,
    Description: string,
    Category: string,
    Status: int,
    LastProcessedDate: datetime,
    IsReadOnly: bool,
    RuleType: string
}

Response Codes

200 – Request successful. Smart Rule in the response body.

For more information, please see Common Response Codes.

POST SmartRules/FilterAssetAttribute

Purpose

Specialized action for creating an asset type Smart Rule for filtering assets by attributes.

Required Permissions

Asset Management (Read/Write).

Request Body

Content-Type: application/json

{
    AttributeIDs: [ int, …],
    Title: string,
    Category: string,
    Description: string,
    ProcessImmediately: bool
}

Request Body Details

  • AttributeIDs: (required) A list of attribute IDs to filter by. All the attributes must be of the same attribute type.
  • Title: (required) The title/name of the new Smart Rule. Must be unique across all Smart Rules. Max string length is 75.
  • Category: (required) The category in which to place the Smart Rule. Max string length is 50.
  • Description: (optional, default: <value of Title>) The Smart Rule description.
  • ProcessImmediately: (optional, default: true) True to process the Smart Rule immediately, otherwise false to defer processing to the background Smart Rule processor.

Response Body

Content-Type: application/json

{
    SmartRuleID: int,
    OrganizationID : string, // can be null
    Title: string,
    Description: string,
    Category: string,
    Status: int,
    LastProcessedDate: datetime,
    IsReadOnly: bool
}

Response Codes

201 - Request successful. Smart Rule in response body.

For more information, please see Common Response Codes.

POST SmartRules/{id}/Process

Purpose

Process a Smart Rule by ID.

Required Permissions

Read/Write access to the Smart Rule.

URL Parameters

ID: ID of the Smart Rule.

Query Parameters

Queue: (default: false) True to queue the Smart Rule for processing; false to process the Smart Rule immediately.

Request Body

None.

Response Body

Content-Type: application/json

{
    SmartRuleID: int,
    OrganizationID : string, // can be null
    Title: string,
    Description: string,
    Category: string,
    Status: int,
    LastProcessedDate: datetime,
    IsReadOnly: bool,
    RuleType: string
}

Response Codes

  • 200 – Request successful. Smart Rule in the response body.
  • 409 – Conflict: the Smart Rule is currently processing.

For more information, please see Common Response Codes.

DELETE SmartRules/{id}

Purpose

Deletes a Smart Rule by ID.

Required Permissions

Read/Write access to the Smart Rule referenced by ID

URL Parameters

ID: ID of the Smart Rule.

Request Body

None.

Response Body

None.

Response Codes

200 – Request successful.

For more information, please see Common Response Codes.

DELETE SmartRules?title={title}

Purpose

Deletes a Smart Rule by title.

In a multi-tenant environment, assumes global organization.

Required Permissions

Read/Write access to the Smart Rule referenced by title.

Query Parameters

title: Title of the Smart Rule.

Request Body

None.

Response Body

None.

Response Codes

200 – Request successful.

For more information, please see Common Response Codes.

DELETE Organizations/{orgID}/SmartRules?title={title}

Purpose

Deletes a Smart Rule by organization ID and title.

Only valid in a multi-tenant environment.

Required permissions

Read/Write access to the Smart Rule referenced by organization and title.

URL Parameters

orgID: ID of the organization.

Query Parameters

title: Title of the Smart Rule.

Request Body

None.

Response Body

None.

Response Codes

200 – Request successful.

For more information, please see Common Response Codes.