Update connector scheduling API
editUpdate connector scheduling API
editThis functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.
Updates the scheduling configuration of a connector.
To get started with Connector APIs, check out our tutorial.
Request
editPUT _connector/<connector_id>/_scheduling
Prerequisites
edit- To sync data using self-managed connectors, you need to deploy the Elastic connector service. on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.
-
The
connector_idparameter should reference an existing connector.
Path parameters
edit-
<connector_id> - (Required, string)
Request body
edit-
scheduling - (Required, object) The scheduling configuration for the connector. This configuration determines frequency of synchronization operations for the connector.
The scheduling configuration includes the following attributes, each represented as a ScheduleConfig object. If the scheduling object does not include all schedule types, only those provided will be updated; the others will remain unchanged.
-
access_control(Optional,ScheduleConfigobject) Defines the schedule for synchronizing access control settings of the connector. -
full(Optional,ScheduleConfigobject) Defines the schedule for a full content syncs. -
incremental(Optional,ScheduleConfigobject) Defines the schedule for incremental content syncs.
Each ScheduleConfig object includes the following sub-attributes:
-
enabled(Required, boolean) A flag that enables or disables the scheduling. -
interval(Required, string) A CRON expression representing the sync schedule. This expression defines the grequency at which the sync operations should occur. It must be provided in a valid CRON format.
Response codes
edit-
200 -
Connector
schedulingfield was successfully updated. -
400 -
The
connector_idwas not provided or the request payload was malformed. -
404(Missing resources) -
No connector matching
connector_idcould be found.
Examples
editThe following example updates the scheduling property for the connector with ID my-connector:
resp = client.connector.update_scheduling(
connector_id="my-connector",
scheduling={
"access_control": {
"enabled": True,
"interval": "0 10 0 * * ?"
},
"full": {
"enabled": True,
"interval": "0 20 0 * * ?"
},
"incremental": {
"enabled": False,
"interval": "0 30 0 * * ?"
}
},
)
print(resp)
response = client.connector.update_scheduling(
connector_id: 'my-connector',
body: {
scheduling: {
access_control: {
enabled: true,
interval: '0 10 0 * * ?'
},
full: {
enabled: true,
interval: '0 20 0 * * ?'
},
incremental: {
enabled: false,
interval: '0 30 0 * * ?'
}
}
}
)
puts response
const response = await client.connector.updateScheduling({
connector_id: "my-connector",
scheduling: {
access_control: {
enabled: true,
interval: "0 10 0 * * ?",
},
full: {
enabled: true,
interval: "0 20 0 * * ?",
},
incremental: {
enabled: false,
interval: "0 30 0 * * ?",
},
},
});
console.log(response);
PUT _connector/my-connector/_scheduling
{
"scheduling": {
"access_control": {
"enabled": true,
"interval": "0 10 0 * * ?"
},
"full": {
"enabled": true,
"interval": "0 20 0 * * ?"
},
"incremental": {
"enabled": false,
"interval": "0 30 0 * * ?"
}
}
}
{
"result": "updated"
}
The following example updates full sync schedule only, other schedule types remain unchanged:
resp = client.connector.update_scheduling(
connector_id="my-connector",
scheduling={
"full": {
"enabled": True,
"interval": "0 10 0 * * ?"
}
},
)
print(resp)
const response = await client.connector.updateScheduling({
connector_id: "my-connector",
scheduling: {
full: {
enabled: true,
interval: "0 10 0 * * ?",
},
},
});
console.log(response);
PUT _connector/my-connector/_scheduling
{
"scheduling": {
"full": {
"enabled": true,
"interval": "0 10 0 * * ?"
}
}
}
{
"result": "updated"
}