Cancel Deployment
curl --request POST \
--url https://sdk.localops.co/v1/deployments/{deploymentId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://sdk.localops.co/v1/deployments/{deploymentId}/cancel"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://sdk.localops.co/v1/deployments/{deploymentId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sdk.localops.co/v1/deployments/{deploymentId}/cancel"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "success",
"data": {
"deployment": {
"id": "3c7a4d81-0000-0000-0000-000000000000",
"type": "service_update",
"state": "failed",
"service_id": "b1f0a9c2-0000-0000-0000-000000000000",
"op_ids": [
"9d2e4c71-0000-0000-0000-000000000000"
],
"ops": {
"9d2e4c71-0000-0000-0000-000000000000": {
"id": "9d2e4c71-0000-0000-0000-000000000000",
"type": "service_deploy",
"state": "canceled"
}
}
}
}
}Deployments
Cancel Deployment
Stop a deployment that has not finished.
Only queued and in_progress deployments can be canceled. A canceled deployment ends in state failed, and its operation ends in state canceled.
Cancel Deployment
curl --request POST \
--url https://sdk.localops.co/v1/deployments/{deploymentId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://sdk.localops.co/v1/deployments/{deploymentId}/cancel"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://sdk.localops.co/v1/deployments/{deploymentId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sdk.localops.co/v1/deployments/{deploymentId}/cancel"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "success",
"data": {
"deployment": {
"id": "3c7a4d81-0000-0000-0000-000000000000",
"type": "service_update",
"state": "failed",
"service_id": "b1f0a9c2-0000-0000-0000-000000000000",
"op_ids": [
"9d2e4c71-0000-0000-0000-000000000000"
],
"ops": {
"9d2e4c71-0000-0000-0000-000000000000": {
"id": "9d2e4c71-0000-0000-0000-000000000000",
"type": "service_deploy",
"state": "canceled"
}
}
}
}
}This endpoint is not live yet. The shapes below show how it is expected to work so you can plan your
integration, and may change before release. Calls to this path return
404 today.Authorizations
Your account API token, sent as Authorization: Bearer <api_token>. Owners and admins can read the token from the LocalOps console.
Path Parameters
The unique identifier of the deployment
Body
application/json
The body is of type object.
Was this page helpful?
⌘I