Set up a flow for SRT distribution

Flow

Create a flow that takes the 'sports1' content in and outputs to the 'sports1-affiliate' destination:

PUT https://api.mk.io/api/projects/myproject/v1/flow/flows/sports1

{
    "metadata": {
        "displayName": "Sports 1",
    },
    "spec": {
        "siteName": "westus2",
        "state": "Running",
        "inputs": [
            {
                "contentName": "sports1"
            }
        ],
        "outputs": [
            {
                "destinationName": "sports1-affliate"
            }
        ]
    }
}

The SRT distribution uses the simplest kind of flow; no flow transform is required. We need to tell the flow:

  • Which site it will run on. In this case we pick the 'westus2' site which is SaaS location in a specific region.
  • Which content to use. We created a source for this earlier that will be resolved automatically
  • Which destination(s) to output to.

Public URLs

Once the flow is created and activated, the SRT listeners needed to accept the requests from SRT callers will have been created with public URLs. We can discover those URLs by fetching the source and destination resources and reading their status sections.

For the source:

GET https://api.mk.io/api/projects/myproject>/v1/flow/sources/sports1-primary

{
  "kind": "Source",
  "metadata": {
      "id": "9b524106-3985-47ff-bf2f-df634c0a55da",
      "labels": {},
      "name": "sports1-primary",
      "displayName": "Sports 1 - Primary",
      "createdBy": "[email protected]",
      "createdByType": "User",
      "createdAt": "2024-11-11T14:45:00.639174Z",
      "lastModifiedBy": "[email protected]",
      "lastModifiedByType": "User",
      "lastModifiedAt": "2024-11-11T14:45:00.639193Z"
  },
  "spec": {
      "state": "Running",
      "contentName": "sports1",
      "networkName": "internet",
      "transport": {
          "type": "SRTCaller",
          "port": 5000,
          "ipResource": {
              "type": "External"
          },
          "encryptionStandard": "AES128",
          "passPhrase": "chooseasecret"
      }
  },
  "status": {
      "state": "Running",
      "shortId": "kny4g6u7ai7v",
      "network": {
          "name": "internet",
          "displayName": "Internet"
      },
      "transport": {
          "url": "srt://58.230.36.107:5000/passphrase=chooseasecret&pkbkeylen=16"
      }
  }
}

For the destination:

GET https://api.mk.io/api/projects/myproject/v1/flow/destinations/sports1-affiliate

{
    "kind": "Destination",
      "metadata": {
        "id": "412137d4-62db-48bb-b6d6-2440fb207ab3",
        "labels": {},
        "name": "sports1-affiliate",
        "displayName": "Sports 1 - Affiliate",
        "createdBy": "[email protected]",
        "createdByType": "User",
        "createdAt": "2024-11-11T14:45:38.545592Z",
        "lastModifiedBy": "[email protected]",
        "lastModifiedByType": "User",
        "lastModifiedAt": "2024-11-11T14:45:38.545621Z"
    },
    "spec": {
        "transport": {
            "type": "SRTCaller",
            "port": 5000,
            "ipResource": {
                "type": "External"
            },
            "encryptionStandard": "AES128",
            "passPhrase": "chooseasecret"
        },
        "networkName": "internet"
    },
    "status": {
        "state": "Inactive",
        "network": {
            "name": "internet",
            "displayName": "Internet"
        },
        "transport": {
            "url": "srt://31.234.153.141:5000/passphrase=chooseasecret&pkbkeylen=16"
        }
    }
}

The status.transport.url field from both the source and destination resources contains the URL that the external SRT callers should be configured with.

Once the SRT callers are configured, you are done; SRT content will be distributed from the the source to the destination.