Skip to content

CLI Usage

Charles d'Avernas edited this page Aug 13, 2024 · 2 revisions

This document provides an overview of how to use the Synapse Command Line Interface (CLI) to interact with various resources such as workflows, correlators, and namespaces.

Table of Contents

Getting Started

Before using the CLI, ensure you have it installed and configured. You can download the CLI from the Synapse repository or the official website. To configure the CLI, use the synapse config command to set up your environment and authentication details.

synapse config --help

CLI Commands

Configuration Commands

  • Delete API Configuration

    synapse config delete-api <name>

    Deletes the API configuration with the specified name.

  • Get All API Configurations

    synapse config get-apis

    Retrieves all configured APIs.

  • Set API Configuration

    synapse config set-api <name> [options]

    Configures the API used by the Synapse CLI. This command requires the name of the configuration to be set. Additional options are available for specifying the server and token.

    Options:

    • -s, --server <server>
      The address of the API server to use.

    • -t, --token <token>
      The token used to authenticate on the API server.

    • -?, -h, --help
      Show help and usage information.

    Example:

    synapse config set-api my-api --server https://api.example.com --token my-secret-token
    

Workflow Commands

  • Create a Workflow

    synapse workflow create --name <workflow-name> --namespace <namespace> --definition <definition-file>

    Creates a new workflow with the specified name, namespace, and definition file.

  • List Workflows

    synapse workflow list --namespace <namespace>

    Lists all workflows within a given namespace.

  • Get Workflow

    synapse workflow get --name <workflow-name> --namespace <namespace>

    Retrieves details of a specific workflow.

  • Update Workflow

    synapse workflow update --name <workflow-name> --namespace <namespace> --definition <definition-file>

    Updates the definition of an existing workflow.

  • Delete Workflow

    synapse workflow delete --name <workflow-name> --namespace <namespace>

    Deletes a specific workflow.


Workflow Instance Commands

  • Get Workflow Instance

    synapse workflow-instances get --name <name> --namespace <namespace>

    Retrieves details of the specified workflow instance.

  • Get Workflow Instance Output

    synapse workflow-instances get-output --name <name> --namespace <namespace>

    Retrieves the output of the specified workflow instance.

  • List Workflow Instances

    synapse workflow-instances list --namespace <namespace>

    Lists all workflow instances within a given namespace.

  • Delete Workflow Instance

    synapse workflow-instance delete --name <workflow-instance-name> --namespace <namespace>

    Deletes the specified workflow instance.


Operator Commands

  • Create a Operator

    synapse operator create --name <operator-name> --namespace <namespace> --definition <definition-file>

    Creates a new operator with the specified name, namespace, and definition file.

  • List Operators

    synapse operator list --namespace <namespace>

    Lists all operators within a given namespace.

  • Get Operator

    synapse operator get --name <operator-name> --namespace <namespace>

    Retrieves details of a specific operator.

  • Update Operator

    synapse operator update --name <operator-name> --namespace <namespace> --definition <definition-file>

    Updates the definition of an existing operator.

  • Delete Operator

    synapse operator delete --name <operator-name> --namespace <namespace>

    Deletes a specific operator.


Correlator Commands

  • Create a Correlator

    synapse correlator create --name <correlator-name> --namespace <namespace> --definition <definition-file>

    Creates a new correlator with the specified name, namespace, and definition file.

  • List Correlators

    synapse correlator list --namespace <namespace>

    Lists all correlators within a given namespace.

  • Get Correlator

    synapse correlator get --name <correlator-name> --namespace <namespace>

    Retrieves details of a specific correlator.

  • Update Correlator

    synapse correlator update --name <correlator-name> --namespace <namespace> --definition <definition-file>

    Updates the definition of an existing correlator.

  • Delete Correlator

    synapse correlator delete --name <correlator-name> --namespace <namespace>

    Deletes a specific correlator.


Namespace Commands

  • Create a Namespace

    synapse namespace create --name <namespace-name> --description <description>

    Creates a new namespace with the specified name and description.

  • List Namespaces

    synapse namespace list

    Lists all namespaces.

  • Get Namespace

    synapse namespace get --name <namespace-name>

    Retrieves details of a specific namespace.

  • Update Namespace

    synapse namespace update --name <namespace-name> --description <description>

    Updates the description of an existing namespace.

  • Delete Namespace

    synapse namespace delete --name <namespace-name>

    Deletes a specific namespace.


Document Commands

  • Create Document

    synapse document create --name <document-name> --namespace <namespace> --file <document-file>

    Creates a new document within the specified namespace.

  • List Documents

    synapse document list --namespace <namespace>

    Lists all documents within a given namespace.

  • Get Document

    synapse document get --name <document-name> --namespace <namespace>

    Retrieves details of a specific document.

  • Update Document

    synapse document update --name <document-name> --namespace <namespace> --file <document-file>

    Updates the contents of an existing document.

  • Delete Document

    synapse document delete --name <document-name> --namespace <namespace>

    Deletes a specific document.


Service Account Commands

  • Create Service Account

    synapse service-account create --name <account-name> --namespace <namespace> --credentials <credentials-file>

    Creates a new service account with the specified name and credentials.

  • List Service Accounts

    synapse service-account list --namespace <namespace>

    Lists all service accounts within a given namespace.

  • Get Service Account

    synapse service-account get --name <account-name> --namespace <namespace>

    Retrieves details of a specific service account.

  • Update Service Account

    synapse service-account update --name <account-name> --namespace <namespace> --credentials <credentials-file>

    Updates the credentials of an existing service account.

  • Delete Service Account

    synapse service-account delete --name <account-name> --namespace <namespace>

    Deletes a specific service account.

Help and Documentation

For more detailed information on any command, use the --help flag:

synapse <command> --help