Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When accessing the Opsera API, this is the URL to use:

https://app.opsera.io

Info

Your base URL may be different based on what platform you are using. Please consult with Opsera to identify your base API URL before proceeding.

URL

METHOD

DESCRIPTION

Scope

Access

DATA

RESPONSE

/api/v1/pipeline/run

POST

Triggers a run operation on the pipeline which returns the status, a message and the run count for the new run.

API Access

Pipeline Access

Item RBAC

Code Block
{
    "pipelineId":"5fd56d90979ee048ee660624"
}
Code Block
{
    "status": "executed",
    "message": "Run pipeline request submitted successfully for (5fd56d90979ee048ee660624)",
    "runCount": 2
}

OR

Code Block
{
    "status": "failed",
    "message": "Pipeline 5fd56d90979ee048ee660624 is currently in a paused state.  Will not start another job until this pending status is resolved."
}

/api/v1/pipeline/status

POST

Gets the status of a pipeline based on the run count. So this can work against the current run or prior runs from a historical perspective.

API Access

Pipeline Access

Pipeline Logs (Read Only)

Item RBAC

Code Block
{
    "pipelineId":"5fd56d90979ee048ee660624",
    "runCount": 3
}

Code Block
{
    "status": "success",
    "message": "Pipeline: Blank Template's Run 3 was successful."
}

/api/v1/pipeline/reset

POST

Resets the pipeline to the beginning, clearing out any current run data.

API Access

Pipeline Access

Item RBAC

Code Block
{
    "pipelineId":"5fd56d90979ee048ee660624"
}

Code Block
    "status": "success",
    "message": "The pipeline run status has been reset."
}

/api/v1/pipeline/stop

POST

Stops a running pipeline. This action will post a stop operation to kafka for supported tools, but the pipeline job will finish it’s current operaiton and then shut down. This is not a hard stop operation.

API Access

Pipeline Access

Item RBAC

Code Block
{
    "pipelineId":"5fd56d90979ee048ee660624"
}

Code Block
{
    "status": "success",
    "message": "The pipeline has been stopped."
}

/api/v1/pipeline/summary

POST

Gets the pipeline data by ID

API Access

Pipeline Access

Item RBAC

Code Block
{
    "pipelineId":"5fd56d90979ee048ee660624"
}

Returns full JSON data object of pipeline.

/api/v1/pipeline/logs

POST

Gets pipeline activity logs. Optional runCount can be passed as integer. Data is limited to a max of 1000 records and is always sorted by most recent activity first.

The “type” property of the POST body is optional. If that exact string “console output” is passed, it will restrict the logs being returned to the console log activity for that given run.

API Access

Pipeline Access

Pipeline Logs (Read Only)

Item RBAC

Code Block
{
    "pipelineId":"5fd56d90979ee048ee660624",
    "runCount": 2,
    "type":"console output" //optional value
}

Array of pipeline activity logs.

/api/v1/registry/tools

GET

Gets the list of all tools (with all JSON data) that they have access to.

API Access

Tool Registry Access

Power User Role

n/a

Returns an array of tool objects in JSON format

/api/v1/registry/summary

POST

Gets a tool registry JSON object with ALL data about that tool by ID.

API Access

Tool Registry Access

Item RBAC

Code Block
{
    "toolId":"5fc7a12ebed9dd3a622f5d22"
}

Returns the full tool object in JSON format.

/api/v1/registry/update

POST

Passes a tool registry ID and then the data object properties of that tool in JSON that you wish to update. This can be as much or as little of the root JSON object as long as the data structure is preserved. It’s advised not to send the “_id” but it isn’t going to break things. Same with the createdAt or updatedAt. This allows for strategic updates of just the root properties of the pipeline data object or the whole thing.

API Access

Tool Registry Access

Item RBAC

Code Block
{
    "toolId":"5fd56d90979ee048ee660624",
    "tool": {
        "name":"Updated Tool Name Via CLI",
        "description": "Updating the description here through customer API.  Fingers crossed"
    }
}

Returns the updated tool object in JSON format

/api/v1/pipeline/pipelines

GET

Gets the list of all pipelines (with all JSON data) the user token has access to

API Access

Pipeline Access

Power User Role

n/a

Returns an array of pipeline objects in JSON format

/api/v1/logs/user/actions

GET

Gets the User Activity Logs for the system. This is a route limited to Site Admins and Power users and requires a token of either API scope or Security Logs scope.

If no date parameter is passed, the last 7 days of logs will be returned (up to a max of 1000 records)

API Access

Security Logs (Read Only)

Power User Role

Optional Query Parameters:

?date=YYYY-MM-DD

?type=<value from type field>

?count=<integer, number of records>

