Blocks API

Overview

The blocks API provides the users with the capability to list the blocks in the platform, and use them within their pipelines

Usage

import razor
razor.api.blocks()

Arguments

Argument Description
scope This argument filters the blocks available at the scope level. The platform supports two scopes.
1. BlockScope.ORG - Filters all blocks, which are at an organisation level. i.e. blocks which are global to the organisation
2. BlockScope.PROJECT - Filter all blocks, which are available only at the project level
bundlename Filter by a bundle name
blockname Filter by a block name

Examples

List all blocks

import razor
razor.api.blocks()

List Blocks by Scope

import razor
razor.api.blocks(scope=BlockScope.ORG)
razor.api.blocks(scope=BlockScope.PROJECT)

List blocks by bundle name

import razor
razor.api.blocks(bundlename='default')

List blocks by block name

import razor
razor.api.blocks(blockname='HelloWorld')