Smart Rules

Quick Navigation

GET SmartRules

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

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

None.

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
    },
    …
]

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

For more information, please see Common Response Codes.

GET SmartRules/{id}

Returns a Smart Rule by ID.

Read access to the Smart Rule referenced by ID.

id: ID of the Smart Rule.

None.

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
}

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

For more information, please see Common Response Codes.

GET UserGroups/{id}/SmartRules/

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

User Accounts Management (Read).

id: ID of the user group.

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.

None.

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,
}
,...
]

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

GET SmartRules?title={title}

Returns a Smart Rule by title.

In a multi-tenant environment, assumes global organization.

Read access to the Smart Rule referenced by title.

title: Title of the Smart Rule.

None.

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
}

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

For more information, please see Common Response Codes.

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

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

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

orgID: ID of the organization.

title: Title of the Smart Rule.

None.

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
}

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

For more information, please see Common Response Codes.

POST SmartRules/FilterAssetAttribute

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

Asset Management (Read/Write).

Content-Type: application/json

{
    AttributeIDs: [ int, …],
    Title: string,
    Category: string,
    Description: string,
    ProcessImmediately: bool
}
  • 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.

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

Process a Smart Rule by ID.

Read/Write access to the Smart Rule.

ID: ID of the Smart Rule.

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

None.

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
}
  • 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}

Deletes a Smart Rule by ID.

Read/Write access to the Smart Rule referenced by ID

ID: ID of the Smart Rule.

None.

None.

200 – Request successful.

For more information, please see Common Response Codes.

DELETE SmartRules?title={title}

Deletes a Smart Rule by title.

In a multi-tenant environment, assumes global organization.

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

title: Title of the Smart Rule.

None.

None.

200 – Request successful.

For more information, please see Common Response Codes.

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

Deletes a Smart Rule by organization ID and title.

Only valid in a multi-tenant environment.

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

orgID: ID of the organization.

title: Title of the Smart Rule.

None.

None.

200 – Request successful.

For more information, please see Common Response Codes.