# alter datasink

The `alter datasink add or remove source` command adds or removes a real-time streaming or batch source to or from a data sink. The data-sink job will start transferring data from your data source into the data sink. The job will periodically and continuously fetch data from your real-time data source into the data sink.

The `alter datasink outage_window` command adds or removes an outage window to or from the data sink. An operator-added outage window indicates that event data within this window must not be used for features. This can be an indication of data-source-scheduled maintenance periods. Backfill data will skip over outage windows. This is a useful mechanism to speed up backfill if you are aware of large time windows where there is no event data available.

## Syntax

{% code overflow="wrap" %}

```
alter datasink <datasink name>,add source <datasource name>
alter datasink <datasink name>,remove source <datasource name>

alter datasink <datasink name>,add outage_window start_timestamp=<outage start time>,end_timestamp=<outage end time>
alter datasink <datasink name>,remove outage_window start_timestamp=<outage start time>,end_timestamp=<outage end time>

alter datasink <datasink name>,add constraints <constraints filename>
alter datasink <datasink name>,remove constraints <constraints filename>

alter datasink <datasink name>,add metrics <metrics filename>,<metrics interval>
alter datasink <datasink name>,remove metrics <metrics filename>
```

{% endcode %}

## Parameters

| Parameter                | Description                                                                         |
| ------------------------ | ----------------------------------------------------------------------------------- |
| `<datasource name>`      | The name of the data source                                                         |
| `<datasink name>`        | The name of the data sink                                                           |
| `<outage start time>`    | The start time of the event data outage                                             |
| `<outage end time>`      | The end time of the event data outage                                               |
| `<constraints filename>` | The file containing the constraints to add or remove                                |
| `<metrics filename>`     | The file containing the metrics to add or remove                                    |
| `<metrics interval>`     | The interval at which to compute metrics. This is required for an events data sink. |

## Example

{% code overflow="wrap" %}

```
alter datasink trip_datasink,add source trip_realtime_datasource
```

{% endcode %}
