-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates App update cURL example to be complete
- Loading branch information
Showing
1 changed file
with
5 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X PUT \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/apps/{id}" | ||
curl -X PUT \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/apps/{id}" \ | ||
-d '{"spec":{"name":"web-app-01","region":"nyc","domains":[{"domain":"app.example.com","type":"DEFAULT","wildcard":true,"zone":"example.com","minimum_tls_version":"1.3"}],"services":[{"name":"api","git":{"branch":"main","repo_clone_url":"https://github.com/digitalocean/sample-golang.git"},"github":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"gitlab":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"image":{"registry":"registry.hub.docker.com","registry_type":"DOCR","registry_credentials":"my-dockerhub-username:dckr_pat_the_access_token","repository":"origin/master","tag":"latest","digest":"sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041ac","deploy_on_push":{"enabled":true}},"dockerfile_path":"path/to/Dockerfile","build_command":"npm run build","run_command":"bin/api","source_dir":"path/to/dir","envs":[{"key":"BASE_URL","scope":"BUILD_TIME","type":"GENERAL","value":"http://example.com"}],"environment_slug":"node-js","log_destinations":[{"name":"my_log_destination","papertrail":{"endpoint":"https://mypapertrailendpoint.com"},"datadog":{"endpoint":"https://mydatadogendpoint.com","api_key":"abcdefghijklmnopqrstuvwxyz0123456789"},"logtail":{"token":"abcdefghijklmnopqrstuvwxyz0123456789"},"open_search":{"endpoint":"https://example.com:9300","basic_auth":{"user":"apps_user","password":"password1"},"index_name":"logs","cluster_name":"my-opensearch-cluster"}}],"instance_count":2,"instance_size_slug":"apps-s-1vcpu-0.5gb","autoscaling":{"min_instance_count":2,"max_instance_count":3,"metrics":{"cpu":{"percent":75}}},"cors":{"allow_origins":[{"exact":"https://www.example.com"},{"regex":"^.*example.com"}],"allow_methods":["GET","OPTIONS","POST","PUT","PATCH","DELETE"],"allow_headers":["Content-Type","X-Custom-Header"],"expose_headers":["Content-Encoding","X-Custom-Header"],"max_age":"5h30m","allow_credentials":false},"health_check":{"failure_threshold":2,"port":80,"http_path":"/health","initial_delay_seconds":30,"period_seconds":60,"success_threshold":3,"timeout_seconds":45},"protocol":"HTTP","http_port":3000,"internal_ports":[80,443],"routes":[{"path":"/api","preserve_path_prefix":true}],"termination":{"drain_seconds":15,"grace_period_seconds":120}}],"static_sites":[{"name":"api","git":{"branch":"main","repo_clone_url":"https://github.com/digitalocean/sample-golang.git"},"github":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"gitlab":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"image":{"registry":"registry.hub.docker.com","registry_type":"DOCR","registry_credentials":"my-dockerhub-username:dckr_pat_the_access_token","repository":"origin/master","tag":"latest","digest":"sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041ac","deploy_on_push":{"enabled":true}},"dockerfile_path":"path/to/Dockerfile","build_command":"npm run build","run_command":"bin/api","source_dir":"path/to/dir","envs":[{"key":"BASE_URL","scope":"BUILD_TIME","type":"GENERAL","value":"http://example.com"}],"environment_slug":"node-js","log_destinations":[{"name":"my_log_destination","papertrail":{"endpoint":"https://mypapertrailendpoint.com"},"datadog":{"endpoint":"https://mydatadogendpoint.com","api_key":"abcdefghijklmnopqrstuvwxyz0123456789"},"logtail":{"token":"abcdefghijklmnopqrstuvwxyz0123456789"},"open_search":{"endpoint":"https://example.com:9300","basic_auth":{"user":"apps_user","password":"password1"},"index_name":"logs","cluster_name":"my-opensearch-cluster"}}],"index_document":"main.html","error_document":"error.html","catchall_document":"index.html","output_dir":"dist/","cors":{"allow_origins":[{"exact":"https://www.example.com"},{"regex":"^.*example.com"}],"allow_methods":["GET","OPTIONS","POST","PUT","PATCH","DELETE"],"allow_headers":["Content-Type","X-Custom-Header"],"expose_headers":["Content-Encoding","X-Custom-Header"],"max_age":"5h30m","allow_credentials":false},"routes":[{"path":"/api","preserve_path_prefix":true}]}],"jobs":[{"name":"api","git":{"branch":"main","repo_clone_url":"https://github.com/digitalocean/sample-golang.git"},"github":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"gitlab":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"image":{"registry":"registry.hub.docker.com","registry_type":"DOCR","registry_credentials":"my-dockerhub-username:dckr_pat_the_access_token","repository":"origin/master","tag":"latest","digest":"sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041ac","deploy_on_push":{"enabled":true}},"dockerfile_path":"path/to/Dockerfile","build_command":"npm run build","run_command":"bin/api","source_dir":"path/to/dir","envs":[{"key":"BASE_URL","scope":"BUILD_TIME","type":"GENERAL","value":"http://example.com"}],"environment_slug":"node-js","log_destinations":[{"name":"my_log_destination","papertrail":{"endpoint":"https://mypapertrailendpoint.com"},"datadog":{"endpoint":"https://mydatadogendpoint.com","api_key":"abcdefghijklmnopqrstuvwxyz0123456789"},"logtail":{"token":"abcdefghijklmnopqrstuvwxyz0123456789"},"open_search":{"endpoint":"https://example.com:9300","basic_auth":{"user":"apps_user","password":"password1"},"index_name":"logs","cluster_name":"my-opensearch-cluster"}}],"instance_count":2,"instance_size_slug":"apps-s-1vcpu-0.5gb","autoscaling":{"min_instance_count":2,"max_instance_count":3,"metrics":{"cpu":{"percent":75}}},"kind":"PRE_DEPLOY","termination":{"grace_period_seconds":120}}],"workers":[{"name":"api","git":{"branch":"main","repo_clone_url":"https://github.com/digitalocean/sample-golang.git"},"github":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"gitlab":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"image":{"registry":"registry.hub.docker.com","registry_type":"DOCR","registry_credentials":"my-dockerhub-username:dckr_pat_the_access_token","repository":"origin/master","tag":"latest","digest":"sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041ac","deploy_on_push":{"enabled":true}},"dockerfile_path":"path/to/Dockerfile","build_command":"npm run build","run_command":"bin/api","source_dir":"path/to/dir","envs":[{"key":"BASE_URL","scope":"BUILD_TIME","type":"GENERAL","value":"http://example.com"}],"environment_slug":"node-js","log_destinations":[{"name":"my_log_destination","papertrail":{"endpoint":"https://mypapertrailendpoint.com"},"datadog":{"endpoint":"https://mydatadogendpoint.com","api_key":"abcdefghijklmnopqrstuvwxyz0123456789"},"logtail":{"token":"abcdefghijklmnopqrstuvwxyz0123456789"},"open_search":{"endpoint":"https://example.com:9300","basic_auth":{"user":"apps_user","password":"password1"},"index_name":"logs","cluster_name":"my-opensearch-cluster"}}],"instance_count":2,"instance_size_slug":"apps-s-1vcpu-0.5gb","autoscaling":{"min_instance_count":2,"max_instance_count":3,"metrics":{"cpu":{"percent":75}}},"termination":{"grace_period_seconds":120}}],"functions":[{"cors":{"allow_origins":[{"exact":"https://www.example.com"},{"regex":"^.*example.com"}],"allow_methods":["GET","OPTIONS","POST","PUT","PATCH","DELETE"],"allow_headers":["Content-Type","X-Custom-Header"],"expose_headers":["Content-Encoding","X-Custom-Header"],"max_age":"5h30m","allow_credentials":false},"routes":[{"path":"/api","preserve_path_prefix":true}],"name":"api","source_dir":"path/to/dir","alerts":[{"rule":"CPU_UTILIZATION","disabled":false,"operator":"GREATER_THAN","value":2.32,"window":"FIVE_MINUTES"}],"envs":[{"key":"BASE_URL","scope":"BUILD_TIME","type":"GENERAL","value":"http://example.com"}],"git":{"branch":"main","repo_clone_url":"https://github.com/digitalocean/sample-golang.git"},"github":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"gitlab":{"branch":"main","deploy_on_push":true,"repo":"digitalocean/sample-golang"},"log_destinations":[{"name":"my_log_destination","papertrail":{"endpoint":"https://mypapertrailendpoint.com"},"datadog":{"endpoint":"https://mydatadogendpoint.com","api_key":"abcdefghijklmnopqrstuvwxyz0123456789"},"logtail":{"token":"abcdefghijklmnopqrstuvwxyz0123456789"},"open_search":{"endpoint":"https://example.com:9300","basic_auth":{"user":"apps_user","password":"password1"},"index_name":"logs","cluster_name":"my-opensearch-cluster"}}]}],"databases":[{"cluster_name":"cluster_name","db_name":"my_db","db_user":"superuser","engine":"PG","name":"prod-db","production":true,"version":"12"}],"ingress":{"rules":[{"match":{"path":{"prefix":"/api"}},"cors":{"allow_origins":[{"exact":"https://www.example.com"},{"regex":"^.*example.com"}],"allow_methods":["GET","OPTIONS","POST","PUT","PATCH","DELETE"],"allow_headers":["Content-Type","X-Custom-Header"],"expose_headers":["Content-Encoding","X-Custom-Header"],"max_age":"5h30m","allow_credentials":false},"component":{"name":"web","preserve_path_prefix":"true","rewrite":"/api/v1/"},"redirect":{"uri":"/about","authority":"example.com","port":443,"scheme":"https","redirect_code":302}}]},"egress":{"type":"AUTOASSIGN"},"maintenance":{"enabled":true,"archive":true}},"update_all_source_versions":true}' |