📘

NOTE:

All REST endpoints require your organizational slug and a JWT Token for authentication. Results are in JSON format. For more details see https://developers.tetrascience.com/reference/authentication.

This page contains ways to combine endpoints.

Update a pipeline to use a new version of the protocol

In this example, we will use the Search and Update Pipeline endpoints find all enabled pipelines that use protocol v2 and update them to use protocol v3.

  1. Search for pipelines that use protocol v2. See the example below.
curl --location --request GET \
'https://api.tetrascience.com/v1/pipeline/search?pipelineStatus=enabled&protocolName=empower-raw-to-ids&protocolVersion=v2.0.0' \
--header 'x-org-slug: <YOUR ORG SLUG>' \
--header 'Content-Type: application/json' \
--header 'ts-auth-token: <JWT TOKEN>' \
--data-raw ''

In the request above, note that the Pipeline filter is part of the request:

  • enabled pipeline
  • protocolName = empower-raw-to-ids
  • protocolVersion = v2.0.0 (optionally you can say all versions to update all old protocols to new version).

The response appears below.

RESPONSE 200 OK 
{
	"size": 10,
	"hasNext": true,
	"from": 1,
	"hits": [{
		"id": "4a52c1f2-g99g-4432-9523-06a8f2b1gggg",
		"name": "Example Egnyte To Empower",
		"description": null,
		"triggerType": "custom",
		"triggerCondition": {
			"groupOperator": "AND",
			"groupLevel": 1,
			"groups": [{
				"groupLevel": 2,
				"groupOperator": "AND",
				"groups": [{
					"key": "sourceId",
					"operator": "is",
					"value": "439966a2-b7c3-4843-8ggg-321a0gg94d3a"
				}]
			}]
		},
		"protocolSlug": "empower-raw-to-ids",
		"protocolVersion": "v2.0.0",
		"createdAt": "2020-10-08T11:39:00.684Z",
		"updatedAt": "2021-03-30T14:37:22.522Z",
		"pipelineConfig": {},
		"masterScriptNamespace": "common",
		"masterScriptSlug": "empower-raw-to-ids",
		"masterScriptVersion": "v2.0.0",
		"status": null,
		"standby": null,
		"retryBehavior": null,
		"priority": null,
		"maxSlotLimit": null,
		"taskScriptTimeoutMins": null
	}, {
		"id": "g27gggg3-8d91-419ga-22ff-728gggg24223",
		"name": "TestEmpower",
		.... 
	}],
	"totalCount": 17
}

📘

NOTE:

In the example response above, totalCount is 17. This means there are 17 pipelines that match the search criteria, but we only return 10 pipeline objects because of the page size.

  1. For each pipeline that was returned loop through getting the details for a pipeline, then update the protocol. You can programmatically create a For loop that gets the details for each pipeline and changes the protocol using the Update Existing Pipelines API. To do this, you would:
    a. Retrieve configuration details for the pipeline using the Get the Details for a Single Pipeline endpoint.
    b. Update pipelines to use protocol v3. See the [Update Existing Pipeline] (https://developers.tetrascience.com/reference/update-existing-pipeline) for more information on that endpoint.