> **Experimental**
>
> `@aws-cdk/aws-medialive-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# Pipeline

Class · [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)

MediaLive pipeline (channel pipeline 0 or 1).

`STANDARD` channels run two redundant pipelines (`PIPELINE_0`, `PIPELINE_1`).
`SINGLE_PIPELINE` channels run only `PIPELINE_0`.

Obtainable from: Pipeline.PIPELINE_0, Pipeline.PIPELINE_1
Used as argument in: [IChannel.metric](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.IChannel.html#metric), [IChannel.metricActiveAlerts](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.IChannel.html#metricactivealerts), IChannel.metricDroppedFrames, IChannel.metricFillMsec, IChannel.metricInputLossSeconds, IChannel.metricInputVideoFrameRate, IChannel.metricNetworkIn, IChannel.metricNetworkOut, IChannel.metricSvqTime

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/channel.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-medialive-alpha/lib/channel.ts#L225)

## Example

TypeScript:

```ts
declare const channel: medialive.Channel;
declare const stack: Stack;

channel.metricDroppedFrames(medialive.Pipeline.PIPELINE_0).createAlarm(stack, 'DroppedFrames', {
  threshold: 1,
  evaluationPeriods: 2,
});

channel.metricSvqTime(medialive.Pipeline.PIPELINE_0).createAlarm(stack, 'SvqTime', {
  threshold: 0,
  evaluationPeriods: 1,
});

// Custom metric by name with sum statistic
channel.metric('Output4xxErrors', medialive.Pipeline.PIPELINE_0, { statistic: 'sum' });
```

Python:

```python
# channel: medialive.Channel
# stack: Stack

channel.metric_dropped_frames(medialive.Pipeline.PIPELINE_0).create_alarm(stack, "DroppedFrames",
    threshold=1,
    evaluation_periods=2
)

channel.metric_svq_time(medialive.Pipeline.PIPELINE_0).create_alarm(stack, "SvqTime",
    threshold=0,
    evaluation_periods=1
)

# Custom metric by name with sum statistic
channel.metric("Output4xxErrors", medialive.Pipeline.PIPELINE_0, statistic="sum")
```

Java:

```java
Channel channel;
Stack stack;

channel.metricDroppedFrames(Pipeline.PIPELINE_0).createAlarm(stack, "DroppedFrames", CreateAlarmOptions.builder()
        .threshold(1)
        .evaluationPeriods(2)
        .build());

channel.metricSvqTime(Pipeline.PIPELINE_0).createAlarm(stack, "SvqTime", CreateAlarmOptions.builder()
        .threshold(0)
        .evaluationPeriods(1)
        .build());

// Custom metric by name with sum statistic
channel.metric("Output4xxErrors", Pipeline.PIPELINE_0, MetricOptions.builder().statistic("sum").build());
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaLive.Alpha
Channel channel;
Stack stack;

channel.MetricDroppedFrames(Pipeline.PIPELINE_0).CreateAlarm(stack, "DroppedFrames", new CreateAlarmOptions {
    Threshold = 1,
    EvaluationPeriods = 2
});

channel.MetricSvqTime(Pipeline.PIPELINE_0).CreateAlarm(stack, "SvqTime", new CreateAlarmOptions {
    Threshold = 0,
    EvaluationPeriods = 1
});

// Custom metric by name with sum statistic
channel.Metric("Output4xxErrors", Pipeline.PIPELINE_0, new MetricOptions { Statistic = "sum" });
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awsmedialivealpha/v2
var channel Channel
var stack Stack

channel.metricDroppedFrames(medialive.Pipeline_PIPELINE_0()).CreateAlarm(stack, jsii.String("DroppedFrames"), &CreateAlarmOptions{
	Threshold: jsii.Number(1),
	EvaluationPeriods: jsii.Number(2),
})

channel.metricSvqTime(medialive.Pipeline_PIPELINE_0()).CreateAlarm(stack, jsii.String("SvqTime"), &CreateAlarmOptions{
	Threshold: jsii.Number(0),
	EvaluationPeriods: jsii.Number(1),
})

// Custom metric by name with sum statistic
channel.metric(jsii.String("Output4xxErrors"), medialive.Pipeline_PIPELINE_0(), &MetricOptions{
	Statistic: jsii.String("sum"),
})
```

## Properties

- `PIPELINE_0`: [Pipeline](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.Pipeline.html) (static) — Pipeline 0.

  Always available on every channel.

- `PIPELINE_1`: [Pipeline](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-medialive-alpha.Pipeline.html) (static) — Pipeline 1.

  Available only on `STANDARD` channels.

## Methods

- `toString(): string` — Returns the CloudWatch dimension value for this pipeline (`'0'` or `'1'`).
