Change syncRemoteTask scheduled task to be a POST (#3185)

Turns out before we were using GET for everything. The action is, and
should remain, a POST on the back end so let's call that.
This commit is contained in:
gbrodman
2026-07-29 18:52:59 +00:00
committed by GitHub
parent fc4246ea95
commit 0ce83c8b2d
2 changed files with 8 additions and 1 deletions
@@ -326,6 +326,7 @@
<task>
<url><![CDATA[/_dr/task/syncRemoteCache]]></url>
<name>syncRemoteCache</name>
<method>POST</method>
<description>
Syncs remote (Valkey/Redis) EPP resource caches with changes made recently.
</description>
@@ -71,6 +71,7 @@ type Task struct {
Timeout string `xml:"timeout"`
Schedule string `xml:"schedule"`
Name string `xml:"name"`
Method string `xml:"method"`
}
type QueuesSyncManager struct {
@@ -191,6 +192,11 @@ func (manager TasksSyncManager) getArgs(task Task, operationType string) []strin
var uri string
uri = fmt.Sprintf("https://%s.%s%s", service, baseDomain, strings.TrimSpace(task.URL))
method := "get"
if task.Method != "" {
method = strings.ToLower(task.Method)
}
args := []string{
"--project", projectName,
"scheduler", "jobs", operationType,
@@ -199,7 +205,7 @@ func (manager TasksSyncManager) getArgs(task Task, operationType string) []strin
"--schedule", task.Schedule,
"--uri", uri,
"--description", description,
"--http-method", "get",
"--http-method", method,
"--oidc-service-account-email", getCloudSchedulerServiceAccountEmail(),
"--oidc-token-audience", clientId,
}