Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP SQL Anywhere, on-demand edition 1.0 SP 6 » Task syntax

AlterRule task

Changes an existing rule.

Syntax 1 (SQL)
CALL DBCloud.AlterRule ( rule_id=rule_id [, optional-parameters ] )
Syntax 2 (Cloud Command utility)
dbcloudcmd run AlterRule rule_id [ optional-parameters ]
Parameters
  • rule_id

    The rule to alter. (Required)

  • is_strict

    Set to 1 for a strict rule and 0 for a weak rule. (When set to 1, the target_object_id or target_tag_id is required.) The default is the current value.

  • rule_definition

    The search query that must hold for each target object, in quotes. The default is the current value.

  • target_object_type

    The type of object the rule applies to. The default is the current value.

    The following values are supported:

    • Host

      A host.

    • Server

      A cloud server.

    • Database

      A tenant database.

  • target_object

    The object the rule applies to. Accepts a search query that identifies one object that is of the same type as that defined for the target_object_type parameter, for example an object name or ID. The default is the current value.

  • target_tag

    The tag the rule applies to. Accepts a search query that identifies one tag, for example a tag name or ID. The default is the current value.

  • rule_name

    The name for the rule. The default is the current value.

  • object_etag

    Internal use only. The default is NULL.

  • object_updated

    The last time the object was modified. If provided, the task fails if the object has changed since the specified time. The default is NULL.

Required privileges

CreateDropRule

Remarks
  • is_strict

    This parameter specifies whether the rule is strict or weak. Strict rules apply to a single object or to a group of the same type of object with the same tag. When creating a strict rule, you must specify either target_object_id or target_tag_id. A rule can be strict only if the properties that it refers to are properties that can be controlled by the cloud.

  • target_object_type

    The target_object_type parameter. Accepts a single object type. The rule applies to only the specified object type.

  • rule_definition

    Specifies the syntax for the rule. Rules use the same syntax as searches.

  • object_updated

    To ensure that you are not over-writing another user's changes, run dbcloudcmd -v describe task to get the time the cloud was last modified. Specify this value as the object_updated parameter. If the cloud has been altered since the specified time, then the task fails with an error. If this occurs, run the task again after re-running dbcloudcmd -v describe task.

The AlterRule task requires that you specify the ID of the rule that you want to alter. Run the following command to find a rule ID: dbcloudcmd describe Rules.

Example

The following command alters a weak rule that specifies that every host must have a tag indicating its country.

dbcloudcmd run AlterRule rule_id=RL-q4w5 is_strict=0 rule_definition="tag:Canada or tag:US or tag:Greece" target_object_type=Host 

The following command alters a cloud rule:

dbcloudcmd run ExecuteTaskBatch "CALL DBCloud.AlterRule ('RL-l9b5',0,'tag:CloudyTag', 'myserver#3',)"