Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

Command Line Processor helps user to invoke OpsEra services through command line interface. This OpsEra CLI gives support for Creating, Executing OpsEra pipelines from user's local machine using YAML. Users can download OpsEra CLI and able to install it in their local machine just by hitting a simple npm command.

Package Prerequisites

  • Node should be installed on user’s machine to pull OpsEra CLI from NPM repository.

  • User has to run the below command to make it work.

npm install opsera -g

Commands

opsera --help
opsera --version

Configure

opsera configure

Get Pipelines

opsera get pipelines
opsera get pipelines --out=<fileName>
opsera get pipelines --out <fileName>
opsera get pipelines -o=<fileName>
opsera get pipelines -o <fileName>
opsera get pipelines >> <fileName>

Get Tools

opsera get tools
opsera get tools --out=<fileName>
opsera get tools -o=<fileName>
opsera get tools >> <fileName>

Run Pipeline

opsera run pipeline --pipeline-id=<pipelineId>
opsera run pipeline -p=<pipelineId>

Stop Pipeline

opsera stop pipeline --pipeline-id=<pipelineId>

Status Pipeline

opsera status pipeline --pipeline-id=<pipelineId>
opsera status pipeline --pipeline-id=<pipelineId> --run-count=<runCount>
opsera status pipeline -p=<pipelineId>
opsera status pipeline -p=<pipelineId> -c=<runCount>

Reset Pipeline

opsera reset pipeline --pipeline-id=<pipelineId>

Summary

opsera summary pipeline --pipeline-id=<pipelineId>
opsera summary pipeline --pipeline-id=<pipelineId> --out=<fileName>
opsera summary tool --tool-id=<toolId>
opsera summary tool --tool-id=<toolId> --out=<fileName>

Logs

opsera logs pipeline --pipeline-id=<pipelineId>
opsera logs pipeline --pipeline-id=<pipelineId> --run-count=<runCount>
opsera logs pipeline --pipeline-id=<pipelineId> --run-count=<runCount> --out=<fileName>

OpsEra Help Command

This command helps to see the list of available options and its usage

OpsEra Version Command

Helps to see the current version of CLI

OpsEra Configure Command

This command helps to set Access token in users machine and it will be used for Authentication during command executions similar to AWS CLI. We can also set workspace as YAML files location by default it takes current working directory as workspace.

Also, we can update by executing the same command.

OpsEra config file created under users and we manually also can make an entry instead of calling configure Command.

OpsEra Create Command

This command helps to create pipelines by reading pipeline.yaml file from the workspace. Just like set config command here also YAML parser service has to be called before making node call for field validation and YAML conversion.

Headers

Authorization: <OpsEra Access Token>

Payload

{
        "projects": [],
        "tags": [],
        "accounts": [],
        "tool_tagging": [],
        "name": "Bit Bucket Server Raj",
        "description": "",
        "tool_identifier": "bitbucket",
        "costCenter": "",
        "compliance": [],
        "licensing": [],
        "location": [],
        "classification": "",
        "contacts": [],
        "applications": [],
        "organization": [],
        "external_reference": [],
        "active": true,
        "roles": [],
        "status": "",
        "tool_type_identifier": "source",
        "owner": "5e1cbf251c26d68f7ce6361e",
        "account": "org-opsera-dnd-acc0",
        "jobs": [],
        "actions": [],
        "configuration": {}
}

Other Pipeline Commands

These commands will make corresponding call to node to get, run, reset, stop, summary & logs of a pipeline.

opsera get pipelines
opsera run pipeline --pipeline-id=<pipelineId>
opsera stop pipeline --pipeline-id=<pipelineId>
opsera reset pipeline --pipeline-id=<pipelineId>
opsera status pipeline --pipeline-id=<pipelineId> --run-count=<runCount>
opsera summary pipeline --pipeline-id=<pipelineId> --out=<fileName>
opsera logs pipeline --pipeline-id=<pipelineId> --run-count=<runCount>

Related Links

https://www.npmjs.com/package/@opsera/opsera-cli

  • No labels