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 ermissions

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.