## Edit Connector to update specific properties or Re-provision License Key `client.MagicTransit.Connectors.Edit(ctx, connectorID, params) (*ConnectorEditResponse, error)` **patch** `/accounts/{account_id}/magic/connectors/{connector_id}` Edit Connector to update specific properties or Re-provision License Key ### Parameters - `connectorID string` - `params ConnectorEditParams` - `AccountID param.Field[string]` Path param: Account identifier - `Activated param.Field[bool]` Body param - `InterruptWindowDaysOfWeek param.Field[[]ConnectorEditParamsInterruptWindowDaysOfWeek]` Body param: Allowed days of the week for upgrades. Default is all days. - `const ConnectorEditParamsInterruptWindowDaysOfWeekSunday ConnectorEditParamsInterruptWindowDaysOfWeek = "Sunday"` - `const ConnectorEditParamsInterruptWindowDaysOfWeekMonday ConnectorEditParamsInterruptWindowDaysOfWeek = "Monday"` - `const ConnectorEditParamsInterruptWindowDaysOfWeekTuesday ConnectorEditParamsInterruptWindowDaysOfWeek = "Tuesday"` - `const ConnectorEditParamsInterruptWindowDaysOfWeekWednesday ConnectorEditParamsInterruptWindowDaysOfWeek = "Wednesday"` - `const ConnectorEditParamsInterruptWindowDaysOfWeekThursday ConnectorEditParamsInterruptWindowDaysOfWeek = "Thursday"` - `const ConnectorEditParamsInterruptWindowDaysOfWeekFriday ConnectorEditParamsInterruptWindowDaysOfWeek = "Friday"` - `const ConnectorEditParamsInterruptWindowDaysOfWeekSaturday ConnectorEditParamsInterruptWindowDaysOfWeek = "Saturday"` - `InterruptWindowDurationHours param.Field[float64]` Body param - `InterruptWindowEmbargoDates param.Field[[]string]` Body param: List of dates (YYYY-MM-DD) when upgrades are blocked. - `InterruptWindowHourOfDay param.Field[float64]` Body param - `Notes param.Field[string]` Body param - `ProvisionLicense param.Field[bool]` Body param: When true, regenerate license key for the connector. - `Timezone param.Field[string]` Body param ### Returns - `type ConnectorEditResponse struct{…}` - `ID string` - `Activated bool` - `InterruptWindowDaysOfWeek []ConnectorEditResponseInterruptWindowDaysOfWeek` Allowed days of the week for upgrades. Default is all days. - `const ConnectorEditResponseInterruptWindowDaysOfWeekSunday ConnectorEditResponseInterruptWindowDaysOfWeek = "Sunday"` - `const ConnectorEditResponseInterruptWindowDaysOfWeekMonday ConnectorEditResponseInterruptWindowDaysOfWeek = "Monday"` - `const ConnectorEditResponseInterruptWindowDaysOfWeekTuesday ConnectorEditResponseInterruptWindowDaysOfWeek = "Tuesday"` - `const ConnectorEditResponseInterruptWindowDaysOfWeekWednesday ConnectorEditResponseInterruptWindowDaysOfWeek = "Wednesday"` - `const ConnectorEditResponseInterruptWindowDaysOfWeekThursday ConnectorEditResponseInterruptWindowDaysOfWeek = "Thursday"` - `const ConnectorEditResponseInterruptWindowDaysOfWeekFriday ConnectorEditResponseInterruptWindowDaysOfWeek = "Friday"` - `const ConnectorEditResponseInterruptWindowDaysOfWeekSaturday ConnectorEditResponseInterruptWindowDaysOfWeek = "Saturday"` - `InterruptWindowDurationHours float64` - `InterruptWindowEmbargoDates []string` List of dates (YYYY-MM-DD) when upgrades are blocked. - `InterruptWindowHourOfDay float64` - `LastUpdated string` - `Notes string` - `Timezone string` - `Device ConnectorEditResponseDevice` - `ID string` - `SerialNumber string` - `LastHeartbeat string` - `LastSeenVersion string` - `LicenseKey string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/magic_transit" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.MagicTransit.Connectors.Edit( context.TODO(), "connector_id", magic_transit.ConnectorEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "result": { "id": "id", "activated": true, "interrupt_window_days_of_week": [ "Sunday" ], "interrupt_window_duration_hours": 1, "interrupt_window_embargo_dates": [ "string" ], "interrupt_window_hour_of_day": 0, "last_updated": "last_updated", "notes": "notes", "timezone": "timezone", "device": { "id": "id", "serial_number": "serial_number" }, "last_heartbeat": "last_heartbeat", "last_seen_version": "last_seen_version", "license_key": "license_key" }, "success": true } ```