Code Block
{
    "count": 6,
    "data": [
        {
            "_id": "61042540e1d666c9ded178c4",
            "user_id": "5e1cbf251c26d68f7ce6361e",
            "user_email": "support@opsera.io",
            "type": "pipeline",
            "action": "update",
            "target_id": "5fbe589a0fae8b021e137534",
            "account": "org-opsera-dnd-acc0",
            "createdAt": "2021-07-30T16:13:52.109Z",
            "updatedAt": "2021-07-30T16:13:52.109Z",
            "__v": 0
        },
  ]
}

/api/v1/logs/user/tokens

GET

Gets the Personal Access Tokens' Activity Logs. This is a route limited to Site Admins and Power users and requires a token of either API scope or Security Logs scope.

If no date parameter is passed, the last 7 days will be returned.(up to a max of 1000 records)

API Access

Security Logs (Read Only)

Power User Role

Optional Query Parameters:

?date=YYYY-MM-DD

?scope=<value from scope field>

Code Block
{
    "count": 6,
    "data": [
        {
            "_id": "61057f3a1429a35336563240",
            "token_id": "61043b2bbcb6d95b55adc5fd",
            "scope": "api",
            "target": "/v1/logs/user/tokens",
            "user_id": "5e1cbf251c26d68f7ce6361e",
            "account": "org-opsera-dnd-acc0",
            "createdAt": "2021-07-31T16:50:02.242Z",
            "updatedAt": "2021-07-31T16:50:02.242Z",
            "__v": 0
        },
  ]
}

/api/v1/tasks

GET

Gets a list of all tasks.

API Access

Item RBAC

Code Block
{
  "count": 286,
  "data": [...
  ]
}

api/v1/tasks/summary

POST

Gets a task by ID

API Access

Item RBAC

Code Block
taskId
Code Block
{
    "_id": "6116cf8b62e1f0f2459de839",
    "tags": [],
    "name": "AAACCCTask",
    "description": "",
    "type": "sync-sfdc-repo",
    "tool_identifier": "bitbucket",
    "active": true,
    "configuration": {
        "type": "bitbucket",
        "jobType": "",
        "toolConfigId": "60e6b0ed1c1593ad863029fa",
        "autoScaleEnable": false,
        "toolJobName": "",
        "toolName": "QA Jenkins Master",
        "jobName": null,
        "agentLabels": "",
        "toolJobId": "",
        "projectId": "sfdx-repo",
        "buildType": "ant",
        "gitToolId": "60d56ba1a641241a34cd1505",
        "gitUrl": "https://GeorgeOpsera@bitbucket.org/rajeswarr1/sfdx-repo.git",
        "sshUrl": "git@bitbucket.org:rajeswarr1/sfdx-repo.git",
        "service": "bitbucket",
        "gitCredential": "BBcloud",
        "workspace": "rajeswarr1",
        "workspaceName": "rajeswarr1",
        "repository": "SFDX Repo",
        "branch": "sfdx-test_1232",
        "gitBranch": "sfdx-test_1232",
        "sourceBranch": "",
        "autoApprove": false,
        "defaultBranch": "sfdx-test_1232",
        "dependencyType": "",
        "sfdcToolId": "61166bfe270779640401d705",
        "sfdcToolName": "Sfdx Opsera",
        "accountUsername": "sundar@opsera.io",
        "isNewBranch": true,
        "upstreamBranch": "sfdx-rel-test",
        "includePackageXml": false,
        "packageXmlReferencePath": "",
        "reviewers": [],
        "reviewerNames": [],
        "sfdcDestToolId": "",
        "destAccountUsername": "",
        "sfdcUnitTestType": "",
        "workspaceDeleteFlag": false,
        "gitUserName": "GeorgeOpsera",
        "repoId": "sfdx-repo"
    },
    "status": "failure",
    "roles": [],
    "account": "org102-acc",
    "owner": "HariOwner Ldap",
    "createdAt": "2021-08-13T20:01:15.376Z",
    "updatedAt": "2021-11-08T06:21:57.182Z",
    "__v": 0,
    "owner_name": "HariOwner Ldap",
    "run_count": 4,
    "message": "[Git Merge Action]: Synch up successful",
    "jenkinsIds": []
}
Code Block
/api/v1/tasks/status

POST

Gets the status of a task’s last status and returns it as a string

Code Block
API Access

Item RBAC

Code Block
taskId

Returns task status as a string.

Code Block
/api/v1/logs/task

GET

Returns a task log

Code Block
API Access
Code Block
Security Logs

Item RBAC

Code Block
taskId

Optional Query Parameters:

Code Block
runCount

Code Block
languagenone
page

Code Block
count

Code Block
{
    "count": 9,
    "data": [
    ]
}