Demisto Lock

Locking mechanism that prevents concurrent execution of different tasks.

Utilities · Cortex Lock

Details

IDDemisto Lock
ProviderPalo Alto Networks
CategoryUtilities
From Version5.0.0
Supported ModulesAgentix Cortex Cloud Cloud Runtime Security Cloud Posture Security XSIAM EDR

README

Overview

Demisto Lock is a mechanism that enables users to prevent concurrent execution of tasks. This is a native integration, which does not require configuration.


Commands

You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

  1. Get a lock: demisto-lock-get
  2. Show lock information: demisto-lock-info
  3. Release a lock: demisto-lock-release
  4. Release all locks: demisto-lock-release-all

Get a lock

Gets a specific lock. If the lock doesn't exist, it creates one. If the lock is already in use, the command waits until the lock is released or until timeout is reached. If timeout is reached and the lock hasn't been released, the command fails to get the lock.

Base Command

demisto-lock-get

Input
Parameter Description
name Lock name. When omitted, the default is Default.
info Additional information about the lock
timeout Timeout to wait for the lock to be released

Show lock information

Retreives information for a specified lock.

Base Command

demisto-lock-info

Input
Parameter Description
name Name of lock to retrieve information for. When omitted, the default is Default.

Release a lock

Release a specified lock.

Base Command

demisto-lock-release

Input
Parameter Description
name Name of lock to release. When omitted, the default is Default.

Release all locks

Release a specified lock.

Base Command

demisto-lock-release-all

Input

There is no input for this command.

Troubleshooting

If you use multiple locks which might be set in parallel, it is recommended to enable the Sync integration cache (Available from Cortex XSOAR 6.2.0).

Configuration parameters

  • timeout — Default timeout (seconds) for wait on locks to be released (required)
  • polling_interval — Polling interval
  • sync — Sync integration cache

Commands (4)

  • demisto-lock-get

    Gets a specific lock. If the lock doesn't exist, it creates one. If the lock is already in use, the command waits until the lock is released or until timeout is reached. If timeout is reached and the lock hasn't been released, the command fails to get the lock.

  • demisto-lock-info

    Show information on locks.

  • demisto-lock-release

    Release a lock.

  • demisto-lock-release-all

    Release all locks.

commonfields:
  id: Demisto Lock
  version: -1
sectionorder:
- Connect
- Collect
name: Demisto Lock
display: Demisto Lock
category: Utilities
provider: Palo Alto Networks
description: Locking mechanism that prevents concurrent execution of different tasks.
configuration:
- display: Default timeout (seconds) for wait on locks to be released
  name: timeout
  defaultvalue: "600"
  type: 0
  required: true
  section: Connect
  advanced: true
- display: Polling interval
  name: polling_interval
  type: 0
  additionalinfo: Default polling interval value for `demisto-lock-get`, can be overridden by the "polling_interval" argument.
  section: Connect
  advanced: true
  required: false
- display: Sync integration cache
  name: sync
  defaultvalue: "false"
  type: 8
  additionalinfo: Whether to sync the integration cache with the database (Available from Cortex XSOAR 6.2.0).
  section: Connect
  advanced: true
  required: false
script:
  script: ''
  type: javascript
  commands:
  - name: demisto-lock-get
    polling: true
    arguments:
    - name: name
      default: true
      description: Name of lock. When omitted, name is set to Default.
    - name: info
      description: Additional information to provide for the lock instance.
    - name: timeout
      description: Timeout (seconds) for wait on lock to be freed.
    - name: polling_interval
      description: Polling interval (seconds) between each lock acquire attempt.
    - name: guid
      description: Unique identifier value of the lock.
      hidden: true
    - name: timeout_err_msg
      description: Polling Timeout error message.
      hidden: true
    description: Gets a specific lock. If the lock doesn't exist, it creates one. If the lock is already in use, the command waits until the lock is released or until timeout is reached. If timeout is reached and the lock hasn't been released, the command fails to get the lock.
  - name: demisto-lock-release
    arguments:
    - name: name
      default: true
      description: Name of lock to release. When omitted, name is set to Default.
    description: Release a lock.
  - name: demisto-lock-info
    arguments:
    - name: name
      default: true
      description: Specific lock to show info for. If not specified, shows info for all locks.
    description: Show information on locks.
  - name: demisto-lock-release-all
    arguments: []
    description: Release all locks.
marketplaces:
- xsoar
- marketplacev2
- platform
fromversion: 5.0.0
tests:
- No tests