Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ When app role enforcement is enabled, issue and renew operations require `Acmebo

## Operation Lifecycle

`POST /api/certificates` and `POST /api/certificates/{certificateName}/renew` return `202 Accepted` with a `Location` header. Poll that URL until it returns:
`POST /api/certificates` and `POST /api/certificates/{certificateName}/renew` return `202 Accepted` with a `Location` header. The header holds a path relative to the request, so resolve it against the endpoint you called. Poll that URL until it returns:

| Status | Meaning |
| --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion src/Acmebot.App/Functions/Http/AddCertificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public async Task<IActionResult> HttpStart(

LogOrchestrationStarted(logger, certificatePolicyItem.CertificateName, instanceId);

return AcceptedAtFunction($"{nameof(GetOperation)}_{nameof(GetOperation.HttpStart)}", new { instanceId }, null);
return Accepted(Url.RouteUrl($"{nameof(GetOperation)}_{nameof(GetOperation.HttpStart)}", new { instanceId }), null);
Comment thread
shibayan marked this conversation as resolved.
}

[LoggerMessage(LogLevel.Information, "Certificate issuance orchestration started. CertificateName: {CertificateName}. InstanceId: {InstanceId}")]
Expand Down
2 changes: 1 addition & 1 deletion src/Acmebot.App/Functions/Http/GetOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task<IActionResult> HttpStart(
return metadata.RuntimeStatus switch
{
OrchestrationRuntimeStatus.Failed => Problem(metadata.FailureDetails?.ErrorMessage, type: metadata.FailureDetails?.ErrorType),
OrchestrationRuntimeStatus.Running or OrchestrationRuntimeStatus.Pending => AcceptedAtFunction($"{nameof(GetOperation)}_{nameof(HttpStart)}", new { instanceId }, null),
OrchestrationRuntimeStatus.Running or OrchestrationRuntimeStatus.Pending => Accepted(Url.RouteUrl($"{nameof(GetOperation)}_{nameof(HttpStart)}", new { instanceId }), null),
Comment thread
shibayan marked this conversation as resolved.
_ => Ok()
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Acmebot.App/Functions/Http/RenewCertificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async Task<IActionResult> HttpStart(

LogOrchestrationStarted(logger, certificateName, instanceId);

return AcceptedAtFunction($"{nameof(GetOperation)}_{nameof(GetOperation.HttpStart)}", new { instanceId }, null);
return Accepted(Url.RouteUrl($"{nameof(GetOperation)}_{nameof(GetOperation.HttpStart)}", new { instanceId }), null);
Comment thread
shibayan marked this conversation as resolved.
}

[LoggerMessage(LogLevel.Information, "Certificate renewal orchestration started. CertificateName: {CertificateName}. InstanceId: {InstanceId}")]
Expand Down
Loading